public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
From: Bo Andresen <bo.andresen@gmail.com>
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] chroot: cannot run command `bin/bash': Exec format error [SOLVED]
Date: Fri, 24 Feb 2006 13:56:11 +0100	[thread overview]
Message-ID: <200602241356.14586.bo.andresen@gmail.com> (raw)
In-Reply-To: <200602232318.56793.bss03@volumehost.com>

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	other threads:[~2006-02-24 13:01 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-22 23:03 [gentoo-user] chroot: cannot run command `bin/bash': Exec format error Bo Andresen
2006-02-22 23:14 ` John Jolet
2006-02-22 23:28   ` [gentoo-user] " Mick
2006-02-22 23:41     ` Bo Andresen
2006-02-22 23:18 ` [gentoo-user] " Boris Fersing
2006-02-22 23:42 ` Boyd Stephen Smith Jr.
2006-02-22 23:51   ` Bo Andresen
2006-02-23 21:31   ` Bo Andresen
2006-02-23 21:40     ` Boyd Stephen Smith Jr.
2006-02-23 21:56       ` Bo Andresen
2006-02-23 22:33         ` Boyd Stephen Smith Jr.
2006-02-23 23:25           ` Bo Andresen
2006-02-23 23:52             ` Boyd Stephen Smith Jr.
2006-02-24  0:12               ` Bo Andresen
2006-02-24  0:16                 ` Bo Andresen
2006-02-24  0:32                   ` Boyd Stephen Smith Jr.
2006-02-24  0:56                     ` Boyd Stephen Smith Jr.
2006-02-24  1:07                       ` Bo Andresen
2006-02-24  5:18                         ` Boyd Stephen Smith Jr.
2006-02-24 12:56                           ` Bo Andresen [this message]
2006-02-24 21:07                             ` [gentoo-user] chroot: cannot run command `bin/bash': Exec format error [SOLVED] Boyd Stephen Smith Jr.

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200602241356.14586.bo.andresen@gmail.com \
    --to=bo.andresen@gmail.com \
    --cc=gentoo-user@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox