On Thu, 2005-12-08 at 20:48 +0100, Kai Ruemmler wrote:
* Lee Revell <rlrevell(a)joe-job.com> wrote:
All I am trying to do is compile an x86_64 kernel
on i386 machine. It
dos not work:
$ ARCH=x86_64 make oldconfig
<no errors>
$ ARCH=x86_64 make
[...]
What gives? Do I need a different compiler to
build for x86_64?
Yes.
Cross compiling the kernel works like this:
$ make ARCH=<arch> CROSS_COMPILE=<arch-prefix>
The gcc cross compiler for x86_64 is usually named x86_64-linux-gcc.
In the special case of x86 -> x86_64 a 64 bit enabled gcc is sufficient
though (if your binutils support 64 bit). In all other cases you need
a "real" cross compiler.
Does not work. I installed binutils-multiarch and lib64gcc1 but I still
get the exact same error:
$ make ARCH=x86_64 CROSS_COMPILE=x86_64-linux-
make: x86_64-linux-gcc: Command not found
CHK include/linux/version.h
CC arch/x86_64/kernel/asm-offsets.s
/bin/sh: x86_64-linux-gcc: command not found
make[1]: *** [arch/x86_64/kernel/asm-offsets.s] Error 127
make: *** [prepare0] Error 2
There does not seem to be any x86_64-linux-gcc package at all for Ubuntu.
If I omit CROSS_COMPILE I get the same error as before:
$ make ARCH=x86_64
CHK include/linux/version.h
CC arch/x86_64/kernel/asm-offsets.s
arch/x86_64/kernel/asm-offsets.c:1: error: code model 'kernel' not supported in
the 32 bit mode
make[1]: *** [arch/x86_64/kernel/asm-offsets.s] Error 1
make: *** [prepare0] Error 2
Why does GCC insist on running in "the 32 bit mode" even though I told
it ARCH is x86-64?
Why doesn't this Just Work, is Ubuntu really such a piece of shit that
there's no easy way to do it?
Lee