Building a kernel without a 32 bit gcc
The attached patch to linux-2.6.4 eliminates the need for a 32 bit gcc
for building a kernel which supports 32 bit executables. It is still
necessary to have a biarch binutils, but ours is already biarch capable.
I handled arch/x86_64/boot/compressed/misc.o by generating an assembly
listing misc.S using a cross compiler. This step could also be done on
a 32 bit system. For reference, the command I used is:
i386-pc-linux-gnu-gcc -S -Wp,-MD,arch/x86_64/boot/compressed/.misc.o.d \
-nostdinc -iwithprefix include -D__KERNEL__ -Iinclude -Wa,--32 \
-D__KERNEL__ -Iinclude -O2 -DKBUILD_BASENAME=misc \
-DKBUILD_MODNAME=misc -c -o arch/x86_64/boot/compressed/misc.S \
To get kbuild to compile misc.o from misc.S rather than misc.c, I
renamed misc.c to misc.foo.c. That's actually the bulk of the patch.
The rest is jest a few Makefile changes.
This may work as a short term solution to allow people to build kernels.