On Friday 24 February 2006 06:18, Boyd Stephen Smith Jr. wrote:
> > via linux # make ARCH=x86_64 CC="gcc -m64"
> >   CHK     include/linux/version.h
> >   UPD     include/linux/version.h
> >   SPLIT   include/linux/autoconf.h -> include/config/*
> >   CC      arch/x86_64/kernel/asm-offsets.s
> > cc1: error: code model `kernel' not supported in the 32 bit mode
> > cc1: sorry, unimplemented: 64-bit mode not compiled in
>
> Blah.  I don't really know how to get around this.  I generally stay away
> from configuring my own gcc and I don't know what, if any, USE flag
> controls when 64-bit mode is compiled in.  That works in my
> i686-pc-linux-gnu-gcc, but maybe that's 'cause it is a "cross"-compiler on
> my system.

As you saw in my previous post the gcc version is 3.3.5. Wanting to know 
whether it was due to the version of gcc I ran the same commands on my laptop 
(after copying .config to it). It has gcc version 3.4.5 and it gave exactly 
the same result as shown above.

> It may be easier at this point to just find a live cd / live dvd that will
> bring you up in a 64-bit kernel.  It won't matter much whether it is
> gentoo or some other distro [1], as long as it brings up the network and
> your drives, because all you'll be doing is chrooting and finishing the
> gentoo install.

Actually I guess I could just download the the amd64 livecd, mount it, copy 
its kernel to the harddrive (already did emerge coldplug) and boot on it. I 
did, however, find this very interesting so I do wish to compile a 64-bit 
kernel and see what it takes.

> If you still want to continue down the "cross"-compile and install a kernel
> route (what we've been trying to do so far).  I suggest you emerge
> crossdev in your 32-bit environment, then do crossdev -s1 -t x86_64 to
> compile a cross-compiling bin-utils and gcc (C only) [2].  Then, you
> should be able to "cross"-compile your kernel with.

I've just done that. It seems to  be working.

> make ARCH=x86_64 CROSS_COMPILE=x86_64-pc-linux-gnu-
> (menuconfig, all, modules_install, etc.)

At first when typing make ARCH=x86_64 CROSS_COMPILE=x86_64-pc-linux-gnu- it 
told me it could not find these files:

arch/x86_64/kernel/asm-offsets.c:12:21: asm/pda.h: No such file or directory
arch/x86_64/kernel/asm-offsets.c:16:22: asm/ia32.h: No such file or directory
[...]
make[1]: *** [arch/x86_64/kernel/asm-offsets.s] Error 1
make: *** [prepare0] Error 2

# ls -ld include/asm
lrwxrwxrwx  1 root root 10 Feb 24 14:27 include/asm -> asm-386

I solved this by:
# ln -sfn include/asm-x86_64 include/asm

Perhaps it would have been solved by reemerging gentoo-sources but this worked 
too. make install didn't work either but installing it manually is just 
copying 3 files..

This all did solve the problems. The resulting kernel does indeed boot and it 
does make it possible to chroot into a 64 bit environment. :D Thanks a lot. 
This has been very educating.

> Crossdev will take basically no time to install, but compiling gcc make
> take a while, even without any language front-ends other than C.

Well, it didn't take that long.. At least less than 15 minutes - didn't really 
time it.
 
-- 
Bo Andresen
-- 
gentoo-user@gentoo.org mailing list

Reply via email to