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...
GCC cross-compiler on mac os
Re: GCC cross-compiler on mac os
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.alaroldai wrote:However, as of Mac OS 10.7 and Xcode 4.2, Apple doesn't seem to provide a 'regular' version of gcc
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.