I compile my gentoo embedded project. When running on an x86 arch computer it compiles just fine but when I compile on a amd64 arch it fails: gcc -Wp,-MD,/var/tmp/portage/qc-usb-0.6.3/work/qc-usb-0.6.3/.qc-hdcs.o.d -nostdinc -isystem /usr/lib/gcc/i386-gentoo-linux-uclibc/3.4.5/include -D__KERNEL__ -Iinclude -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -ffreestanding -Os -fomit-frame-pointer -mno-red-zone -mcmodel=kernel -pipe -fno-reorder-blocks -Wno-sign-compare -fno-asynchronous-unwind-tables -DNOKERNEL -DMODULE -DKBUILD_BASENAME=qc_hdcs -DKBUILD_MODNAME=quickcam -c -o /var/tmp/portage/qc-usb-0.6.3/work/qc-usb-0.6.3/.tmp_qc-hdcs.o /var/tmp/portage/qc-usb-0.6.3/work/qc-usb-0.6.3/qc-hdcs.c /var/tmp/portage/qc-usb-0.6.3/work/qc-usb-0.6.3/qc-driver.c:1: error: code model `kernel' not supported in the 32 bit mode make[3]: *** [/var/tmp/portage/qc-usb-0.6.3/work/qc-usb-0.6.3/qc-driver.o] Error 1 hardened kernel # emerge --info Portage 2.0.54 (uclibc/x86/hardened, gcc-3.4.5, uclibc-0.9.28-r0, 2.6.16-gentoo x86_64) ================================================================= System uname: 2.6.16-gentoo x86_64 Intel(R) Pentium(R) D CPU 3.00GHz Gentoo Base System version 1.6.14 dev-lang/python: 2.4.2 sys-apps/sandbox: 1.2.12 sys-devel/autoconf: 2.13, 2.59-r6 sys-devel/automake: 1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r1 sys-devel/binutils: 2.16.1 sys-devel/libtool: 1.5.22 virtual/os-headers: 2.6.11-r2 ACCEPT_KEYWORDS="x86" AUTOCLEAN="yes" CBUILD="i386-gentoo-linux-uclibc" CFLAGS="-march=i386 -Os -pipe -fomit-frame-pointer" CHOST="i386-gentoo-linux-uclibc" The funny thing is that all other kernel drivers compiles just fine. I looked at the ebuild and it uses "emake ..." and fails while other kernel drivers uses "linux-mod_src_compile" and they work. Could it be modified to use linux-mod_src_compile?
Its enough to pass ARCH="$(tc-arch-kernel)" to emake.
Created attachment 83518 [details, diff] qc-usb-0.6.3.ebuild.patch The attatched patch fixes the problem. Please commit and close bug.
(In reply to comment #0) > hardened kernel # emerge --info > Portage 2.0.54 (uclibc/x86/hardened, gcc-3.4.5, uclibc-0.9.28-r0, 2.6.16-gentoo > x86_64) > ================================================================= > System uname: 2.6.16-gentoo x86_64 Intel(R) Pentium(R) D CPU 3.00GHz > ACCEPT_KEYWORDS="x86" > AUTOCLEAN="yes" > CBUILD="i386-gentoo-linux-uclibc" > CFLAGS="-march=i386 -Os -pipe -fomit-frame-pointer" > CHOST="i386-gentoo-linux-uclibc" did you forget to prepend the chroot command with linux32? I set ABI=${KERNEL_ABI} in the ebuild, should fix it from the multilib part, but it could be that the ARCH is still needed. can't test it since my testing chroot is somehow messed up :/
(In reply to comment #3) > did you forget to prepend the chroot command with linux32? hum.... yes... wasn't even aware of it. This 64 bit thing is brand new. (and I obviously haven't read the doc enough) Everything else has compiled just fine. I discovered that kernel compiling failed unless ARCH was given to make. Also all other kernel module packages used linux-mod_src_compile and they just worked. > I set ABI=${KERNEL_ABI} in the ebuild, should fix it from the multilib part, > but it could be that the ARCH is still needed. can't test it since my testing > chroot is somehow messed up :/ the ARCH will not hurt at least. I just tried with linux32 infront of chroot and no problems at all. I mark this as invalid. Thanks!