# Compiling linux-kernel under OS X?



## stefanus (Aug 25, 2006)

I'm trying to compile a linux/i386 kernel under OS X 10.4.7 on my G5.
Does anyone know if this is possible? It would be very nice if someone did, as it takes my x86 box(an old 500 mhz Acer laptop) the good part of three hours to complete, modules and all.


----------



## symphonix (Aug 25, 2006)

The compilers in OSX would be setup towards compiling for Mac OS X. Instead of trying to muddle with compiler settings in your Mac system, you might be better off to boot the Mac into a Linux system, and use that to compile your program. Thus, less setting up.

However, it probably wouldn't be that much faster. A lot of the time taken during compiling is for disk access, for files needed during the compile. And three hours to compile a Linux kernel is not at all unusual.


----------



## tomdkat (Sep 19, 2006)

You will need a cross-toolchain (compiler, linker, etc), hosted on OS X and targetting Linux.  I was able to find a pre-built one here but it might not suit your needs.

It is possible to build cross-toolchain from source but I don't know how painful that is on OS X.

Peace...


----------



## Sunnz (Sep 19, 2006)

3 hours??

It usually less than an hour for me... on Gentoo...


----------



## Viro (Sep 20, 2006)

3 hours is about right for a 500 Mhz processor.

http://www-128.ibm.com/developerworks/edu/l-dw-l-cross-i.html contains instructions for developing a cross compiler. It requires registration, but registration is free.


----------



## michaelsanford (Sep 20, 2006)

Slightly off-topic: I was compiling a kernel on my old 200 MHz machine and it took half the night. On my new Athlon64 bit it took all of 9 minutes.


----------

