Chinaunix首页 | 论坛 | 博客
  • 博客访问: 159792
  • 博文数量: 6
  • 博客积分: 2010
  • 博客等级: 大尉
  • 技术积分: 500
  • 用 户 组: 普通用户
  • 注册时间: 2006-12-29 09:42
文章分类

全部博文(6)

文章存档

2008年(6)

我的朋友
最近访客

分类: LINUX

2008-05-13 15:33:26


1. download below sources


2.use the crosstool to create the arm-iwmmx-linux-gnueabi-gcc which support the iwmmx instruction
2.1 download below two files:


use tar to decompress and patch
  tar xvf crosstool-0.42.tar.gz
  cd crosstool-0.42
  patch -Np1 -i ../crosstool-0.42-mg2.patch
2.2 create own directory for crosstool and copy files from the directory of crosstool-0.42
 #assuming $PWD=~/downloads/crosstool-0.42
  mkdir ~/crosstool                #build our own crosstool directory
  cp -v demo-arm-iwmmxt.sh ~/crosstool
  mkdir demo-script
  mv demo* demo-script/       #we do not need other demo-*sh scripts
  cp -av *.sh ~/crosstool     #copy all.sh,crosstool.sh,... to our own directory
  cp -av *.c ~/crosstool      #copy fix-embedded-paths.c,... to our own directory
                              #you can skip this step if you do not need it
  cp config.guess ~/crosstool #we need config.guess to get the value for $BUILD
2.3 change arm-iwmmxt.dat and gcc-4.1.0-glibc-2.3.6.dat
edit arm-iwmmxt.dat and rename arm-iwmmxt-eabi.dat
TARGET=arm-iwmmxt-linux-gnueabi
TARGET_CFLAGS="-O"
GCC_EXTRA_CONFIG="--with-float=soft --with-cpu=iwmmxt --with-arch=iwmmxt --enable-cxx-flags=-msoft-float"
GLIBC_EXTRA_CONFIG="--without-fp --disable-libunwind-exceptions"
GLIBC_EXTRA_CC_ARGS="-finline-limit=10000"
USE_SYSROOT=1

edit gcc-4.1.0-glibc-2.3.6.dat and rename gcc-4.2.1-glibc-2.6.1.dat
 BINUTILS_DIR=binutils-2.18
GCC_DIR=gcc-4.2.1
LINUX_SANITIZED_HEADER_DIR=linux-libc-headers-2.6.22.6
GLIBC_DIR=glibc-2.6.1
GLIBCPORTS_FILENAME=glibc-ports-2.6.1
GLIBC_ADDON_OPTIONS=ports,nptl

2.4 modify demo-arm-iwmmx.sh
 #!/bin/sh
set -ex

TARBALLS_DIR=$HOME/crosstool/downloads
RESULT_TOP=/opt/crosstool     
GCC_LANGUAGES="c,c++"
export GCC_LANGUAGES

PARALLELMFLAGS=-j3
export PARALLELMFLAGS

# 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

# Build the toolchain.  Takes a couple hours and a couple gigabytes.
time eval `cat arm-iwmmxt-eabi.dat latest.dat`  sh all.sh --notest

echo Done.
2.5 modify all.sh
(1)notes this part which call getandpatch.sh.Because we manually download the source packages and patching put them into $BUILD_DIR
 if test "$opt_no_unpack" = ""; then
   if test "$opt_builduserland" = "1"; then
      # Ah, nobody would want to change this :-)
      PTXDIST_DIR=ptxdist-testing-20031113
      export PTXDIST_DIR
   fi
   # Download and patch
##################commented out by aaron##############
#   if test -d "$BUILD_DIR"; then
    # Remove in background
#       mv $BUILD_DIR $BUILD_DIR.del.$$
#       rm -rf $BUILD_DIR.del.$$ &
#   fi
#   mkdir -p $BUILD_DIR
#   sh getandpatch.sh
#######################################################
fi

(2)change PREFIX
 # Arbitrary locations for the input and output of the build.
# Change or override these to your taste.
#################commented out by aaron########################
#TARBALLS_DIR=${TARBALLS_DIR-$TOP_DIR/tarballs}
#RESULT_TOP=${RESULT_TOP-$TOP_DIR/result}
###############################################################
####################modified by aaron##########################
#PREFIX=${PREFIX-$RESULT_TOP/$TOOLCOMBO/$TARGET}
PREFIX=$RESULT_TOP

(3)Prohibit directory automatically clean up
 if test "$opt_no_build" = ""; then
    # Build
###################commented out by aaron################
#    if [ -d "$PREFIX" ]; then
    # Remove in background for speed
#    mv "$PREFIX" "$PREFIX.del.$$"
#    rm  -rf  "$PREFIX.del.$$" &
#    fi
#    mkdir -p $PREFIX
#    mkdir -p $BUILD_DIR
##########################################################
    cd $BUILD_DIR

(4)note
#    sh testhello.sh      #commented out by aaron
2.6 modify crosstool.sh
(1)Amendment the installation of kernel headers
 cp -r include/linux $HEADERDIR
cp -r include/asm-${ARCH} $HEADERDIR/asm
################added by aaron#########################
cp -r include/asm-generic $HEADERDIR/asm-generic

cd $BUILD_DIR

(2) prohibit modifying GCC_HOST
 # if host is cygwin and this is not a canadian build, modify GCC_HOST
########################commented out by aaron################################
#case "$GCC_HOST,$CANADIAN_BUILD," in
#*cygwin*,?*,) ;;
#*)            GCC_HOST=`echo $GCC_HOST | sed s/-/-host_/` ;;
#esac
##############################################################################

2.7 manually create the directorys RESULT_TOP=/opt/crosstool(see:arm-iwmmxt-eabi.dat)and BUILD_DIR=`pwd`/build/$TARGET/$TOOLCOMBO (see all.sh) = ~/crosstool/build/arm-iwmmxt-linux-gnueabi/gcc-4.2.1-glibc-2.6.1
  mkdir -p ~/crosstool/build/arm-iwmmxt-linux-gnueabi/gcc-4.2.1-glibc-2.6.1
  sudo mkdir /opt/crosstool
  sudo chown -Rv aaronwong /opt/crosstool
2.8 put the source packages into $BUILD_DIR and manually decompress and patch.At last execute "sh demo-arm-iwmmx.sh"

notes:
when compiled the binutils-2.18, we will encourter error--"
make[3]: *** [bfd.info] Error 1".we solve this problem as below:
cd binutils-2.18/bfd/doc
touch bfd.texinfo
 
阅读(1279) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~