Chinaunix首页 | 论坛 | 博客
  • 博客访问: 344917
  • 博文数量: 92
  • 博客积分: 2500
  • 博客等级: 少校
  • 技术积分: 960
  • 用 户 组: 普通用户
  • 注册时间: 2009-08-21 19:38
文章分类

全部博文(92)

文章存档

2010年(71)

2009年(21)

我的朋友

分类: 嵌入式

2009-09-15 15:30:24

My aim is to create a cross tool chain: gcc-3.4.5-glibc-2.3.6


(
1) For safety considerations, the installation process of crosstool only use a regular user, so the first step is to enable sudo command.
  From

I got an approach to enable sudo command, and I change something.
    I did not use the actual operation visudo, because the /etc/sudoers is read-only files, which should be changed to read and write
   So my step is

# chmod 751 /etc/sudoers
    # vim /etc/sudoers
     Input :
     Linux ALL = (ALL)
      Eventually, the attribute of file /etc/sudoers should be changed back to read-only
    # chmod 0440 /etc/sudoers
   And then use the same approach in the /etc/hosts to add the next ordinary users allowed to use sudo in linux

(2) $ Sudo mkdir/home/linux/crosstool/downloads

    And put a variety of kits to the packet of downloads as following

Gcc-3.4.5.tar.gz

Glibc-2.3.6.tar.gz

Linux-2.6.14tar.gz

Crosstool-0.43.tar.gz

Binutils-2.15.tar.gz

Glibc-linuxthreads-2.3.3.tar.gz

Linux-libc-headers-2.6.12.0.tar.bz2

Bison_13a2.3.dfsg-4build1_i386.deb

Flex_2.5.33-10build1_i386.deb

M4_1.4.8-1build1_i386.deb



(3) Install bison, flex software
    only super user can install bison and flex so:

$su

#dpkg –I /home/linux/downloads/ M4_1.4.8-1build1_i386.deb

#dpkg –I /home/linux/downloads/Flex_2.5.33-10build1_i386.deb

#dpkg –I
/home/linux/downloads/ Bison_13a2.3.dfsg-4build1_i386.deb

#su linux(change back to linux user)

 

(4) tar the softpacket and take an insight into the important script files.

   $cd downloads

   $tar –zxvf crosstool-0.43.tar.gz

   $cd crosstool-0.43

   I choose demo-arm-softfloat.sh, and create a cross tool chain which support the softfloat

(5) $vim demo-arm-softfloat.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=/opt/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 arm-softfloat.dat gcc-2.95.3-glibc-2.1.3.dat’sh all.sh--notest

#eval ‘cat arm-softfloat.dat gcc-2.95.3-glibc-2.2.2.dat’sh all.sh--notest

#eval ‘cat arm-softfloat.dat gcc-2.95.3-glibc-2.2.5.dat’sh all.sh--notest

#eval ‘cat arm-softfloat.dat gcc-3.2.3-glibc-2.2.5.dat’sh all.sh--notest

#eval ‘cat arm-softfloat.dat gcc-3.2.3-glibc-2.3.2.dat’sh all.sh--notest

#eval ‘cat arm-softfloat.dat gcc-3.2.3-glibc-2.3.2.dat’sh all.sh--notest

#eval ‘cat arm-softfloat.dat gcc-3.3.6-glibc-2.2.2.dat’sh all.sh--notest

#eval ‘cat arm-softfloat.dat gcc-3.3.6-glibc-2.2.5.dat’sh all.sh--notest

#eval ‘cat arm-softfloat.dat gcc-3.3.6-glibc-2.1.3.dat’sh all.sh--notest

eval ‘cat arm-softfloat.dat gcc-3.4.5-glibc-2.3.6.dat’sh all.sh--notest
  //I choose this line to satisfy the need

echo Done

 

change TARBALLS_DIR into TARBALLS_DIR=/home/linux/downloads;

change RESULT_TOP into RESULT_TOP =/home/linux/crosstool

 

(6)$vim gcc-3.4.5-glibc-2.3.6.dat

BINUTILS_DIR=binutils-2.15

GCC_DIR=gcc-3.4.5

GLIBC_DIR=glibc-2.3.6

LINUX_DIR=linux-2.6.26.5

LINUX_SANITZED_HEADER_DIR=linux-libc-headers-2.6.12.0

GLIBCTHREADS_FILENAME=glibc-linuxthreads-2.3.6

 

(7)$./demo-arm-softfloat.sh

(waiting for about 30 minutes)

(8)$export PATH=$PATH:/home/linux/crosstool/gcc-3.4.5-glibc-2.3.6/arm-softfloat-linux-gnu/bin:

 

阅读(1794) | 评论(1) | 转发(0) |
给主人留下些什么吧!~~

chinaunix网友2010-04-10 16:31:51

安照你的方法制作支持softfloat的ARM交叉编译器,出现下面的错误。能帮我解决吗? 你制作好的,给我发一个行吗?wangdotnet@hotmail.com nwind-dw2.o libgcc/./unwind-dw2-fde-glibc.o libgcc/./unwind-sjlj.o libgcc/./gthr-gnat.o libgcc/./unwind-c.o libgcc/./_eprintf.o libgcc/./__gcc_bcmp.o *** buffer overflow detected ***: arm-softfloat-linux-ar terminated ======= Backtrace: ========= /lib/tls/i686/cmov/libc.so.6(__fortify_fail+0x48)[0x40110de8] /lib/tls/i686/cmov/libc.so.6[0x4010fe20] /lib/tls/i686/cmov/libc.so.6[0x4010f558] /lib/t