Contents
Download and build crosstool-ng:
# Install prerequisites: sudo apt-get install flex bison automake libtool ncurses-dev version=crosstool-ng-1.6.1 wget http://ymorin.is-a-geek.org/download/crosstool-ng/$version.tar.bz2 tar xjvf $version.tar.bz2 cd $version/ ./configure --local # NOTE: The following "make" command only builds the "ct-ng" tool # (not the compilers, libs, and binutils). make chmod a+rx ct-ng
Configure crosstool-ng to build a specific cross-compiler. For some tips on how to do the configuration, see the section Configuration Options for Crosstool-ng (Glibc) for starters:
# Finally, start crosstool-ng: ./ct-ng menuconfig # Note: Read the next section for information on how to configure... # # Alternatively, do this: # TODO: I haven't created the glibc config file yet: # cp crosstool-ng-1.6.1-ppc405-nofloat-glibc-config .config # or # cp crosstool-ng-1.6.1-ppc405-nofloat-uclibc-config .config # # Then run: # ./ct-ng oldconfig
Instruct crosstool-ng to build the cross-compiler:
# After configuring (with menuconfig or oldconfig), build the toolchain: unset LD_LIBRARY_PATH LIBRARY_PATH CPATH export LD_LIBRARY_PATH LIBRARY_PATH CPATH ./ct-ng build
If you want both glibc and uClibc support, then repeat the process twice. Once for glibc, and once again for uClibc. See the following steps for how to reconfigure crosstool-ng for each. (Hint: you probably do want both uClibc and glibc support).
Warning
I haven't tested the glibc portion of this tutorial yet. This is copied from the older `crosstool-ng-1.3.2.html`_ tutorial. Please provide feedback on your experiences if you try this. Thanks.
The first two configuration screens, and the options you should choose are displayed here. A more detailed description of the configurations follows these screenshots:
Here are the configuration settings to apply:
Special note: do not build uclibc yourself. Crosstool-ng will do this automatically! The instructions go basically like this:
uClibc 0.9.30.1 configuration (available here):
Crosstool configuration (available here):
Follow the same configuration as for Glibc (described in the previous section), and then apply the following additional configuration listed in the next bullets.
C compiler
C-library:
C library: uClibc
uClibc version: 0.9.30.1
Configuration file: ${CT_LIB_DIR}/uClibc-0.9.30.1-ppc405-nofpu-config (available here)
Threading implementation to use: linuxthreads
Debug facilities (Optional, Untested!)
"error: C compiler cannot create executables"
I don't yet know what to do about this error...