OSDev.org

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

All times are UTC - 6 hours




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: GCC cross-toolchain tutorial for Mac OS X
PostPosted: Fri Apr 25, 2014 4:11 pm 
Offline
Member
Member
User avatar

Joined: Mon Mar 05, 2012 11:23 am
Posts: 616
Location: Germany
Hey guys,

I just had to setup a new developer machine running OS X, and took the chance to document what is necessary to build a cross compiler on a plain Mac OS 10.9.

My tutorial might be a little redundant to the "GCC Cross compiler" wiki page, but it's a little shorter, easier, more up to date and specific to OSX. I mostly wrote it so I don't forget how to do it myself :D

http://wiki.osdev.org/User:Max/Building ... _Mavericks

It would be nice if one of you could have a short look if everything is alright - maybe we could even add this page to the current cross compiler tutorial page, if you think this makes sense.

Greets :)

_________________
Ghost OS - GitHub


Top
 Profile  
 
 Post subject: Re: GCC cross-toolchain tutorial for Mac OS X
PostPosted: Fri Apr 25, 2014 4:56 pm 
Offline
Member
Member
User avatar

Joined: Wed Mar 21, 2012 3:01 pm
Posts: 930
Hi Max.

Thanks for your contribution!

Instructions for obscure systems such as OS X and Cygwin are usually hard to write for Linux users such as me (that consider such systems obscure and pretend they don't exist when writing wiki articles (:P).) Joking aside, I'm happy to see freshly confirmed instructions. OS X and clang (LLVM) are fast moving targets and wiki instructions for them tend to get significantly out of date, so any help confirming that the instructions work or whether they don't is useful :-)

You really shouldn't make more permutation articles such as `Building a GCC FOO cross-compiler on BAR version QUX'. The wiki already has a ton of slightly diverging Bare Bones, I don't want the same to happen for cross-compiler tutorials too. I can see your tutorial is mostly the same as the current official cross-compiler tutorial, except for useful homebrew instructions. Tomorrow or something I'll take the unique parts of your tutorial and integrate them into the official cross-compiler tutorial, so we have one central cross-compiler tutorial. Perhaps it is warranted, though, to have special `Getting a real GCC on OS X' and `Installing Cygwin' tutorials with various platform idiosyncrasies to keep the core tutorial simple.

Btw. Use the preview button when you edit an article. You made a lot of small edits which spammed the Recent Changes log. This makes it considerably harder for wiki volunteers to review your work. It is perfectly alright to make a bunch of subsequent edits to an article if you must, but 30 is too much. :-)


Top
 Profile  
 
 Post subject: Re: GCC cross-toolchain tutorial for Mac OS X
PostPosted: Fri Apr 25, 2014 5:06 pm 
Offline
Member
Member
User avatar

Joined: Mon Mar 05, 2012 11:23 am
Posts: 616
Location: Germany
Hey sortie,

thanks for the reply! :) Okay, I think integrating would be a good idea. Yeah, I thought that some stuff would be a little redundant, but maybe some parts of it help you updating the cross compiler page ;)

sortie wrote:
Btw. Use the preview button when you edit an article. You made a lot of small edits which spammed the Recent Changes log. This makes it considerably harder for wiki volunteers to review your work. It is perfectly alright to make a bunch of subsequent edits to an article if you must, but 30 is too much. :-)

Oooh I'm very sorry, I didn't think about that. I will use that button from now on :>

Greets :)

_________________
Ghost OS - GitHub


Top
 Profile  
 
 Post subject: Re: GCC cross-toolchain tutorial for Mac OS X
PostPosted: Sat Apr 26, 2014 7:30 am 
Offline
Member
Member
User avatar

Joined: Fri Jun 13, 2008 3:21 pm
Posts: 1700
Location: Cambridge, United Kingdom
GCC compiles perfectly fine with the version of clang shipped with xcode. There is no reason to build a standard GCC. GCC has poor support for OS X, and use of the shipped libstdc++ library can cause very hard to debug problems.


Top
 Profile  
 
 Post subject: Re: GCC cross-toolchain tutorial for Mac OS X
PostPosted: Sat Apr 26, 2014 9:00 am 
Offline
Member
Member
User avatar

Joined: Mon Mar 05, 2012 11:23 am
Posts: 616
Location: Germany
Owen wrote:
GCC compiles perfectly fine with the version of clang shipped with xcode. There is no reason to build a standard GCC. GCC has poor support for OS X, and use of the shipped libstdc++ library can cause very hard to debug problems.


Yeah, basically Homebrew also compiles GCC with LLVM. So that shouldn't be a problem. I just find it a little bit more "natural" to build the cross compiler with a real GCC :3
Why libstdc++? I don't mention using libstdc++, I am only telling how to build libgcc for the target system.

_________________
Ghost OS - GitHub


Top
 Profile  
 
 Post subject: Re: GCC cross-toolchain tutorial for Mac OS X
PostPosted: Sun Apr 27, 2014 8:48 am 
Offline
Member
Member
User avatar

Joined: Fri Jun 13, 2008 3:21 pm
Posts: 1700
Location: Cambridge, United Kingdom
max wrote:
Owen wrote:
GCC compiles perfectly fine with the version of clang shipped with xcode. There is no reason to build a standard GCC. GCC has poor support for OS X, and use of the shipped libstdc++ library can cause very hard to debug problems.


Yeah, basically Homebrew also compiles GCC with LLVM. So that shouldn't be a problem. I just find it a little bit more "natural" to build the cross compiler with a real GCC :3
Why libstdc++? I don't mention using libstdc++, I am only telling how to build libgcc for the target system.


If you compile GCC with GCC, you use libstdc++ as the C++ runtime.

The GCC 4.9 libstdc++ can conflict with the system Apple-GCC-4.2 libstdc++'s symbols. This can cause issues.


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

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 24 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