星期一, 10月 17, 2005

Build Cross Toolchain for ARM - Trial 3 - Cross Toolchain success

繼續,上次build cross toolchain,改用gcc-3.3似乎OK。
但是build到gcc時,出現compiler error ! Q_Q...
猜測大概是使用unstable的關係,
重新install debain,使用stable.
$gcc -v
gcc version 3.3.5 (Debian 1:3.3.5-13)


需要sudo : aptitude install sudo.
修改sudoer : ref 前一篇
wget http://kegel.com/crosstool/crosstool-0.38.tar.gz
unpack,follow doc/crosstool-howto.doc動作,create /opt/crosstool, chown.
開始
$sh demo-arm.sh
出現
tar: bzip2: Cannot exec: No such file or diectory
是沒裝bzip2的關係。
$sudo aptitude install bzip2
繼續...把build log copy一份到~/corss.txt
$sh demo-arm.sh 2>&1 | tee ~/cross.txt
10:16開始...10:54 結束.. Error : 和當次build時一樣。
在" Build final gcc " Stage. make all中 libiberty 目錄,使用build好的xgcc build cp-demangle.c時發生,log:
/home/charles/crosstool-0.38/build/arm- unknown-linux-gnu/gcc-4.1-20050709-glibc-2.3
.2/gcc-4.1-20050709/libiberty/regex.c: In function 'xre_comp':
/home/charles/crosstool-0.38/build/arm-unknown-linux-gnu/gcc-4.1-20050709-glibc-2.3.
2/gcc-4.1-20050709/libiberty/regex.c:7817: warning: return discards qualifiers from
pointer target type
if [ x"-fPIC" != x ]; then /home/charles/crosstool-0.38/build/arm-unknown-linux-gnu/
gcc-4.1-20050709-glibc-2.3.2/build-gcc/./gcc/xgcc -B/home/charles/crosstool-0.38/bui
ld/arm-unknown-linux-gnu/gcc-4.1-20050709-glibc-2.3.2/build-gcc/./gcc/ -B/opt/crosst
ool/gcc-4.1-20050709-glibc-2.3.2/arm-unknown-linux-gnu/arm-unknown-linux-gnu/bin/ -B
/opt/crosstool/gcc-4.1-20050709-glibc-2.3.2/arm-unknown-linux-gnu/arm-unknown-linux-
gnu/lib/ -isystem /opt/crosstool/gcc-4.1-20050709-glibc-2.3.2/arm-unknown-linux-gnu/
arm-unknown-linux-gnu/include -isystem /opt/crosstool/gcc-4.1-20050709-glibc-2.3.2/a
rm-unknown-linux-gnu/arm-unknown-linux-gnu/sys-include -c -DHAVE_CONFIG_H -O2 -g -O2 -I. -I/home/charles/crosstool-0.38/build/arm-unknown-linux-gnu/gcc-4.1-20050709-glibc-2.3.2/gcc-4.1-20050709/libiberty/../include -W -Wall -pedantic -Wwrite-strings -Wstrict-prototypes -fPIC /home/charles/crosstool-0.38/build/arm-unknown-linux-gnu/gcc-4.1-20050709-glibc-2.3.2/gcc-4.1-20050709/libiberty/cplus-dem.c -o pic/cplus-dem.o; else true; fi
/home/charles/crosstool-0.38/build/arm-unknown-linux-gnu/gcc-4.1-20050709-glibc-2.3.
2/build-gcc/./gcc/xgcc -B/home/charles/crosstool-0.38/build/arm-unknown-linux-gnu/gc
c-4.1-20050709-glibc-2.3.2/build-gcc/./gcc/ -B/opt/crosstool/gcc-4.1-20050709-glibc-
2.3.2/arm-unknown-linux-gnu/arm-unknown-linux-gnu/bin/ -B/opt/crosstool/gcc-4.1-2005
0709-glibc-2.3.2/arm-unknown-linux-gnu/arm-unknown-linux-gnu/lib/ -isystem /opt/cros
stool/gcc-4.1-20050709-glibc-2.3.2/arm-unknown-linux-gnu/arm-unknown-linux-gnu/inclu
de -isystem /opt/crosstool/gcc-4.1-20050709-glibc-2.3.2/arm-unknown-linux-gnu/arm-un
known-linux-gnu/sys-include -c -DHAVE_CONFIG_H -O2 -g -O2 -I. -I/home/charles/cross
tool-0.38/build/arm-unknown-linux-gnu/gcc-4.1-20050709-glibc-2.3.2/gcc-4.1-20050709/
libiberty/../include -W -Wall -pedantic -Wwrite-strings -Wstrict-prototypes /home/c
harles/crosstool-0.38/build/arm-unknown-linux-gnu/gcc-4.1-20050709-glibc-2.3.2/gcc-4
.1-20050709/libiberty/cplus-dem.c -o cplus-dem.o
if [ x"-fPIC" != x ]; then /home/charles/crosstool-0.38/build/arm-unknown-linux-gnu/
gcc-4.1-20050709-glibc-2.3.2/build-gcc/./gcc/xgcc -B/home/charles/crosstool-0.38/bui
ld/arm-unknown-linux-gnu/gcc-4.1-20050709-glibc-2.3.2/build-gcc/./gcc/ -B/opt/crosst
ool/gcc-4.1-20050709-glibc-2.3.2/arm-unknown-linux-gnu/arm-unknown-linux-gnu/bin/ -B
/opt/crosstool/gcc-4.1-20050709-glibc-2.3.2/arm-unknown-linux-gnu/arm-unknown-linux-
gnu/lib/ -isystem /opt/crosstool/gcc-4.1-20050709-glibc-2.3.2/arm-unknown-linux-gnu/
arm-unknown-linux-gnu/include -isystem /opt/crosstool/gcc-4.1-20050709-glibc-2.3.2/a
rm-unknown-linux-gnu/arm-unknown-linux-gnu/sys-include -c -DHAVE_CONFIG_H -O2 -g -O2 -I. -I/home/charles/crosstool-0.38/build/arm-unknown-linux-gnu/gcc-4.1-20050709-glibc-2.3.2/gcc-4.1-20050709/libiberty/../include -W -Wall -pedantic -Wwrite-strings -Wstrict-prototypes -fPIC /home/charles/crosstool-0.38/build/arm-unknown-linux-gnu/gcc-4.1-20050709-glibc-2.3.2/gcc-4.1-20050709/libiberty/cp-demangle.c -o pic/cp-demangle.o; else true; fi
/home/charles/crosstool-0.38/build/arm-unknown-linux-gnu/gcc-4.1-20050709-glibc-2.3.
2/gcc-4.1-20050709/libiberty/cp-demangle.c: In function 'd_print_comp':
/home/charles/crosstool-0.38/build/arm-unknown-linux-gnu/gcc-4.1-20050709-glibc-2.3.
2/gcc-4.1-20050709/libiberty/cp-demangle.c:3342: internal compiler error: in loop_gi
vs_rescan, at loop.c:5517
Please submit a full bug report,
with preprocessed source if appropriate.
See for instructions.
make[1]: *** [cp-demangle.o] Error 1
make[1]: Leaving directory `/home/charles/crosstool-0.38/build/arm-unknown-linux-gnu/
gcc-4.1-20050709-glibc-2.3.2/build-gcc/arm-unknown-linux-gnu/libiberty'
make: *** [all-target-libiberty] Error 2
Google一下,這是很多人都發生的問題 (應該先看一下的),reference 這一頁。有test build statu,選一個OK的,latest one :
gcc-4.0.1
cgcc-3.3.6
glibc-2.3.2
binutils-2.16.1
linux-2.6.11.3
hdrs-2.6.11.2
但是dem-arm裡沒有
crosstool 中gcc.dat有更新的0716.修改demo-arm.sh,改用20050716,再執行一次 11:35...download 0716 snapshoot... (到ftp://gcc.gnu.org/pub/gcc/snapshot去看,可以看到其實gcc 最新是1015)。....12:20開始build.....12:55 OK! Success !!!!!!
所以只要用修改demo-arm.sh,用
 eval `cat arm.dat gcc-4.1-20050716-glibc-2.3.2-hdrs-2.6.11.2.dat`  sh all.sh --notest
就可以。

<其他>
follow getandpatch.sh,發現自動fetch source的code,到gcc.gnu.org去拿source。由***.dat定義的version name去拿資料。
4.0 版snapshot後面會接上snapshot的日期:例如4.0-20051017
release的版本則會加一個小的版本號:例如4.0.1, 4.0.2
getandpath.sh 中,4.0版的gcc到prelease去拿,但是現在已經放在release下了。

沒有留言:

網誌存檔