# GCC Cross Compiler



## Fotis (Apr 19, 2018)

Hi to everybody. I don't know if this is the right place for this post but I am looking for a port so I can build up a GCC Cross Compiler with TARGET i386-i686. It wil be used for developing another operating system. I searched here and found one similar way to Ubuntu but I guess it's not the right way.
Thanks anyway.


----------



## SirDice (Apr 20, 2018)

Perhaps this will provide some insights: https://wiki.freebsd.org/A_Brief_Guide_To_Cross_Compiling_FreeBSD


----------



## Fotis (Apr 20, 2018)

Thank you very much i will give it a look........


----------



## Fotis (Apr 23, 2018)

Fotis said:


> Thank you very much i will give it a look........



Hello again.I read again and again the link you gave me and I have some questions.
1)This is a way you can build from scratch the FreeBSD Operating System from ground.If I wanted to build something different for example an operating system of my own,is this possible??And if yes what parameters should i change??
And the truth is that the OP am interesting in is something simple something on my own.
2)In the above way its not very clear what compiler the Host system is using.I suspect CLANG but what if i wanted GCC?
To be honest with you all this i was inspired from GCC Cross Compiler and in beggining i thought that mayby there was a specific port that could do my job.
Thank you in advance for your time...


----------



## SirDice (Apr 23, 2018)

Fotis said:


> If I wanted to build something different for example an operating system of my own,is this possible??


If it's possible for FreeBSD to do a complete build for an entirely different architecture it should be possible for your project too. But that said, the whole FreeBSD source tree is set up to make this possible, so your project will need to do something similar. 



Fotis said:


> In the above way its not very clear what compiler the Host system is using.I suspect CLANG but what if i wanted GCC?


Yes, the default compiler for FreeBSD is Clang nowadays. But it used to be GCC. And as far as I know the process is very similar between those two.  

Maybe you can start with a clean FreeBSD and do a few regular world builds so you get an idea of the process. Then try to do a cross-build for i386 (easiest to test in a virtual machine for example).


----------



## Fotis (Apr 25, 2018)

Thank you for your time again,I will give it a try my friend!!


----------



## erikw (Jun 6, 2018)

I have some learning and script on how to create a GCC cross compiler from "scratch", that might help you on my Github that I created when I worked on my master thesis:

https://github.com/erikw/ewxb_gcc_cross-compiler_builder


----------



## Spartrekus (Jun 19, 2018)

The attempt is likely possible. Thank you for the above link.
erikw


----------

