软件包名称
|
下载站点
|
crosstool-0.43.tar.gz
|
http://kegel.com/crosstool/crosstool-0.43.tar.gz
|
binutils-2.15.tar.bz2
|
http://ftp.gnu.org/gnu/binutils/
|
gcc-3.4.5.tar.
bz2
|
http://ftp.gnu.org/gnu/
gcc
|
glibc-2.3.6.tar.bz2
|
http://ftp.gnu.org/gnu/
glibc
|
glibc-linuxthreads-2.3.6.tar.bz2
|
http://ftp.gnu.org/gnu/
glibc
|
linux-2.6.28.2.tar.bz2
|
http://ftp.kernel.org/pub/linux/kernel/v2.6/
|
linux-libc-headers-2.6.12.0.tar.bz2
|
http://ep09.pld-linux.org/~mmazur/linux-libc-headers/
|
# cd /home/mike
# tar
�C
xvzf
crosstool-0.4
3
.tar.gz
|
# cd
crosstool-0.4
3
# cp demo-arm.sh arm.sh
# vi arm.sh
|
#!/bin/sh
set -ex
TARBALLS_DIR=
/home/mike
/downloads
# 定义工具链源码所存放位置。
RESULT_TOP=
/opt
/crosstool
# 定义工具链的安装目录
export TARBALLS_DIR RESULT_TOP
GCC_LANGUAGES="c,c++"
# 定义支持C, C++语言
export GCC_LANGUAGES
#
创建/opt
/
crosstool目录
mkdir -p $RESULT_TOP
#
编译工具链,该过程需要数小时完成。
eval `cat arm.dat gcc-3.
4
.
5
-glibc-2.3.
6
.dat` sh all.sh --notest
echo Done.
|
KERNELCONFIG=`pwd`/arm.config
# 内核的配置
TARGET=arm-linux
# 编译生成的工具链名称
TARGET_CFLAGS="-O"
# 编译选项
|
BINUTILS_DIR=binutils-2.15
GCC_DIR=gcc-3.
4.5
GLIBC_DIR=glibc-2.3.
6
GLIBCTHREADS_FILENAME=glibc-linuxthreads-2.3.
6
LINUX_DIR=linux-2.
6.28.2
LINUX_SANITIZED_HEADER_DIR=linux-libc-headers-2.6.12.0
|
# cd
crosstool-0.4
3
# ./arm.sh
|
arm-linux-addr2line
arm-linux-g++ arm-linux-ld
arm-linux-size
arm-linux-ar arm-linux-gcc arm-linux-nm arm-linux-strings
arm-linux-as arm-linux-gcc-3.
4.5
arm-linux-objcopy
arm-linux-strip
arm-linux-c++ arm-linux-gccbug
arm-linux-objdump
fix-embedded-paths
arm-linux-c++filt
arm-linux-gcov arm-linux-ranlib
arm-linux-cpp arm-linux-gprof arm-linux-readelf
|
export PATH=/opt/crosstool/gcc-3.4.5-glibc-2.3.6/arm-linux/bin:$PATH
|
[root@localhost crosstool-0.43]# ./arm.sh
+ TARBALLS_DIR=/home/mike/downloads
+ RESULT_TOP=/opt/crosstool
+ export TARBALLS_DIR RESULT_TOP
+ GCC_LANGUAGES=c,c++
+ export GCC_LANGUAGES
+ mkdir -p /opt/crosstool
++ cat arm.dat gcc-3.4.5-glibc-2.3.6.dat
+ eval 'KERNELCONFIG=`pwd`/arm.config' TARGET=arm-linux 'TARGET_CFLAGS="-O"' BINUTILS_DIR=binutils-2.15 GCC_DIR=gcc-3.4.5 GLIBC_DIR=glibc-2.3.6 LINUX_DIR=linux-2.6.28.2 LINUX_SANITIZED_HEADER_DIR=linux-libc-headers-2.6.12.0 GLIBCTHREADS_FILENAME=glibc-linuxthreads-2.3.2 sh all.sh --notest
+++ pwd
++ KERNELCONFIG=/home/mike/crosstool-0.43/arm.config
++ TARGET=arm-linux
++ TARGET_CFLAGS=-O
++ BINUTILS_DIR=binutils-2.15
++ GCC_DIR=gcc-3.4.5
++ GLIBC_DIR=glibc-2.3.6
++ LINUX_DIR=linux-2.6.28.2
++ LINUX_SANITIZED_HEADER_DIR=linux-libc-headers-2.6.12.0
++ GLIBCTHREADS_FILENAME=glibc-linuxthreads-2.3.2
++ sh all.sh --notest
You set both LINUX_DIR and LINUX_SANITIZED_HEADER_DIR - ignoring LINUX_DIR for the build
DEJAGNU not set, so not running any regression tests
GCC_EXTRA_CONFIG not set, so not passing any extra options to gcc's configure script
GLIBC_ADDON_OPTIONS not set, so building all glibc add-on's
+ TOOLCOMBO=gcc-3.4.5-glibc-2.3.6
++ pwd
+ BUILD_DIR=/home/mike/crosstool-0.43/build/arm-linux/gcc-3.4.5-glibc-2.3.6
++ pwd
+ TOP_DIR=/home/mike/crosstool-0.43
+ test -z ''
+ SRC_DIR=/home/mike/crosstool-0.43/build/arm-linux/gcc-3.4.5-glibc-2.3.6
+ echo 'SRC_DIR not set, so source tarballs will be unpacked in the build directory'
SRC_DIR not set, so source tarballs will be unpacked in the build directory
+ abort 'Don'\''t run all.sh or crosstool.sh as root, it'\''s dangerous'
+ echo 'Don'\''t' run all.sh or crosstool.sh as root, 'it'\''s' dangerous
Don't run all.sh or crosstool.sh as root, it's dangerous
+ exec false
[root@localhost crosstool-0.43]#
|
[root@localhost crosstool-0.43]#
su mike
//切换到普通用户mike
[mike@localhost crosstool-0.43]$
./arm.sh
+ TARBALLS_DIR=/home/mike/downloads
+ RESULT_TOP=/opt/crosstool
+ export TARBALLS_DIR RESULT_TOP
+ GCC_LANGUAGES=c,c++
+ export GCC_LANGUAGES
+ mkdir -p /opt/crosstool
++ cat arm.dat gcc-3.4.5-glibc-2.3.6.dat
+ eval 'KERNELCONFIG=`pwd`/arm.config' TARGET=arm-linux 'TARGET_CFLAGS="-O"' BINUTILS_DIR=binutils-2.15 GCC_DIR=gcc-3.4.5 GLIBC_DIR=glibc-2.3.6 LINUX_DIR=linux-2.6.28.2 LINUX_SANITIZED_HEADER_DIR=linux-libc-headers-2.6.12.0 GLIBCTHREADS_FILENAME=glibc-linuxthreads-2.3.2 sh all.sh --notest
+++ pwd
++ KERNELCONFIG=/home/mike/crosstool-0.43/arm.config
++ TARGET=arm-linux
++ TARGET_CFLAGS=-O
++ BINUTILS_DIR=binutils-2.15
++ GCC_DIR=gcc-3.4.5
++ GLIBC_DIR=glibc-2.3.6
++ LINUX_DIR=linux-2.6.28.2
++ LINUX_SANITIZED_HEADER_DIR=linux-libc-headers-2.6.12.0
++ GLIBCTHREADS_FILENAME=glibc-linuxthreads-2.3.2
++ sh all.sh --notest
You set both LINUX_DIR and LINUX_SANITIZED_HEADER_DIR - ignoring LINUX_DIR for the build
DEJAGNU not set, so not running any regression tests
GCC_EXTRA_CONFIG not set, so not passing any extra options to gcc's configure script
GLIBC_ADDON_OPTIONS not set, so building all glibc add-on's
+ TOOLCOMBO=gcc-3.4.5-glibc-2.3.6
++ pwd
+ BUILD_DIR=/home/mike/crosstool-0.43/build/arm-linux/gcc-3.4.5-glibc-2.3.6
++ pwd
+ TOP_DIR=/home/mike/crosstool-0.43
+ test -z ''
+ SRC_DIR=/home/mike/crosstool-0.43/build/arm-linux/gcc-3.4.5-glibc-2.3.6
+ echo 'SRC_DIR not set, so source tarballs will be unpacked in the build directory'
SRC_DIR not set, so source tarballs will be unpacked in the build directory
+ test -w /tmp
+ TARBALLS_DIR=/home/mike/downloads
+ RESULT_TOP=/opt/crosstool
+ PREFIX=/opt/crosstool/gcc-3.4.5-glibc-2.3.6/arm-linux
+ export TOOLCOMBO
+ export PREFIX
+ export BUILD_DIR
+ export SRC_DIR
+ export TARBALLS_DIR
+ export TOP_DIR
+ '[' 1 -gt 0 ']'
+ opt_no_test=1
+ shift
+ '[' 0 -gt 0 ']'
+ test '' = 1
+ test '' = ''
+ test '' = 1
+ test -d /home/mike/crosstool-0.43/build/arm-linux/gcc-3.4.5-glibc-2.3.6
+ mkdir -p /home/mike/crosstool-0.43/build/arm-linux/gcc-3.4.5-glibc-2.3.6
mkdir: cannot create directory `/home/mike/crosstool-0.43/build': Permission denied
[mike@localhost crosstool-0.43]$
su
Password:
[root@localhost crosstool-0.43]#
./arm.sh
|
KERNELCONFIG=`pwd`/arm.config
TARGET=arm-softfloat-linux
TARGET_CFLAGS="-O"
GCC_EXTRA_CONFIG="--with-float=soft"
GLIBC_EXTRA_CONFIG="--without-fp"
|
arm-softfloat-linux-addr2line arm-softfloat-linux-g++ arm-softfloat-linux-ld arm-softfloat-linux-size
arm-softfloat-linux-ar arm-softfloat-linux-gcc arm-softfloat-linux-nm arm-softfloat-linux-strings
arm-softfloat-linux-as arm-softfloat-linux-gcc-3.4.5
arm-softfloat-linux-objcopy
arm-softfloat-linux-strip
arm-softfloat-linux-c++ arm-softfloat-linux-gccbug arm-softfloat-linux-objdump fix-embedded-paths
arm-softfloat-linux-c++filt arm-softfloat-linux-gcov arm-softfloat-linux-ranlib
arm-softfloat-linux-cpp arm-softfloat-linux-gprof arm-softfloat-linux-readelf
|