crosstoll交叉编译环境建立

目的:在现有机器上编译其它指令集程序,比如在x86上编译MIPS,PPC等

下载:http://www.kegel.com/crosstool/crosstool-0.43.tar.gz 

正文:

1、获取crosstool工具包,解压

2、选择适合自己的模板,比如powerpc-405-linux-gnu, 本文选择demo-ppc405.sh 模板

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.txt

set -ex
TARBALLS_DIR=$HOME/downloads
RESULT_TOP=/home/jyq/crosstool
export TARBALLS_DIR RESULT_TOP
GCC_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 --notest
eval `cat powerpc-405.dat gcc-4.4.2-glibc-2.9.dat` sh all.sh --notest

echo Done.
红色部分为待修改部分,分别为源码存放目录、生成工具目录、生成语言、相应版本文件

B)vim  powerpc-7450.dat

TARGET=powerpc-405-linux-gnu
TARGET_CFLAGS="-O -mcpu=405"
GCC_EXTRA_CONFIG="--with-cpu=405 --enable-cxx-flags=-mcpu=405"
GLIBC_EXTRA_CONFIG="$GLIBC_EXTRA_CONFIG --without-fp"
红色部分为工具链名称

C)vim  gcc-3.4.1-glibc-2.3.3.dat

相应目录为源码包文件

D)./demo-ppc405.sh即可

D


你可能感兴趣的:(crosstoll交叉编译环境建立)