Re: Cross-compiling kernel for sparc64 on i386
Would you advice me how to do $SUBJ? My Ultras compile kernels for more than 45 minutes while new PCs are 10 times faster. I understand the theory (a bit) but I'm not sure what all should I do to succeed. The machine on which I want to compile runs debian testing. -- Honza Houstek
Re: Cross-compiling kernel for sparc64 on i386
On Sat, Jul 26, 2003 at 10:04:53AM +0200, Jan Houstek wrote: Would you advice me how to do $SUBJ? My Ultras compile kernels for more than 45 minutes while new PCs are 10 times faster. I understand the theory (a bit) but I'm not sure what all should I do to succeed. The machine on which I want to compile runs debian testing. There are cross compiling HOWTO's all over the net. Do a search on google. I suggest using gcc-3.2.3 or the gcc-3.3.1pre snapshot released a few days ago. -- Debian - http://www.debian.org/ Linux 1394 - http://www.linux1394.org/ Subversion - http://subversion.tigris.org/
Re: Binutils no longer autobuilding the cross-compiling packages...
On Wed, 18 Apr 2001, Meelis Roos wrote: CCC If there are any objections, please feel free to email me. I don't plan CCC on keeping them buried forever...only until a better way is found to CCC generate them in a policy-compliant manner and also in manner that CCC won't impact slower/older architectures like m68k quite as much I find the -m68k variant useful (or, rather, convenient) and I do use it to cross-compile for m68k. But it's not too bad if they are gone - it's quite easy to build cross-binutils. I think he was talking about building cross-compilers on the m68k platform, not about cross-compilers to generate m68k binaries. Yes, it's indeed useful to have a cross-compiler for a slow architecture on a fast architecture. But not vice versa, I guess :-) Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [EMAIL PROTECTED] In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say programmer or something like that. -- Linus Torvalds
Re: Binutils no longer autobuilding the cross-compiling packages...
I think he was talking about building cross-compilers on the m68k platform, not about cross-compilers to generate m68k binaries. Yes, I understood the same. I do use binutils-m68k on i686 and find it convenient but I also agree that building cross-binutils for all archs on all archs (even the slow ones) is a overkill. --- Meelis Roos ([EMAIL PROTECTED])
Re: cross-compiling ?
Ragga Muffin wrote: Is anybody cross-compiling packages for sparc on, say linux-x86 ? I understand it should be possible by installing the cross-compiling tools. The sparc5 I recently installed debian is a bit slow... Any advice/experiences welcome. I have no experience with a i386--sparc cross compiler, but I've build several i386--arm toolchains. Have a look at the Cross GCC FAQ at http://www.objsw.com/CrossGCC/ . Erik -- LART. 250 MIPS under one Watt. http://www-ict.its.tudelft.nl/~erik/open-source/LART/
cross-compiling ?
Hi, Is anybody cross-compiling packages for sparc on, say linux-x86 ? I understand it should be possible by installing the cross-compiling tools. The sparc5 I recently installed debian is a bit slow... Any advice/experiences welcome. Tnx
Re: Cross-compiling on Debian systems?
On Thu, Nov 18, 1999 at 08:52:47AM -0500, Ben Collins wrote: Now I need a xcompiler i386 - sparc. Looks like you're using the native binutils instead of cross binutils. Installing binutils-multiarch and compiling a native gas handles this. How I use a cross GAS? I don't know how tell ./configure to use my sparc-linux-as instead of /usr/bin/as --with-gnu-as doesn't work (what's its meaning?). ./configure can't understand sparc-linux-as is right assembler. I made cross GAS from binutils (as gasp) (./configure --target=sparc-linux) and put files in /usr/local/bin/sparc-linux-* Installed binutils-multiarch too. dpkg-cross -i libc6 libc6-dev, too All OK. But making gcc-sparc-linux-2.8.1 (changed all m68k references to sparc in debian/ dpkg-buildpackage -uc -us), it gives the same 'as' error: ./xgcc -B./ -DCROSS_COMPILE -DIN_GCC -O2 -I./include -I. -I. -I./config -g0 -finhibit-size-directive -fno-inline-functions -fno-exceptions -c ./crtstuff.c -DCRT_BEGIN -o crtbegin.o as: option '-s' is ambiguous Thanks, Cosimo. -- K.Alfa kame.primo at innocent.com - Debian User GnuPGid 0xC9F7DB89/1024 - Bologna soccia (mondo maiale) [GemBoy] Key fingerprint = EE38 2537 FA41 D481 4998 EB24 905A 999F C9F7 DB89 Undergraduate Student of Computer Science at Bologna Univerity [Italy]
Re: Cross-compiling on Debian systems?
On Wed, 17 Nov 1999, Ben Collins wrote: On Wed, Nov 17, 1999 at 02:48:55PM -0800, [EMAIL PROTECTED] wrote: I'd like to set up a cross-compiler on my Lintel (AMD 266) to compile packages for my Sparc IPX. I'd preferably like to package the cross-compiler so I can esaily remove it if I no longer need it. The only cross-compiler in the slink packages list is for m68k. What do I need to do to set one up? The last cross-compiler I built (for kernel compiles) was using the m68k cross-compiler package. I just changed the m68k references to sparc, and ran dpkg-buildpackage -us -uc -rfakeroot (change all of the m68k references in debian/ to sparc). I just did a 'debian/rules binary' in 'gcc-m68k-linux-2.8.1' after changing 'm68k' to 'sparc', and I get a build error. Looks like the gcc buildstrap isn't working. ./xgcc -B./ -DCROSS_COMPILE -DIN_GCC-O2 -I./include -I. -I. \ -I./config -g0 \ -finhibit-size-directive -fno-inline-functions -fno-exceptions \ -c ./crtstuff.c -DCRT_BEGIN -o crtbegin.o as: option `-s' is ambiguous make[1]: *** [crtbegin.o] Error 1 make[1]: Leaving directory `gcc-m68k-linux-2.8.1' make: *** [build] Error 2 I get the exact same error if I use dpkg-buildpackage. I don't know enough about building gcc to know what's wrong. And this is the source package from ftp.ca.debian.org (us.debian.org not responding to me through lynx for some reason) I also found out I need the binutils-m68k-linux package, and that's being downloaded as I type.. -- Ferret no baka
Re: Cross-compiling on Debian systems?
On Thu, 18 Nov 1999, Erik Mouw wrote: On Wed, 17 Nov 1999 19:52:42 -0800 (PST), [EMAIL PROTECTED] wrote: On Wed, 17 Nov 1999, Ben Collins wrote: On Wed, Nov 17, 1999 at 02:48:55PM -0800, [EMAIL PROTECTED] wrote: I'd like to set up a cross-compiler on my Lintel (AMD 266) to compile packages for my Sparc IPX. I'd preferably like to package the cross-compiler so I can esaily remove it if I no longer need it. The only cross-compiler in the slink packages list is for m68k. What do I need to do to set one up? The last cross-compiler I built (for kernel compiles) was using the m68k cross-compiler package. I just changed the m68k references to sparc, and ran dpkg-buildpackage -us -uc -rfakeroot (change all of the m68k references in debian/ to sparc). I just did a 'debian/rules binary' in 'gcc-m68k-linux-2.8.1' after changing 'm68k' to 'sparc', and I get a build error. Looks like the gcc buildstrap isn't working. make bootstrap doesn't work for cross compilers, have a look at the cross gcc FAQ: http://www.objsw.com/CrossGCC/ . How was the package suppsed to build itself then, by hand? *g* ./xgcc -B./ -DCROSS_COMPILE -DIN_GCC-O2 -I./include -I. -I. \ -I./config -g0 \ -finhibit-size-directive -fno-inline-functions -fno-exceptions \ -c ./crtstuff.c -DCRT_BEGIN -o crtbegin.o as: option `-s' is ambiguous make[1]: *** [crtbegin.o] Error 1 make[1]: Leaving directory `gcc-m68k-linux-2.8.1' make: *** [build] Error 2 I get the exact same error if I use dpkg-buildpackage. I don't know enough about building gcc to know what's wrong. And this is the source package from ftp.ca.debian.org (us.debian.org not responding to me through lynx for some reason) Looks like you're using the native binutils instead of cross binutils. I also found out I need the binutils-m68k-linux package, and that's being downloaded as I type.. I can't get the cross' binutils-sparc (package hacked from binutils-m68k) to build. dpkg-gencontrol -Pdebian/tmp/binutils -pbinutils-sparc-linux dpkg-gencontrol: error: source package has two conflicting values - binutils-sparc-linux and binutils-m68k-linux make: *** [binary-arch] Error 29 I edited all the references in debian/* from m68k' to sparc', and I don't know enough about the package to even guess what else might need to be tweaked. You also need libc and kernel header files for the target system. The kernel has to be configured for the target system, but that can be done on the build host. Erik -- J.A.K. (Erik) Mouw, Information and Communication Theory Group, Department of Electrical Engineering, Faculty of Information Technology and Systems, Delft University of Technology, PO BOX 5031, 2600 GA Delft, The Netherlands Phone: +31-15-2785859 Fax: +31-15-2781843 Email [EMAIL PROTECTED] WWW: http://www-ict.its.tudelft.nl/~erik/
Re: Cross-compiling on Debian systems?
On Thu, 18 Nov 1999, Ben Collins wrote: On Thu, Nov 18, 1999 at 02:38:26PM +0100, Erik Mouw wrote: On Wed, 17 Nov 1999 19:52:42 -0800 (PST), [EMAIL PROTECTED] wrote: ./xgcc -B./ -DCROSS_COMPILE -DIN_GCC-O2 -I./include -I. -I. \ -I./config -g0 \ -finhibit-size-directive -fno-inline-functions -fno-exceptions \ -c ./crtstuff.c -DCRT_BEGIN -o crtbegin.o as: option `-s' is ambiguous make[1]: *** [crtbegin.o] Error 1 make[1]: Leaving directory `gcc-m68k-linux-2.8.1' make: *** [build] Error 2 I get the exact same error if I use dpkg-buildpackage. I don't know enough about building gcc to know what's wrong. And this is the source package from ftp.ca.debian.org (us.debian.org not responding to me through lynx for some reason) Looks like you're using the native binutils instead of cross binutils. Installing binutils-multiarch and compiling a native gas handles this. I also found out I need the binutils-m68k-linux package, and that's being downloaded as I type.. You also need libc and kernel header files for the target system. The kernel has to be configured for the target system, but that can be done on the build host. Install dpkg-cross and convert the native sparc libc6 and libc6-dev packages. This will install them into /usr/sparc-linux/{include,lib} for the cross-compile. Installed dpkg-cross (isn't listed in the FTP site but a package search brought it up. And the FTP archive doesn't have a source package) :# dpkg-cross --install sysvinit_2.76-3.deb libc6_2.0.105-2.deb \ dpkg_1.4.0.34.deb mount_2.9g-6.deb ldso_1.9.10-1.deb :Building sysvinit-sparc-cross_2.76-3_all.deb :Building libc6-sparc-cross_2.0.105-2_all.deb :Building dpkg-sparc-cross_1.4.0.34_all.deb :dpkg-cross: package mount doesn't provide any useful files. Skipping. This looks funny :Building ldso-sparc-cross_1.9.10-1_all.deb :Unpacking sysvinit-sparc-cross :Unpacking libc6-sparc-cross :Unpacking dpkg-sparc-cross :Unpacking ldso-sparc-cross :dpkg: dependency problems prevent configuration of sysvinit-sparc-cross: : sysvinit-sparc-cross depends on mount-sparc-cross (= 2.7l-1); however: : Package mount-sparc-cross is not installed. :dpkg: error processing sysvinit-sparc-cross (--install): : dependency problems - leaving unconfigured :dpkg: dependency problems prevent configuration of libc6-sparc-cross: : libc6-sparc-cross depends on sysvinit-sparc-cross (= 2.76-1); however: : Package sysvinit-sparc-cross is not configured yet. :dpkg: error processing libc6-sparc-cross (--install): : dependency problems - leaving unconfigured :dpkg: dependency problems prevent configuration of dpkg-sparc-cross: : dpkg-sparc-cross depends on libc6-sparc-cross (= 2.0.99); however: : Package libc6-sparc-cross is not configured yet. : dpkg-sparc-cross depends on libncurses4-sparc-cross; however: : Package libncurses4-sparc-cross is not installed. : dpkg-sparc-cross depends on libstdc++2.9-sparc-cross; however: : Package libstdc++2.9-sparc-cross is not installed. :dpkg: error processing dpkg-sparc-cross (--install): : dependency problems - leaving unconfigured :Setting up ldso-sparc-cross (1.9.10-1) ... :Errors were encountered while processing: : sysvinit-sparc-cross : libc6-sparc-cross : dpkg-sparc-cross :dpkg -i failed. All the Sparc packages were moved using dpkg-move running on the Sparc. I am doing this the right way? -- Ferret no baka
Re: Cross-compiling on Debian systems?
On Thu, Nov 18, 1999 at 09:37:00AM -0800, [EMAIL PROTECTED] wrote: brought it up. And the FTP archive doesn't have a source package) :# dpkg-cross --install sysvinit_2.76-3.deb libc6_2.0.105-2.deb \ dpkg_1.4.0.34.deb mount_2.9g-6.deb ldso_1.9.10-1.deb :Building sysvinit-sparc-cross_2.76-3_all.deb :Building libc6-sparc-cross_2.0.105-2_all.deb :Building dpkg-sparc-cross_1.4.0.34_all.deb :dpkg-cross: package mount doesn't provide any useful files. Skipping. 1) Do this on the cross-compile system (ie. the i386) 2) You only need libraries and -dev packages. So init, and mount are somewhat irrelevant to compilation -- ---===-=-==-=---==-=-- / Ben Collins -- ...on that fantastic voyage... -- Debian GNU/Linux \ ` [EMAIL PROTECTED] - [EMAIL PROTECTED] - [EMAIL PROTECTED]' `---=--===-=-=-=-===-==---=--=---'
Re: Cross-compiling on Debian systems?
On Thu, 18 Nov 1999, Ben Collins wrote: On Thu, Nov 18, 1999 at 09:37:00AM -0800, [EMAIL PROTECTED] wrote: brought it up. And the FTP archive doesn't have a source package) :# dpkg-cross --install sysvinit_2.76-3.deb libc6_2.0.105-2.deb \ dpkg_1.4.0.34.deb mount_2.9g-6.deb ldso_1.9.10-1.deb :Building sysvinit-sparc-cross_2.76-3_all.deb :Building libc6-sparc-cross_2.0.105-2_all.deb :Building dpkg-sparc-cross_1.4.0.34_all.deb :dpkg-cross: package mount doesn't provide any useful files. Skipping. 1) Do this on the cross-compile system (ie. the i386) 2) You only need libraries and -dev packages. So init, and mount are somewhat irrelevant to compilation :(i386)# dpkg-cross --install libc6_2.0.105-2.deb :Building libc6-sparc-cross_2.0.105-2_all.deb :Unpacking libc6-sparc-cross :dpkg: dependency problems prevent configuration of libc6-sparc-cross: : libc6-sparc-cross depends on sysvinit-sparc-cross (= 2.76-1); however: : Package sysvinit-sparc-cross is not configured yet. :dpkg: error processing libc6-sparc-cross (--install): : dependency problems - leaving unconfigured :Errors were encountered while processing: : libc6-sparc-cross :dpkg -i failed. -- Ferret no baka
Cross-compiling on Debian systems?
I'd like to set up a cross-compiler on my Lintel (AMD 266) to compile packages for my Sparc IPX. I'd preferably like to package the cross-compiler so I can esaily remove it if I no longer need it. The only cross-compiler in the slink packages list is for m68k. What do I need to do to set one up? -- Ferret no baka
Re: Cross-compiling on Debian systems?
On Wed, Nov 17, 1999 at 02:48:55PM -0800, [EMAIL PROTECTED] wrote: I'd like to set up a cross-compiler on my Lintel (AMD 266) to compile packages for my Sparc IPX. I'd preferably like to package the cross-compiler so I can esaily remove it if I no longer need it. The only cross-compiler in the slink packages list is for m68k. What do I need to do to set one up? The last cross-compiler I built (for kernel compiles) was using the m68k cross-compiler package. I just changed the m68k references to sparc, and ran dpkg-buildpackage -us -uc -rfakeroot (change all of the m68k references in debian/ to sparc). -- ---===-=-==-=---==-=-- / Ben Collins -- ...on that fantastic voyage... -- Debian GNU/Linux \ ` [EMAIL PROTECTED] - [EMAIL PROTECTED] - [EMAIL PROTECTED]' `---=--===-=-=-=-===-==---=--=---'
Re: cross-compiling the kernel
At 18:01 -0400 1999-05-10, Ben Collins wrote: Just a note, you can skip the entire portion dealing with the binutils if you install the binutils-multiarch package, which can handle objects from any of binutils supported architecures. This means you only need to build the cross-compiler itself. You'd still need to build a cross-assembler, gas does not use BFD. Incidentally, I have patches for kernel-package to support cross-compiling at http://www.debian.org/Bugs/db/36/36863.html. -- Joel Klecker (aka Espy)Debian GNU/Linux Developer URL:mailto:[EMAIL PROTECTED] URL:mailto:[EMAIL PROTECTED] URL:http://web.espy.org/ URL:http://www.debian.org/
cross-compiling the kernel
a simple program, provided I don't try to link it: $ /usr/local/sun4-linux/bin/gcc -c /tmp/prog.c -o /tmp/prog.o Link it and run it on the target machine: sun$ egcc prog.o -o prog sun$ ./prog Hello, world! We can't link on the host machine because there aren't any libraries, but we don't need any libraries for compiling the kernel, so we just ignore that problem for now and unpack the kernel source instead: $ cd $b $ bzcat linux-2.2.7.tar.bz2 | tar xf - $ cd linux ; patch -p1 -s your_patches_that_linus_rejected Edit the Makefile to read: ARCH := sparc CROSS_COMPILE = /usr/local/sun4-linux/bin/ Copy a .config from somewhere else, if you want, or make xconfig, noting with pleasure that it doesn't ask you what kind of Pentium you have, then do the standard: $ make dep $ make clean $ make $ make modules $ make INSTALL_MOD_PATH=$b/modules modules_install Now you have a vmlinux and modules. Try them to see if they work ... You might also try comparing the binaries with ones built natively. If you used the same compiler version and configuration in each case the binaries should be identical apart from the embedded date stamps. Cross-compiling and linking --- What about compiling and linking an ordinary C program on the host machine? This is harder because you have to provide some target libraries in /usr/local/sun4-linux/lib/, and getting linkers to work seems to be a frequent problem even for veteran hackers. Of course you could use your cross-compiler to build the target libraries on the host machine, but I just copied them from Debian SPARC. A minimum set of libraries for compiling a statically linked Hello, world program appears to be: crt1.o crtbegin.o crtend.o crti.o crtn.o libc.a libgcc.a. A minimum set of libraries for compiling a dynamically linked Hello, world appears to be: crt1.o crtbegin.o crtend.o crti.o crtn.o ld-2.0.105.so ld-linux.so.2 libc-2.0.105.so libc.so libc.so.6 libc_nonshared.a libgcc.a; ld-linux.so.2 is a link to ld-2.0.105.so, libc.so.6 is a link to libc-2.0.105.so, and libc.so is a little script containing some file paths which you must alter to make it work. When the inevitable linking problems appear, it's worth adding -Wl,--verbose as an argument to gcc. Then you can see what the linker is trying to do. It's probably trying to link Intel libraries with the SPARC binaries. Unfortunately, if the linker can't find what it wants in /usr/local/sun4-linux/lib it goes and looks in /lib or /usr/lib. Preventing it from stubbornly trying to link with /lib/libc.so.6 can be quite trying at times but don't make the mistake which my manager once made of moving that file out of the way temporarily! Exercise: See if you can build the complete Debian binary distribution for SPARC, from source, on an Intel machine. Special credit will be given for a robust and reusable solution for cross-building tetex and emacs ... Edmund [EMAIL PROTECTED], 1999-05-10
Re: cross-compiling the kernel
On Mon, May 10, 1999 at 07:52:07PM +0100, [EMAIL PROTECTED] wrote: Unpack the source packages: $ tar xzf binutils_2.9.1.0.19a.orig.tar.gz $ bzcat egcs-1.1.2.tar.bz2 Just a note, you can skip the entire portion dealing with the binutils if you install the binutils-multiarch package, which can handle objects from any of binutils supported architecures. This means you only need to build the cross-compiler itself. You may also want to look at the gcc-m68k cross compiler from hamm (it used gcc 2.7.2.3) which is what I used to build my i386-sparc cross compiler for kernels (just changed m68k to sparc in the debian/rules file). The same rules file could possibly be used for egcs with some tweaking. -- --- - - --- - - - --- Ben Collins [EMAIL PROTECTED]Debian GNU/Linux OpenLDAP Dev - [EMAIL PROTECTED] The Choice of the GNU Generation -- -- - - - --- --- -- - - --- - --