Objective: To compile other instruction sets on an existing machine, for example, to compile MIPS and PPC on x86.
Download: http://www.kegel.com/crosstool/crosstool-0.43.tar.gz
Body:
1. Obtain the crosstool toolkit and decompress it.
2, choose a suitable template, such as powerpc-405-linux-gnu,
This article selects the demo-ppc405.sh template.
A) vi
Demo-ppc405.sh
#!/bin/sh# This script has one line for each known working toolchain# for this architecture. Uncomment the one you want.# Generated by generate-demo.pl from buildlogs/all.dats.txtset -exTARBALLS_DIR=$HOME/downloadsRESULT_TOP=/home/jyq/crosstoolexport TARBALLS_DIR RESULT_TOPGCC_LANGUAGES="c,c++"export GCC_LANGUAGES# Really, you should do the mkdir before running this,# and chown /opt/crosstool to yourself so you don't need to run as root.mkdir -p $RESULT_TOP#eval `cat powerpc-405.dat gcc-3.2.3-glibc-2.2.5.dat` sh all.sh --notest#eval `cat powerpc-405.dat gcc-3.2.3-glibc-2.3.2.dat` sh all.sh --notest#eval `cat powerpc-405.dat gcc-3.3.6-glibc-2.2.5.dat` sh all.sh --notest#eval `cat powerpc-405.dat gcc-3.3.6-glibc-2.3.2.dat` sh all.sh --notest#eval `cat powerpc-405.dat gcc-3.3.6-glibc-2.3.5.dat` sh all.sh --notest#eval `cat powerpc-405.dat gcc-3.3.6-glibc-2.3.6.dat` sh all.sh --notest#eval `cat powerpc-405.dat gcc-3.4.5-glibc-2.2.5.dat` sh all.sh --notest#eval `cat powerpc-405.dat gcc-3.4.5-glibc-2.3.2.dat` sh all.sh --notest#eval `cat powerpc-405.dat gcc-3.4.5-glibc-2.3.5.dat` sh all.sh --notest#eval `cat powerpc-405.dat gcc-3.4.5-glibc-2.3.6.dat` sh all.sh --notest#eval `cat powerpc-405.dat gcc-4.0.2-glibc-2.3.2.dat` sh all.sh --notest#eval `cat powerpc-405.dat gcc-4.0.2-glibc-2.3.5.dat` sh all.sh --notest#eval `cat powerpc-405.dat gcc-4.0.2-glibc-2.3.6.dat` sh all.sh --notest#eval `cat powerpc-405.dat gcc-4.1.0-glibc-2.3.2.dat` sh all.sh --notest#eval `cat powerpc-405.dat gcc-4.1.0-glibc-2.3.5.dat` sh all.sh --notesteval `cat powerpc-405.dat gcc-4.4.2-glibc-2.9.dat` sh all.sh --notestecho Done.
The red part is the source code directory, the tool directory, the language, and the corresponding version file.
B) Vim powerpc-7450.dat.
TARGET=powerpc-405-linux-gnuTARGET_CFLAGS="-O -mcpu=405"GCC_EXTRA_CONFIG="--with-cpu=405 --enable-cxx-flags=-mcpu=405"GLIBC_EXTRA_CONFIG="$GLIBC_EXTRA_CONFIG --without-fp"
Tool chain name in red
C) Vim gcc-3.4.1-glibc-2.3.3.dat.
The corresponding directory is the source code package file
D)./demo-ppc405.sh.
D