JDP : Crosscompiler

Home :: PageIndex :: RecentChanges :: RecentlyCommented :: UserSettings :: You are a guest
This is an old revision of Crosscompiler from 2003-09-07 22:50:16.

Building a crosscompiler for sparc32 using a Debian/Linux box


get the toolchain package
apt-get install toolchain-source/testing fakeroot automake1.4/testing

NOTE: the toolchain-source of Debian/Woody is broken, so that's why we use the unstable toolchain-source.

configure the toolchain
cd /usr/src EMAIL="someone@somedomain.com" tpkg-make sparc-linux

NOTE: you have to have a valid gpg secret key, because the debian package requires gpg signing. Looking up your gpg key involves the GECOS field in your /etc/passwd entry, so make sure your GECOS matches your key.

create binutils
cd binutils-sparc-linux-''version'' debuild debi


libc
edit /etc/dpkg/cross-compile:
crossbase = /usr

then create and install the cross-dkpg'd SPARC packages.
su -c "TPKG_SERVER=ftp.nl.debian.org tpkg-install-libc sparc-linux"

by default, tpkg-install-libc will use the british debian server.

install binutils-sparc
su -c "dpkg -i ../binutils-sparc-linux-''version''.deb"


make GCC
The woody toolchain package presents a 3.* GCC version, which is not what we want. What we do want is GCC 2.95. How to do it? Simply read the fine manual:
apt-get source gcc-2.95 cd gcc-2.95-2.95.4.ds13 less debian/README.cross

Which read about gcc:
... - Edit the file gcc-2.95-*/debian/rules.defs where it defines TARGETS. Change this to 'TARGETS = ${target}'. - In order to speed up the build process, disable the regression tests. Search for 'with_check := disabled by hand' in gcc-2.95-*/debian/rules.defs and uncomment it. - In order to speed up the build process, disable building of the Pascal compiler if you don't need it. Search for 'with_pascal := disabled by hand' in gcc-2.95-*/debian/rules.defs and uncomment it. The same thing can be done for the CHILL, Fortran and Java compilers. - Build using 'dpkg-buildpackage -rfakeroot'. This will take a _long_ time, as it builds a bootstrap native compiler first, and also builds the native packages.
There is no comment on this page. [Display comments/form]