Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 151425

Summary: gentoo-sources-2.6.17-r8 does not cross-compile for i386 on x86_64
Product: Gentoo Linux Reporter: kavol
Component: [OLD] Core systemAssignee: Gentoo Kernel Bug Wranglers and Kernel Maintainers <kernel>
Status: RESOLVED INVALID    
Severity: normal    
Priority: High    
Version: 2006.1   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: .config

Description kavol 2006-10-15 01:46:24 UTC
Hi,

for some reasons, I need to install Gentoo on the disk plugged into another machine than what it is intended for ...

When trying to compile gentoo-sources, I get the following:

(chroot) jarmilka linux-2.6.17-gentoo-r8 # make bzImage ARCH="i386"
  CHK     include/linux/version.h
  CC      arch/i386/kernel/asm-offsets.s
In file included from include/linux/timex.h:61,
                 from include/linux/sched.h:11,
                 from arch/i386/kernel/asm-offsets.c:7:
include/asm/timex.h: In function &#8216;get_cycles&#8217;:
include/asm/timex.h:25: warning: left shift count >= width of type
include/asm/timex.h: In function &#8216;get_cycles_sync&#8217;:
include/asm/timex.h:38: warning: left shift count >= width of type
In file included from include/asm/semaphore.h:43,
                 from include/linux/sched.h:20,
                 from arch/i386/kernel/asm-offsets.c:7:
include/linux/rwsem.h:27:65: error: asm/rwsem.h: nen
Comment 1 kavol 2006-10-15 01:46:24 UTC
Hi,

for some reasons, I need to install Gentoo on the disk plugged into another machine than what it is intended for ...

When trying to compile gentoo-sources, I get the following:

(chroot) jarmilka linux-2.6.17-gentoo-r8 # make bzImage ARCH="i386"
  CHK     include/linux/version.h
  CC      arch/i386/kernel/asm-offsets.s
In file included from include/linux/timex.h:61,
                 from include/linux/sched.h:11,
                 from arch/i386/kernel/asm-offsets.c:7:
include/asm/timex.h: In function &#8216;get_cycles&#8217;:
include/asm/timex.h:25: warning: left shift count >= width of type
include/asm/timex.h: In function &#8216;get_cycles_sync&#8217;:
include/asm/timex.h:38: warning: left shift count >= width of type
In file included from include/asm/semaphore.h:43,
                 from include/linux/sched.h:20,
                 from arch/i386/kernel/asm-offsets.c:7:
include/linux/rwsem.h:27:65: error: asm/rwsem.h: není souborem ani adresá&#345;em
In file included from include/asm/semaphore.h:43,
                 from include/linux/sched.h:20,
                 from arch/i386/kernel/asm-offsets.c:7:
include/linux/rwsem.h: In function &#8216;down_read&#8217;:
include/linux/rwsem.h:45: warning: implicit declaration of function &#8216;__down_read&#8217;
include/linux/rwsem.h: In function &#8216;down_read_trylock&#8217;:
include/linux/rwsem.h:56: warning: implicit declaration of function &#8216;__down_read_trylock&#8217;
include/linux/rwsem.h: In function &#8216;down_write&#8217;:
include/linux/rwsem.h:68: warning: implicit declaration of function &#8216;__down_write&#8217;
include/linux/rwsem.h: In function &#8216;down_write_trylock&#8217;:
include/linux/rwsem.h:79: warning: implicit declaration of function &#8216;__down_write_trylock&#8217;
include/linux/rwsem.h: In function &#8216;up_read&#8217;:
include/linux/rwsem.h:90: warning: implicit declaration of function &#8216;__up_read&#8217;
include/linux/rwsem.h: In function &#8216;up_write&#8217;:
include/linux/rwsem.h:100: warning: implicit declaration of function &#8216;__up_write&#8217;
include/linux/rwsem.h: In function &#8216;downgrade_write&#8217;:
include/linux/rwsem.h:110: warning: implicit declaration of function &#8216;__downgrade_write&#8217;
In file included from include/linux/memory_hotplug.h:7,
                 from include/linux/mmzone.h:326,
                 from include/linux/gfp.h:4,
                 from include/linux/slab.h:15,
                 from include/linux/percpu.h:4,
                 from include/linux/rcupdate.h:41,
                 from include/linux/pid.h:4,
                 from include/linux/sched.h:33,
                 from arch/i386/kernel/asm-offsets.c:7:
