After much searching I finally found a cross compiler for osx. It's a bit dated (gcc 4.1.1), but it'll do for now. So now I get to use mac's über sexy development environment. Pics below.
Textmate
Q, a qemu port to osx.
Successful linux cross-compiling under Leopard
- Nick Carlson
- Posts: 18
- Joined: Fri Feb 29, 2008 6:08 pm
Re: Successful linux cross-compiling under Leopard
Why don't you just compile it yourself. Mac OS X is a complete UNIX system, right? Then gcc should compile fine on it.After much searching I finally found a cross compiler for osx.
-
pcmattman
- Member

- Posts: 2566
- Joined: Sun Jan 14, 2007 9:15 pm
- Libera.chat IRC: miselin
- Location: Sydney, Australia (I come from a land down under!)
- Contact:
Re: Successful linux cross-compiling under Leopard
Actually, due to several protection features of OSX it's extremely difficult to compile a cross-compiler. At least, "apparently"...iammisc wrote:Why don't you just compile it yourself. Mac OS X is a complete UNIX system, right? Then gcc should compile fine on it.After much searching I finally found a cross compiler for osx.
Re: Successful linux cross-compiling under Leopard
Actually it's VERY easy. Just follow the GCC Cross Compiler tutorial on the wiki. I've done it successfully with binutils 2.18 and gcc 4.2.4. I even wrote a script to download sources, apply patches (to enable a target for my OS), and compile the whole thing. The script is written in shell, and works on Mac OS X, Linux, OpenBSD, and Cygwin. I'll post that if anyone is interested.pcmattman wrote: Actually, due to several protection features of OSX it's extremely difficult to compile a cross-compiler. At least, "apparently"...
Btw, I prefer Smultron to Textmate.
-
thomasloven
- Member

- Posts: 89
- Joined: Tue Feb 26, 2008 10:47 am
- Location: Sweden
Re: Successful linux cross-compiling under Leopard
The big problem, as I see it, lies in getting the X-code-package which you need to compile gcc.
It's supposed to be on the OSX dvds, but (at least on my Swedish version of 10.5) it isn't.
Downloading it off the apple developer site is way more complicated than it should be and you get a GB or two of c... stuff you'd never use anyway with it.
BTW. I'm interested in that script.
It's supposed to be on the OSX dvds, but (at least on my Swedish version of 10.5) it isn't.
Downloading it off the apple developer site is way more complicated than it should be and you get a GB or two of c... stuff you'd never use anyway with it.
BTW. I'm interested in that script.
- Nick Carlson
- Posts: 18
- Joined: Fri Feb 29, 2008 6:08 pm
Re: Successful linux cross-compiling under Leopard
I never thought of the Xcode package not being on the OSX dvds, or about those guys running OSx86.thomasloven wrote:The big problem, as I see it, lies in getting the X-code-package which you need to compile gcc.
It's supposed to be on the OSX dvds, but (at least on my Swedish version of 10.5) it isn't.
Downloading it off the apple developer site is way more complicated than it should be and you get a GB or two of c... stuff you'd never use anyway with it.
BTW. I'm interested in that script.
I tried writing this script in pure sh, for the people I know that run OpenBSD (where /bin/sh is /bin/pdksh), but in the end I gave up and just switched it to /bin/bash. All my machines have bash as /bin/sh and I'm too lazy to install an OpenBSD VM anywhere to test this, so just run it with bash.
The script isn't perfect by any means, so I'd gladly take any patches to it. Right now it only compiles binutils 2.18 and gcc 4.2.4. The gcc it compiles is a naked compiler, so should be perfect for your OSDev desires.
If anyone is interested, I'd be willing to just host precompiled binaries for OS X cross compilers as well.
- Attachments
-
- mkcross-dev.sh.zip
- SH Script to cross compile binutils 2.18 and gcc 4.2.4
- (2.67 KiB) Downloaded 49 times
- Nick Carlson
- Posts: 18
- Joined: Fri Feb 29, 2008 6:08 pm
Re: Successful linux cross-compiling under Leopard
Sorry for the late reply. I just wanted to add that I cross-compiled gcc 4.2.2 on osx 10.5.3 with relative ease using instructions from the wiki. (In case anyone else is thinking of doing the same.)
-
blackcatcoder
- Member

- Posts: 132
- Joined: Wed Nov 03, 2004 12:00 am
- Location: Austria
- Contact:
Re: Successful linux cross-compiling under Leopard
Also compiled gcc and other stuff on Mac OSx 10.5.4(AMD hackintosh) with ease.

