Difference between revisions of "Cross Compiling"

From CSCWiki
Jump to navigation Jump to search
Line 1: Line 1:
Instructions for compiling a toolchain:
+
= Builder =
  
* ARCH = architecture (arm, i386, etc...)
+
The current list of installed cross-compilers on builder is:
 +
* alpha
 +
* arm
 +
* hppa (binutils only)
 +
* i486
 +
* ia64
 +
* m68k
 +
* mips
 +
* mipsel
 +
* powerpc
 +
* sparc
 +
* x86_64
 +
 
 +
= Compiling a toolchain =
 +
 
 +
* export ARCH=architecture (arm, i386, etc...)
  
 
* Install apt-cross, dpkg-cross, autoconf, automake, gawk, flex, bison, debhelper, devscripts, cdbs, fakeroot
 
* Install apt-cross, dpkg-cross, autoconf, automake, gawk, flex, bison, debhelper, devscripts, cdbs, fakeroot
Line 20: Line 35:
 
It's generally useful to upload these built packages to the CSC debian repository. To do this you need to scp the .deb's over to natural-flavours and run 'rrr includedeb etch deb-files...'.
 
It's generally useful to upload these built packages to the CSC debian repository. To do this you need to scp the .deb's over to natural-flavours and run 'rrr includedeb etch deb-files...'.
  
If you need i386 binary libraries, you can run 'apt-cross -a i386 -i package'.
+
= Emdebian =
 +
 
 +
Emdebian is the Debian project responsible for dpkg-cross, apt-cross, and emdebian-tools.
 +
 
 +
== Dpkg-cross ==
 +
Dpkg-cross is a version of dpkg that allows you to install architecture-specific libraries in an isolated way. For example, dpkg-cross will build a package called libc6-mips-cross from the mips libc6 package. This cross package can then be installed alongside the mips cross-compiler.
 +
 
 +
== Apt-cross ==
 +
Apt-cross is a front-end to dpkg-cross. It will automatically fetch and build cross packages.
  
= sun4u =  
+
== Emdebuild ==
 +
Emdebuild is an architecture aware version of debuild.
 +
 
 +
= Sun4u =  
  
 
* DEB_TARGET_GNU_TYPE=sparc-sun-solaris2.8
 
* DEB_TARGET_GNU_TYPE=sparc-sun-solaris2.8
 
* DEB_TARGET_ALIAS=sparc-sun-solaris2.8
 
* DEB_TARGET_ALIAS=sparc-sun-solaris2.8
 
* DEB_TARGET_ARCH=sparc-sun-solaris2.8
 
* DEB_TARGET_ARCH=sparc-sun-solaris2.8
 
= Builder =
 
 
The current list of installed cross-compilers on builder is:
 
* alpha
 
* arm
 
* hppa (binutils only)
 
* i486
 
* ia64
 
* m68k
 
* mips
 
* mipsel
 
* powerpc
 
* sparc
 
* x86_64
 

Revision as of 03:16, 17 September 2007

Builder

The current list of installed cross-compilers on builder is:

  • alpha
  • arm
  • hppa (binutils only)
  • i486
  • ia64
  • m68k
  • mips
  • mipsel
  • powerpc
  • sparc
  • x86_64

Compiling a toolchain

  • export ARCH=architecture (arm, i386, etc...)
  • Install apt-cross, dpkg-cross, autoconf, automake, gawk, flex, bison, debhelper, devscripts, cdbs, fakeroot
  • Run 'apt-cross -a $ARCH linux-kernel-headers libc6 libc6-dev'
  • 'apt-get source' binutils and gcc-4.1
  • cd binutils and run:
    • TARGET=$ARCH-linux-gnu fakeroot debian/rules binary-cross
  • Install resulting cross binutils
  • cd gcc-4.1 and run:
    • export GCC_TARGET=$ARCH
    • export DEB_CROSS_INDEPENDENT=yes
    • export WITHOUT_LANG=java,fortran,pascal,obj,obj-c++,ada,treelang
    • export DEB_CROSS_NO_BIARCH=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. To do this you need to scp the .deb's over to natural-flavours and run 'rrr includedeb etch deb-files...'.

Emdebian

Emdebian is the Debian project responsible for dpkg-cross, apt-cross, and emdebian-tools.

Dpkg-cross

Dpkg-cross is a version of dpkg that allows you to install architecture-specific libraries in an isolated way. For example, dpkg-cross will build a package called libc6-mips-cross from the mips libc6 package. This cross package can then be installed alongside the mips cross-compiler.

Apt-cross

Apt-cross is a front-end to dpkg-cross. It will automatically fetch and build cross packages.

Emdebuild

Emdebuild is an architecture aware version of debuild.

Sun4u

  • DEB_TARGET_GNU_TYPE=sparc-sun-solaris2.8
  • DEB_TARGET_ALIAS=sparc-sun-solaris2.8
  • DEB_TARGET_ARCH=sparc-sun-solaris2.8