GCC cross-compiler on mac os

All about the OSDev Wiki. Discussions about the organization and general structure of articles and how to use the wiki. Request changes here if you don't know how to use the wiki.
Post Reply
alaroldai
Posts: 19
Joined: Sat May 07, 2011 6:34 am

GCC cross-compiler on mac os

Post by alaroldai »

The GCC cross-compiler page gives advice about building GCC/binutils on mac os, specifically it says to change the default $(CC) from apple's llvm-gcc to gcc-4.2 in /usr/bin.

However, as of Mac OS 10.7 and Xcode 4.2, Apple doesn't seem to provide a 'regular' version of gcc - instead they provide clang and a version of llvm that may (or may not, I haven't checked) be the same as their own, meaning that it might not support cross compilation.

Has anyone had any luck building a GCC cross compiler on mac os with the new tools? I've been having a look at using LLVM to compile my kernel instead of GCC, but so far it's looking a bit messy.

If anyone's found a good toolchain for kernel dev on mac, that might be worth putting on the wiki...
User avatar
turdus
Member
Member
Posts: 496
Joined: Tue Feb 08, 2011 1:58 pm

Re: GCC cross-compiler on mac os

Post by turdus »

alaroldai wrote:However, as of Mac OS 10.7 and Xcode 4.2, Apple doesn't seem to provide a 'regular' version of gcc
They provide it, it's just not installed by default. You can find the .mpkg on the 2nd DVD of your install DVD set in a subdirectory called Optional.

Code: Select all

imac:~ turdus$ gcc --version
i686-apple-darwin10-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5646)
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Post Reply