include/linux/notifier.h: At top level:
include/linux/notifier.h:47: error: field &#8216;rwsem&#8217; has incomplete type
In file included from arch/i386/kernel/asm-offsets.c:7:
include/linux/sched.h:311: error: field &#8216;mmap_sem&#8217; has incomplete type
In file included from include/asm/suspend.h:6,
                 from include/linux/suspend.h:5,
                 from arch/i386/kernel/asm-offsets.c:10:
include/asm/desc.h: In function &#8216;_set_gate&#8217;:
include/asm/desc.h:97: warning: right shift count >= width of type
include/asm/desc.h: In function &#8216;set_tssldt_descriptor&#8217;:
include/asm/desc.h:137: warning: right shift count >= width of type
include/asm/desc.h: In function &#8216;set_seg_base&#8217;:
include/asm/desc.h:164: warning: cast from pointer to integer of different size
include/asm/desc.h:165: warning: cast from pointer to integer of different size
arch/i386/kernel/asm-offsets.c: In function &#8216;foo&#8217;:
arch/i386/kernel/asm-offsets.c:27: error: &#8216;struct sigcontext&#8217; has no member named &#8216;eax&#8217;
arch/i386/kernel/asm-offsets.c:28: error: &#8216;struct sigcontext&#8217; has no member named &#8216;ebx&#8217;
arch/i386/kernel/asm-offsets.c:29: error: &#8216;struct sigcontext&#8217; has no member named &#8216;ecx&#8217;
arch/i386/kernel/asm-offsets.c:30: error: &#8216;struct sigcontext&#8217; has no member named &#8216;edx&#8217;
arch/i386/kernel/asm-offsets.c:31: error: &#8216;struct sigcontext&#8217; has no member named &#8216;esi&#8217;
arch/i386/kernel/asm-offsets.c:32: error: &#8216;struct sigcontext&#8217; has no member named &#8216;edi&#8217;
arch/i386/kernel/asm-offsets.c:33: error: &#8216;struct sigcontext&#8217; has no member named &#8216;ebp&#8217;
arch/i386/kernel/asm-offsets.c:34: error: &#8216;struct sigcontext&#8217; has no member named &#8216;esp&#8217;
arch/i386/kernel/asm-offsets.c:35: error: &#8216;struct sigcontext&#8217; has no member named &#8216;eip&#8217;
arch/i386/kernel/asm-offsets.c:42: error: &#8216;struct cpuinfo_x86&#8217; has no member named &#8216;hard_math&#8217;
arch/i386/kernel/asm-offsets.c:67: error: &#8216;struct tss_struct&#8217; has no member named &#8216;esp0&#8217;
arch/i386/kernel/asm-offsets.c:71: error: &#8216;FIX_VSYSCALL&#8217; undeclared (first use in this function)
arch/i386/kernel/asm-offsets.c:71: error: (Each undeclared identifier is reported only once
arch/i386/kernel/asm-offsets.c:71: error: for each function it appears in.)
make[1]: *** [arch/i386/kernel/asm-offsets.s] Error 1
make: *** [prepare0] Error 2


When using vanilla-sources, compilation looks ok (except some warnings about unitialised uses, which is normal ...) (Unfortunately, I cannot test if the compiled kernel actually works now.)
Comment 2 kavol 2006-10-15 01:47:28 UTC
Created attachment 99707 [details]
.config
Comment 3 kavol 2006-10-19 05:37:01 UTC
FYI: the cross-compiled vanilla kernel (and the whole system) works ok

unfortunately I have not enough knowledge to find out which gentoo-specific patch is causing the problem with gentoo-sources
Comment 4 Daniel Drake (RETIRED) gentoo-dev 2006-10-23 11:03:14 UTC
This works fine on a clean gentoo-sources. It does not work when the kernel has already been built for another arch (same as vanilla) because the include/asm symlink points to the wrong arch. Either correct the symlink manually or start from clean sources.
Comment 5 kavol 2006-10-26 05:21:00 UTC
(In reply to comment #3)
> This works fine on a clean gentoo-sources. It does not work when the kernel has
> already been built for another arch (same as vanilla) because the include/asm
> symlink points to the wrong arch.

but I did not try to build for another arch - I needed to install a system for Duron using Athlon64 machine, everything was in 32bit chroot ...

after running make menuconfig, I have found that there are 64bit only options, so after some googling I came across the ARCH=i386 option and I used it from there on ... so is that possible that the symlink got wrong during the first run of menuconfig and not after make bzImage (which was done using the correct arch)?

> Either correct the symlink manually or start from clean sources.

I cannot try since the disk is already in the second machine ...

anyway, thankyou for the explanation and sorry for the invalid report - I did not find anything useful about this error on the web, if I knew, I would try make mrproper ...