Re: error: code model 'kernel' not supported in the 32 bit mode

2005-10-07 Thread saf
On Wed, Oct 05, 2005 at 05:03:30AM -0700, Max wrote:
 saf wrote:
 
 I tried to compile a Linux kernel in 64 bits mode.
 
 From old version of FAQ:

...
 deb http://debian-amd64.alioth.debian.org/biarch/ sarge main
 to your /etc/apt/sources.list which should already point to woody.

I can't find out the biarch distribution!
I got error 404, the biarch packages are no more on the alioth server.
Does someone has an idea how I can install my cross compiler to compile my 
kernel in AMD 64 bits on a 
AMD IA-32 system ?

-- 
Best regards,
Stephan FERRARO
NOOFS Core Developper - http://www.noofs.org/


signature.asc
Description: Digital signature


error: code model 'kernel' not supported in the 32 bit mode

2005-10-05 Thread saf
Hello,

I tried to compile a Linux kernel in 64 bits mode.
I try to migrate from an existing running Debian 32 bits distribution 
(stable sarge half converted to testing) to amd64 debian port.

I installed gcc-4.0.2 from the Debian testing version.

So I configured the linux kernel 2.6.13.2 and when I try to compile it 
with: $ make V=1 ARCH=x86_64

I got the error message:
arch/x86_64/kernel/asm-offsets.c:1: error: code model 'kernel' not 
supported in the 32 bit mode

Why does he make this error?


Here the exact output:

melanie:/usr/src/linux-2.6.13.2# make V=1 ARCH=x86_64
if test ! /usr/src/linux-2.6.13.2 -ef /usr/src/linux-2.6.13.2; then \
/bin/bash /usr/src/linux-2.6.13.2/scripts/mkmakefile  \
/usr/src/linux-2.6.13.2 /usr/src/linux-2.6.13.2 2 6 \
 /usr/src/linux-2.6.13.2/Makefile; 
\
echo '  GEN/usr/src/linux-2.6.13.2/Makefile';   
\
fi
set -e; echo '  CHK include/linux/version.h'; mkdir -p 
include/linux/;  if [ `echo -n 2.6.13.2 | wc -c ` -gt 64 ]; then 
echo '2.6.13.2 exceeds 64 characters' 2; exit 1; fi; (echo \#define 
UTS_RELEASE \2.6.13.2\; echo \#define LINUX_VERSION_CODE `expr 2 \\* 
65536 + 6 \\* 256 + 13`; echo '#define KERNEL_VERSION(a,b,c) (((a)  
16) + ((b)  8) + (c))'; )  /usr/src/linux-2.6.13.2/Makefile  
include/linux/version.h.tmp; if [ -r include/linux/version.h ]  cmp -s 
include/linux/version.h include/linux/version.h.tmp; then rm -f 
include/linux/version.h.tmp; else echo '  UPD 
include/linux/version.h'; mv -f include/linux/version.h.tmp 
include/linux/version.h; fi
  CHK include/linux/version.h
make -f scripts/Makefile.build obj=scripts/basic
rm -rf .tmp_versions
mkdir -p .tmp_versions
make -f scripts/Makefile.build obj=.
mkdir -p arch/x86_64/kernel/
  gcc -Wp,-MD,arch/x86_64/kernel/.asm-offsets.s.d  -nostdinc -isystem 
/usr/lib/gcc/i486-linux-gnu/4.0.1/include -D__KERNEL__ -Iinclude  -Wall 
-Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing 
-fno-common -ffreestanding -O2 -fomit-frame-pointer -march=k8 
-mno-red-zone -mcmodel=kernel -pipe -fno-reorder-blocks   
-Wno-sign-compare -fno-asynchronous-unwind-tables
-DKBUILD_BASENAME=asm_offsets -DKBUILD_MODNAME=asm_offsets -S -o 
arch/x86_64/kernel/asm-offsets.s arch/x86_64/kernel/asm-offsets.c 
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] Fehler 1
make: *** [prepare0] Fehler 2
melanie:/usr/src/linux-2.6.13.2#


Please help me!
-- 
Best regards,
saf
Archivum.info


signature.asc
Description: Digital signature


Re: error: code model 'kernel' not supported in the 32 bit mode

2005-10-05 Thread Max

saf wrote:


I tried to compile a Linux kernel in 64 bits mode.


From old version of FAQ:

===

*Crosscompiling a 64bit kernel on a 32bit host*

In order to get full advantage of the x86_64 architecture, you need to build a 
kernel which supports the 64bit extensions.

You should use the latest 2.6 kernel, since the amd64 support is much better 
than in the 2.4 series.

You may not want to use the debian kernel, since support for the widely-used 
tigon3 based network interfaces (some 3Com 940s, Broadcom 57xx) has been 
dropped by the debian kernel maintainer, but this depends on which mainboard 
and network interface card you are going to install.

*Installing the woody chroot*

Since the cross-compile packages on alioth are built from old Sarge versions, you need to 
install a woody chroot first. Note that you need woody and not Sarge, because the biarch 
packages are based on an old Sarge version no longer in the archive. As a result, you 
will not be able to install the alioth biarch packages into an actual testing or unstable 
chroot. Upgrading an already installed biarch chroot to unstable or testing will 
upgrade the toolchain to a non-biarch version at least, if not render your 
chroot entirely unusable.

Follow the instructions found at Debian Reference Manual 8.6.33 or the 
(c)debootstrap documentation for a complete explanation of how to set up a 
chroot environment.

In short:

*  mkdir /chroot-woody ;
cdebootstrap woody /chroot-woody http://ftp.de.debian.org/debian

* cp /etc/resolv.conf /etc/hostname /chroot-woody/etc/

* chroot /chroot-woody

* mount -t proc proc /proc

* unset LC_CTYPE ; base-config

Installing the cross-compile environment

* add
deb http://debian-amd64.alioth.debian.org/biarch/ sarge main
to your /etc/apt/sources.list which should already point to woody.

* run
apt-get update ; apt-get install libc6 libc6-dev lib64c6
lib64c6-dev libncurses5 libncurses5-dev \
lib64ncurses5 lib64ncurses5-dev gcc gcc-3.3 g++-3.3 patch make
devscripts dpkg-dev wget bzip2

* wget the latest 2.6 kernel from http://www.kernel.org/ and untar it
to /usr/src, or wherever you usually build your kernels.

*The gcc wrapper*

You need to get a gcc wrapper in order to crosscompile on a i386 host.
This wrapper is found at
http://www.jukie.net/~bart/debian/amd64/scripts/gcc.bart
You can simply delete the /usr/bin/gcc symlink and move the wrapper
there. Configuring the kernel

make HOSTCC=gcc -m32 ARCH=x86_64 menuconfig

Be sure to include IA32 emulation, otherwise you will not be able to run 
multiarch or i386 binaries on your host system or in a chroot. And for 
simplicity, build a monolithic kernel without any modules.

make HOSTCC=gcc -m32 ARCH=x86_64 bzImage

If everything goes well, you will end up with the following message:

Kernel: arch/x86_64/boot/bzImage is ready

You can now install the kernel as usual. Keep your old 32bit kernel in the 
lilo/grub configuration, so you can switch back if something went wrong. Be 
sure to load the initrd only with your old debian-installer kernel, if you 
installed that way. If everything goes well, you will be running a 32bit 
userland with a 64bit kernel, and can proceed with the installation of pure64 
if you want to.

===


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]