Is it really a have to to use a cross compiler

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
ark
Posts: 2
Joined: Fri Aug 13, 2021 3:19 am

Is it really a have to to use a cross compiler

Post by ark »

Up to really now i have used normal gcc installed on my system. I changed because i thought it may be better to use a cross compilers, like the wiki page says. Is it possible to create a good os (i mean one that can run programs and pretty much like linux) and just compile with normal gcc
Octocontrabass
Member
Member
Posts: 5563
Joined: Mon Mar 25, 2013 7:01 pm

Re: Is it really a have to to use a cross compiler

Post by Octocontrabass »

Yes, it's possible, but it's a bad idea.

We have an entire wiki page on the subject.
User avatar
Maddie
Posts: 13
Joined: Tue Aug 10, 2021 4:22 pm
Libera.chat IRC: maddie

Re: Is it really a have to to use a cross compiler

Post by Maddie »

Just use a cross-compiler. It's very easy if you follow the instructions on the wiki, and it will save you a lot of trouble to have a toolchain specific to your OS.
User avatar
bzt
Member
Member
Posts: 1584
Joined: Thu Oct 13, 2016 4:55 pm
Contact:

Re: Is it really a have to to use a cross compiler

Post by bzt »

Octocontrabass wrote:Yes, it's possible, but it's a bad idea.
I agree. You'll run into strange and unexplainable bugs later (most commonly caused by mixed up host / target headers and such).

Cheers,
bzt
nexos
Member
Member
Posts: 1081
Joined: Tue Feb 18, 2020 3:29 pm
Libera.chat IRC: nexos

Re: Is it really a have to to use a cross compiler

Post by nexos »

Using a cross compiler provides a clean separation of host and target, as bzt said. Your OS will be full independent of your host, and will be able to become your OS.
"How did you do this?"
"It's very simple — you read the protocol and write the code." - Bill Joy
Projects: NexNix | libnex | nnpkg
ark
Posts: 2
Joined: Fri Aug 13, 2021 3:19 am

Re: Is it really a have to to use a cross compiler

Post by ark »

Maddie wrote:Just use a cross-compiler. It's very easy if you follow the instructions on the wiki, and it will save you a lot of trouble to have a toolchain specific to your OS.
I have built the cross compiler many times and also used the prebuilt ones. It is actually harder to get working on ubuntu than on arch.
User avatar
iansjack
Member
Member
Posts: 4703
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: Is it really a have to to use a cross compiler

Post by iansjack »

It's not essential to use a cross-compiler. It just makes development easier and less error prone. In fact, it's not essential to use a compiler, or even an assembler. But, in all these cases, you are making life difficult for yourself if you don't choose the right tools.
Post Reply