From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lists.gentoo.org ([140.105.134.102] helo=robin.gentoo.org) by nuthatch.gentoo.org with esmtp (Exim 4.54) id 1FCcZQ-00072E-Tg for garchives@archives.gentoo.org; Fri, 24 Feb 2006 13:01:17 +0000 Received: from robin.gentoo.org (localhost [127.0.0.1]) by robin.gentoo.org (8.13.5/8.13.5) with SMTP id k1OD0Eq8032580; Fri, 24 Feb 2006 13:00:14 GMT Received: from cicero0.cybercity.dk (cicero0.cybercity.dk [212.242.40.52]) by robin.gentoo.org (8.13.5/8.13.5) with ESMTP id k1OCuFuR002380 for ; Fri, 24 Feb 2006 12:56:15 GMT Received: from user2.cybercity.dk (user2.cybercity.dk [212.242.41.35]) by cicero0.cybercity.dk (Postfix) with ESMTP id 447956780B6 for ; Fri, 24 Feb 2006 13:56:15 +0100 (CET) Received: from [10.0.0.2] (port78.ds1-abs.adsl.cybercity.dk [212.242.227.17]) by user2.cybercity.dk (Postfix) with ESMTP id 0512F2868A4 for ; Fri, 24 Feb 2006 13:56:15 +0100 (CET) From: Bo Andresen 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 User-Agent: KMail/1.9.1 References: <200602230003.33868.bo.andresen@gmail.com> <200602240207.38248.bo.andresen@gmail.com> <200602232318.56793.bss03@volumehost.com> In-Reply-To: <200602232318.56793.bss03@volumehost.com> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@gentoo.org Reply-to: gentoo-user@lists.gentoo.org MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200602241356.14586.bo.andresen@gmail.com> X-Archives-Salt: c07f0a45-ee24-45cf-8d09-15ecf699e27a X-Archives-Hash: c635e891f14e90e180159ae0656e99b0 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