Cross Compiling

From CSCWiki
Revision as of 07:51, 13 July 2007 by Dtbartle (talk | contribs)
Jump to navigation Jump to search

Instructions for compiling an i386 multlib toolchain:

  • Install apt-cross, dpkg-cross, autoconf, automake, gawk, flex, bison, debhelper, devscript, cdbs, fakeroot
  • Download i386 binary packages of linux-kernel-headers, libc6, libc6-dev, libc6-amd64, libc6-dev-amd64
  • Run 'dpkg-cross -a i386 -b package' for each of the above packages
  • Install the resulting cross packages that were created by dpkg-cross above
  • 'apt-get source' binutils and gcc-4.1
  • cd binutils and run:
    • TARGET=i486-linux-gnu fakeroot debian/rules binary-cross
  • Install resulting cross binutils
  • cd gcc-4.1 and run:
    • export GCC_TARGET=i386
    • export DEB_CROSS_INDEPENDENT=yes
    • debian/rules control
    • dpkg-buildpackage -b -rfakeroot
  • Install resulting cross gcc-4.1

It's generally useful to upload these built packages to the CSC debian repository. The problem is that .changes files don't get generated. dpkg-genchanges might be able to help here.

If you need i386 binary libraries, you can run 'apt-cross -a i386 -install package'.