linux
1
PCX86 CPUARMCPUX86 CPUARM CPULinux
LinuxPCPCbinutilsgccglibc 3 libc c glibc uClibcdietlibc newlib
2 gccbinutilscglibc Linux
GNUGCCGCCGNUCPU-PLATFORM-OSx86/i386 i686-pc-linux-gnuARMarm-linux-gnu
Crosstool ftp.arm.kernel.org.uk
1
jiabing/home/jiabingarmlinux# cd /home/jiabing# mkdir armlinuxarmlinux3 build-toolskernel tools# cd armlinux# mkdir build-tools kernel tools build-tools binutilsgccglibc kernel tools 2
# export PRJROOT=/home/jiabing/armlinux# export TARGET=arm-linux# export PREFIX=$PRJROOT/tools# export TARGET_PREFIX=$PREFIX/$TARGET# export PATH=$PREFIX/bin:$PATHexportexportbashrcexport3
BinutilsGNUBinutilsaddr2line arasc++filtgprofldnmobjcopyobjdumpranlibreadelfsizestrings striplibibertylibbfdlibopcodes 4Binutils
Binutilsbinutils-2.15binutils-2.15.tar.bz2# cd $PRJROOT/build-tools# tar xjvf binutils-2.15.tar.bz2Binutils# cd $PRJROOT/build-tools# mkdir build-binutils# cd build-binutils# ../ binutils-2.15/configure --target=$TARGET --prefix=$PREFIXtarget arm-linux --prefix check Makefile make# make# make install/home/mike/armlinux/tools/binBinutils# ls $PREFIX/binarm-linux-addr2line arm-linux-ld arm-linux-ranlib arm-linux-striparm-linux-ar arm-linux-nm arm-linux-readelfarm-linux-as arm-linux-objcopy arm-linux-sizearm-linux-c++filt arm-linux-objdump arm-linux-strings
5Linuxarm-linux1kernellinux-2.6.10.tar.gz# cd $PRJROOT/kernel# tar xvzf linux-2.6.10.tar.gz2# cd linux-2.6.10# make ARCH=arm CROSS_COMPILE=arm-linux- menuconfigARCH=arm armCROSS_COMPILE=arm-linux-arm-linux-config xconfigmenuconfigmake menuconfigS3C2410System Type->ARM System Type->/Samsung S3C2410include/linux/version.h include/linux/autoconf.hglibcversion.h autoconf.h
/home/mike/armlinux/tools/arm-linuxinlcude# mkdir p $TARGET_PREFIX/include# cp r $PRJROOT/kernel/linux-2.6.10/include/linux $TARGET_PREFIX/include# cp r $PRJROOT/kernel/linux-2.6.10/include/asm-arm $TARGET_PREFIX/include/asm
arm- linux-gccgccglibcBootLoaderCCCBootLoader# cd $PRJROOT/build-tools# tar xvzf gcc-3.3.6.tar.gz# mkdir build-gcc# cd gcc-3.3.6# vi gcc/config/arm/t-linuxARMlibcgcc/config/arm/t- linuxTARGET_LIBGCC2_CFLAGS-Dinhibit_libc -D__gthr_ posix_h/usr/inlcude6gcc
TARGET_LIBGCC2-CFLAGS = -fomit-frame-pointer fPICTARGET_LIBGCC2- CFLAGS=-fomit-frame-pointerfPIC -Dinhibit_libc -D__gthr_posix_ht-linux# cd build-gcc# ../ build-gcc /configure --target=$TARGET --prefix=$PREFIX --enable-languages=c--disable-threads --disable-shared--enable-languages=cC--disable-threadsthreadglibc--disable-shared# make# make install/home/mike/armlinux/tools/binarm-linux-gccgcc
glibc-2.2.3.tar.gzglibc-linuxthreads-2.2.3.tar.gz# cd $PRJROOT/build-tools# tar -xvzf glibc-2.2.3.tar.gz# tar -xzvf glibc-linuxthreads-2.2.3.tar.gz --directory=glibc-2.2.3glibc-2.2.3glibc-2.2.3$PRJROOT/build-toolsbuild-glibc # cd $PRJROOT/build-tools# mkdir build-glibc# cd build-glibc# CC=arm-linux-gcc ../glibc-2.2.3 /configure --host=$TARGET --prefix="/usr"--enable-add-ons --with-headers=$TARGET_PREFIX/includeCC=arm-linux- gccCCCross Compilergccglibc--prefix="/usr"/usr/local--enable-add-onsglibclinuxthreads glibc-enable-add-ons=linuxthreads--with-headersglibc linux glibc# make# make install7glibc
gccglibcglibcglibcgccCCC++# cd $PRJROOT/build-tools/gcc-2.3.6# ./configure --target=arm-linux --enable-languages=c,c++ --prefix=$PREFIX# make# make install$PREFIX/binarm-linux-g++ arm-linux-c++8gcc
# ls $PREFIX/binarm-linux-addr2line arm-linux-g77 arm-linux-gnatbind arm-linux-ranlibarm-linux-ar arm-linux-gcc arm-linux-jcf-dump arm-linux-readelfarm-linux-as arm-linux-gcc-3.3.6 arm-linux-jv-scan arm-linux-sizearm-linux-c++ arm-linux-gccbug arm-linux-ld arm-linux-stringsarm-linux-c++filt arm-linux-gcj arm-linux-nm arm-linux-striparm-linux-cpp arm-linux-gcjh arm-linux-objcopy grepjararm-linux-g++ arm-linux-gcov arm-linux-objdump jar
Crosstool() Crosstoolgccglibcglibchttp: //kegel.com/crosstoolCrosstool
Crosstool()Crosstoolgccglibcglibchttp: //kegel.com/crosstoolCrosstoolCrosstool
Crosstool()which makeinfotexinfo-4.11.tar.bz2texinfo-4.11./configure&&make&&make installmakeinfo
Crosstool()1 linux-2.4.20.tar.gzbinutils-2.19.tar.bz2gcc-3.3.6.tar.gzglibc- 2.3.2.tar.gzglibc-linuxthreads-2.3.2.tar.gzgdb-6.5.tar.bz2 $HOME/downloads$HOME/crosstool-0.43.tar.gz# cd $HOME/# tar xvzf crosstool-0.43.tar.gz
Crosstool()2arm.sharm.shdemo-arm.sharm.sharm.sh# cd crosstool-0.43# cp demo-arm.sh arm.sh# vi arm.sharm.sh
Crosstool()#!/bin/shset -exTARBALLS_DIR=$HOME/downloads # RESULT_TOP=$HOME/arm-bin # export TARBALLS_DIR RESULT_TOPGCC_LANGUAGES="c,c++" # C, C++export GCC_LANGUAGES# /opt/crosstoolmkdir -p $RESULT_TOP# eval 'cat arm.dat gcc-3.3.6-glibc-2.3.2.dat' sh all.sh --notestecho Done.
Crosstool()3arm.sharm-xscale.datgcc-3.3.6-glibc-2.3.2.datCrosstool arm.datKERNELCONFIG='pwd'/arm.config # TARGET=arm-linux # TARGET_CFLAGS="-O" #
Crosstool()gcc-3.3.6-glibc-2.3.2.datCrosstoolBINUTILS_DIR=binutils-2.19GCC_DIR=gcc-3.3.6GLIBC_DIR=glibc-2.3.2LINUX_DIR=linux-2.6.10-8()GDB_DIR=gdb-6.5
Crosstool()4Crosstoolarm.sh# cd crosstool-0.43# ./arm.sh/opt/crosstoolarm-linux-addr2line arm-linux-g++ arm-linux-ld arm-linux-sizearm-linux-ar arm-linux-gcc arm-linux-nm arm-linux-stringsarm-linux-as arm-linux-gcc-3.3.6 arm-linux-objcopy arm-linux-striparm-linux-c++ arm-linux-gccbug arm-linux-objdump fix-embedded-pathsarm-linux-c++filt arm-linux-gcov arm-linux-ranlibarm-linux-cpp arm-linux-gprof arm-linux-readelf
Crosstool()5PATH/etc/ bashrcbashrcexport PATH=/home/jiabing/gcc-3.3.6-glibc-2.3.2/arm-linux-bin/bin:$PATH
Crosstool()arm-linuxarm-linux-gcc