Compiling 2.6.32.3 on non-ELF systems

From: Brian Waters
Date: Thu Jan 14 2010 - 20:47:26 EST


So I've been having trouble getting a decent linux distro installed on
an old Mac box, and have decided to just cross-compile a system from
scratch.

I built a nice cross compiler (gcc-4.4.2, binutils-2.20 on OS X
10.4.11 w/ Xcode 2.5).

When I run make ARCH=powerpc CROSS_COMPILE=powerpc-elf- in the
linux-2.6.32.3 tree, it starts using the host compiler to build a
bunch of stuff (mostly in the scripts subdir), until it gets to
scripts/mod/mk_elfconfig.c, where it fails because it can't find
elf.h.

I did some snooping, and there is no elf.h on OS X, because OS X does
not use ELF binaries. elf.h is present in glibc and some other
linux-based libc implementations, but I couldn't find one on
NetBSD-current, which I believe uses ELF, or on AIX (not sure of the
version or binary format on that one). So, as it stands, it seems that
one must use a elf/glibc/linux based system as the host when compiling
the kernel.

Is this a limitation of the kernel build system, or am I missing
something? Any workarounds for non-ELF hosts? I have heard that it is
possible...

- BW

P.S. It might be worth mentioning that I'm compiling a kernel without
loadable modules, so scripts/mod/* doesn't seem essential here...
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/