OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Mar 28, 2024 9:55 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: Is it really a have to to use a cross compiler
PostPosted: Fri Aug 13, 2021 3:35 am 
Offline

Joined: Fri Aug 13, 2021 3:19 am
Posts: 2
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


Top
 Profile  
 
 Post subject: Re: Is it really a have to to use a cross compiler
PostPosted: Mon Aug 16, 2021 8:02 pm 
Offline
Member
Member

Joined: Mon Mar 25, 2013 7:01 pm
Posts: 5099
Yes, it's possible, but it's a bad idea.

We have an entire wiki page on the subject.


Top
 Profile  
 
 Post subject: Re: Is it really a have to to use a cross compiler
PostPosted: Tue Aug 17, 2021 11:30 am 
Offline
User avatar

Joined: Tue Aug 10, 2021 4:22 pm
Posts: 13
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.


Top
 Profile  
 
 Post subject: Re: Is it really a have to to use a cross compiler
PostPosted: Tue Aug 17, 2021 11:34 am 
Offline
Member
Member
User avatar

Joined: Thu Oct 13, 2016 4:55 pm
Posts: 1584
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


Top
 Profile  
 
 Post subject: Re: Is it really a have to to use a cross compiler
PostPosted: Tue Aug 17, 2021 11:36 am 
Offline
Member
Member

Joined: Tue Feb 18, 2020 3:29 pm
Posts: 1071
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


Top
 Profile  
 
 Post subject: Re: Is it really a have to to use a cross compiler
PostPosted: Sat Aug 21, 2021 4:50 am 
Offline

Joined: Fri Aug 13, 2021 3:19 am
Posts: 2
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.


Top
 Profile  
 
 Post subject: Re: Is it really a have to to use a cross compiler
PostPosted: Sun Aug 22, 2021 4:05 am 
Offline
Member
Member
User avatar

Joined: Sat Mar 31, 2012 3:07 am
Posts: 4591
Location: Chichester, UK
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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: Majestic-12 [Bot] and 65 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group