Skip to content

erikw/ewxb-gcc-cross-compiler-builder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

t# ewxb - Erik Westrup's GCC cross-compiler builder SLOC Top programming languages used

This is a script documenting the steps and phases taken when I compiled a GCC cross toolchain for GCC 4.9 head (with Go support). Building a cross-compiler is complex due to dependencies, so a lot of bootstrapping has to be done. This script is inspired by Jim Blandy's excellent eglibc cross-compiling guide posted at eglibc's mailing list at [patches] Cross-building instructions.

This script can serve as a starting point for those who want to build an x-toolchain from scratch. Don't expect it to work directly as it's tailored for my setup. Instead, you can reuse the phases and modify the script with the parameters that you need. The last phase adds Go support, which is easy to comment out if you're only interested in a C/C++ compiler.

My setup was:

  • Host/Build system: Linux 3.2.0-4-amd64 #1 SMP Debian 3.2.54-2 x86_64 GNU/Linux
  • Target: MIPS
  • gcc: 4.9.0
  • glibc: 2.19
  • binutils: 2.24

The scripts make it easy to run specific phases (or a range of phases) so that you can easily tweak a failing phase and continue with the ones that follow when you have one phase to work on. Make sure to edit x_environment.sh to the right versions of the packages and build paths to use.

For any details, simply read the sauce.

More info about using Go with a gccgo cross-compiler can be found at the go-wiki.

Resulting x-compiler tools

The sweet result after playing some Rube Goldberg trickery games.

About

A script for building a full GCC + glibc toolchain from scratch (with Go support via gccgo) in multiple stages.

Topics

Resources

License

Stars

Watchers

Forks

Languages