(这绝对是一个好blog)
整个过程是按照上面的做的,但会出现一个问题:
checking for a BSD-compatible install... /usr/bin/install -c
checking whether ln -s works... yes
checking for pwd... /bin/pwd
checking for arm-9tdmi-linux-gnu-gcc... gcc
checking version of gcc... 4.3.2, bad
checking for gnumake... no
checking for gmake... gmake
checking version of gmake... 3.81, ok
configure: error:
*** These critical programs are missing or too old: gcc
*** Check the INSTALL file for required versions.
然后找到下面的网页:
crosstool的目录中通常包含了我们常见问题的patch。
进入patches/glibc-2.3.2 修改/glibc-2.3.3-allow-gcc-4.0-configure.patch
将
+ 3.[2-9]*|4.[01]*)
改为
+ 3.[2-9]*|4.*)
不知道为什么要这样做。。。
后来将内核换成2.6.30.4,也是一次编译成功。。。不过还不知道能不能用。。。
成功后的信息:
kernel 2.6.22
......
+ /home/juruqiang/work/cross/crosstool/gcc-4.1.0-glibc-2.3.2/arm-9tdmi-linux-gnu/bin/arm-9tdmi-linux-gnu-gcc -static hello.c -o arm-9tdmi-linux-gnu-hello-static
+ /home/juruqiang/work/cross/crosstool/gcc-4.1.0-glibc-2.3.2/arm-9tdmi-linux-gnu/bin/arm-9tdmi-linux-gnu-gcc hello.c -o arm-9tdmi-linux-gnu-hello
+ test -x /home/juruqiang/work/cross/crosstool/gcc-4.1.0-glibc-2.3.2/arm-9tdmi-linux-gnu/bin/arm-9tdmi-linux-gnu-g++
+ cat
+ /home/juruqiang/work/cross/crosstool/gcc-4.1.0-glibc-2.3.2/arm-9tdmi-linux-gnu/bin/arm-9tdmi-linux-gnu-g++ -static hello2.cc -o arm-9tdmi-linux-gnu-hello2-static
+ /home/juruqiang/work/cross/crosstool/gcc-4.1.0-glibc-2.3.2/arm-9tdmi-linux-gnu/bin/arm-9tdmi-linux-gnu-g++ hello2.cc -o arm-9tdmi-linux-gnu-hello2
+ echo testhello: C compiler can in fact build a trivial program.
testhello: C compiler can in fact build a trivial program.
+ test '' = 1
+ test '' = 1
+ test '' = 1
+ test 1 = ''
+ echo Done.
Done.
[juruqiang@jonny arm-9tdmi-linux-gnu]$ ls
arm-9tdmi-linux-gnu arm-9tdmi-linux-gnu.crosstoolconfig.txt bin distributed include info lib libexec man share tmp
阅读(746) | 评论(0) | 转发(0) |