[opensuse-amd64] Cross-compiling SuSE kernel fails
Hi, I'm trying to compile a set of i586 kernel rpms on a x86_64 host running SuSE 10.1(x86_64). I'm using the kernel-source-2.6.16.27-0.9.i586.rpm for the sources and compile them with "make ARCH=i386..." Works file for the kernels/modules, but generating the stuff for my kernel-source.rpm I call make ARCH=i386 O=/root/tmp/kernel/usr/src/linux-2.6.16-6suse-bio-obj/i386/default scripts which results in e.g. gcc -Wp,-MD,scripts/basic/.docproc.d -Iscripts/basic -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -o scripts/basic/docproc /root/tmp/kernel/usr/src/linux-2.6.16-6suse-bio/scripts/basic/docproc.c and I end up with "ELF 64-bit LSB executable, AMD x86-64" files: ...i386/default/scripts/basic/docproc: ELF 64-bit LSB executable, AMD x86-64, version 1 (SYSV), for GNU/Linux 2.6.4, dynamically linked (uses shared libs), for GNU/Linux 2.6.4, not stripped So I get a kernel-source.i586.rpm that I can't install on a i586 host due to these binaries. All other stuff like the modules or the kernel are compiled with "gcc -m32", but that -m32 is missing here. When I call make HOSTCC="gcc -m32" scripts ... I get 32bit binaries, but I'm not sure if that's the right way to do it. Is there any reason why "make scripts" ignores the ARCH parameter? Is there a better fix than the "HOSTCC=.." call? cu, Frank -- Dipl.-Inform. Frank Steiner Web: http://www.bio.ifi.lmu.de/~steiner/ Lehrstuhl f. Bioinformatik Mail: http://www.bio.ifi.lmu.de/~steiner/m/ LMU, Amalienstr. 17 Phone: +49 89 2180-4049 80333 Muenchen, Germany Fax: +49 89 2180-99-4049 * Rekursion kann man erst verstehen, wenn man Rekursion verstanden hat. * --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-amd64+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-amd64+help@opensuse.org
When I call make HOSTCC="gcc -m32" scripts ... I get 32bit binaries, but I'm not sure if that's the right way to do it. Is there any reason why "make scripts" ignores the ARCH parameter?
Consider the case you're cross compiling to a architecture where your local system cannot execute the target binaries. If scripts didn't ignore ARCH you wouldn't be able to compile because scripts needs to run on the cross compile host.
Is there a better fix than the "HOSTCC=.." call?
I don't know any other way and it doesn't seem to be unclean in any way to me. -Andi --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-amd64+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-amd64+help@opensuse.org
Andi Kleen wrote
When I call make HOSTCC="gcc -m32" scripts ... I get 32bit binaries, but I'm not sure if that's the right way to do it. Is there any reason why "make scripts" ignores the ARCH parameter?
Consider the case you're cross compiling to a architecture where your local system cannot execute the target binaries. If scripts didn't ignore ARCH you wouldn't be able to compile because scripts needs to run on the cross compile host.
Ok, that makes sense :-)
Is there a better fix than the "HOSTCC=.." call?
I don't know any other way and it doesn't seem to be unclean in any way to me.
Fine! So I will do it that way. Thanks for your help! cu, Frank -- Dipl.-Inform. Frank Steiner Web: http://www.bio.ifi.lmu.de/~steiner/ Lehrstuhl f. Bioinformatik Mail: http://www.bio.ifi.lmu.de/~steiner/m/ LMU, Amalienstr. 17 Phone: +49 89 2180-4049 80333 Muenchen, Germany Fax: +49 89 2180-99-4049 * Rekursion kann man erst verstehen, wenn man Rekursion verstanden hat. * --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-amd64+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-amd64+help@opensuse.org
participants (2)
-
Andi Kleen
-
Frank Steiner