Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 151425 - gentoo-sources-2.6.17-r8 does not cross-compile for i386 on x86_64
Summary: gentoo-sources-2.6.17-r8 does not cross-compile for i386 on x86_64
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Kernel Bug Wranglers and Kernel Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-10-15 01:46 UTC by kavol
Modified: 2006-10-26 05:21 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
.config (.config,30.63 KB, text/plain)
2006-10-15 01:47 UTC, kavol
Details

Note You need to log in before you can comment on or make changes to this bug.
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 ‘get_cycles’:
include/asm/timex.h:25: warning: left shift count >= width of type
include/asm/timex.h: In function ‘get_cycles_sync’:
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 ‘get_cycles’:
include/asm/timex.h:25: warning: left shift count >= width of type
include/asm/timex.h: In function ‘get_cycles_sync’:
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ář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 ‘down_read’:
include/linux/rwsem.h:45: warning: implicit declaration of function ‘__down_read’
include/linux/rwsem.h: In function ‘down_read_trylock’:
include/linux/rwsem.h:56: warning: implicit declaration of function ‘__down_read_trylock’
include/linux/rwsem.h: In function ‘down_write’:
include/linux/rwsem.h:68: warning: implicit declaration of function ‘__down_write’
include/linux/rwsem.h: In function ‘down_write_trylock’:
include/linux/rwsem.h:79: warning: implicit declaration of function ‘__down_write_trylock’
include/linux/rwsem.h: In function ‘up_read’:
include/linux/rwsem.h:90: warning: implicit declaration of function ‘__up_read’
include/linux/rwsem.h: In function ‘up_write’:
include/linux/rwsem.h:100: warning: implicit declaration of function ‘__up_write’
include/linux/rwsem.h: In function ‘downgrade_write’:
include/linux/rwsem.h:110: warning: implicit declaration of function ‘__downgrade_write’
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 ‘rwsem’ has incomplete type
In file included from arch/i386/kernel/asm-offsets.c:7:
include/linux/sched.h:311: error: field ‘mmap_sem’ 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 ‘_set_gate’:
include/asm/desc.h:97: warning: right shift count >= width of type
include/asm/desc.h: In function ‘set_tssldt_descriptor’:
include/asm/desc.h:137: warning: right shift count >= width of type
include/asm/desc.h: In function ‘set_seg_base’:
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 ‘foo’:
arch/i386/kernel/asm-offsets.c:27: error: ‘struct sigcontext’ has no member named ‘eax’
arch/i386/kernel/asm-offsets.c:28: error: ‘struct sigcontext’ has no member named ‘ebx’
arch/i386/kernel/asm-offsets.c:29: error: ‘struct sigcontext’ has no member named ‘ecx’
arch/i386/kernel/asm-offsets.c:30: error: ‘struct sigcontext’ has no member named ‘edx’
arch/i386/kernel/asm-offsets.c:31: error: ‘struct sigcontext’ has no member named ‘esi’
arch/i386/kernel/asm-offsets.c:32: error: ‘struct sigcontext’ has no member named ‘edi’
arch/i386/kernel/asm-offsets.c:33: error: ‘struct sigcontext’ has no member named ‘ebp’
arch/i386/kernel/asm-offsets.c:34: error: ‘struct sigcontext’ has no member named ‘esp’
arch/i386/kernel/asm-offsets.c:35: error: ‘struct sigcontext’ has no member named ‘eip’
arch/i386/kernel/asm-offsets.c:42: error: ‘struct cpuinfo_x86’ has no member named ‘hard_math’
arch/i386/kernel/asm-offsets.c:67: error: ‘struct tss_struct’ has no member named ‘esp0’
arch/i386/kernel/asm-offsets.c:71: error: ‘FIX_VSYSCALL’ 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 ...