参考文档
http://blog.chinaunix.net/space.php?uid=20564848&do=blog&id=73976
http://bbs.sciencenet.cn/home.php?mod=space&uid=39626&do=blog&id=429538
===
gcc-core-4.3.2.tar.bz2 glibc-2.7.tar.bz2 gmp-4.2.4.tar.bz2
binutils-2.19.1a.tar.bz2 gcc-g++-4.3.2.tar.bz2 glibc-ports-2.7.tar.bz2 mpfr-3.0.0.zip
===
gcc -DHAVE_CONFIG_H -I. -I.././gas -I. -I. -I.././gas -I../bfd -I.././gas/config -I.././gas/../include -I.././gas/.. -I.././gas/../bfd -DLOCALEDIR="\"/home/ldm/buildarmlinuxgcc//share/locale\"" -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Werror -g -O2 -c .././gas/config/tc-arm.c
cc1: warnings being treated as errors
.././gas/config/tc-arm.c: In function ‘s_arm_unwind_save_mmxwr’:
.././gas/config/tc-arm.c:3459:4: error: format not a string literal and no format arguments
.././gas/config/tc-arm.c:3473:8: error: format not a string literal and no format arguments
.././gas/config/tc-arm.c: In function ‘s_arm_unwind_save_mmxwcg’:
.././gas/config/tc-arm.c:3591:4: error: format not a string literal and no format arguments
.././gas/config/tc-arm.c:3606:8: error: format not a string literal and no format arguments
.././gas/config/tc-arm.c: In function ‘s_arm_unwind_movsp’:
.././gas/config/tc-arm.c:3712:7: error: format not a string literal and no format arguments
make[4]: *** [tc-arm.o] 错误 1
===
gcc -DHAVE_CONFIG_H -I. -I.././gas -I. -I. -I.././gas -I../bfd -I.././gas/config -I.././gas/../include -I.././gas/.. -I.././gas/../bfd -DLOCALEDIR="\"/home/ldm/buildarmlinuxgcc//share/locale\"" -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Werror -g -O2 -c .././gas/config/tc-arm.c
cc1: warnings being treated as errors
.././gas/config/tc-arm.c: In function ‘parse_operands’:
.././gas/config/tc-arm.c:1791:27: error: ‘firsttype$defined’ may be used uninitialized in this function
.././gas/config/tc-arm.c:1791:27: error: ‘firsttype$index’ may be used uninitialized in this function
make[4]: *** [tc-arm.o] 错误 1
===
修改gas/Makefile, 去掉-Werror
===
我的配置命令是
./configure --target=arm-linux --prefix=/home/ldm/buildarmlinuxgcc/
执行sudo make all install后,之前只有cross_build和cross_source两个目录
===
ldm@ldm-TOP2:~/buildarmlinuxgcc/cross_source/binutils-2.19.1$ ll ../../
总用量 40
drwxr-xr-x 10 ldm ldm 4096 2011-09-08 21:26 ./
drwxr-xr-x 62 ldm ldm 4096 2011-09-08 21:22 ../
drwxr-xr-x 4 root root 4096 2011-09-08 21:26 arm-linux/
drwxr-xr-x 2 root root 4096 2011-09-08 21:26 bin/
drwxr-xr-x 2 ldm ldm 4096 2011-09-08 20:41 cross_build/
drwxr-xr-x 3 ldm ldm 4096 2011-09-08 20:42 cross_source/
drwxr-xr-x 2 root root 4096 2011-09-08 21:26 info/
drwxr-xr-x 2 root root 4096 2011-09-08 21:26 lib/
drwxr-xr-x 3 root root 4096 2011-09-08 21:26 man/
drwxr-xr-x 3 root root 4096 2011-09-08 21:26 share/
===
tar -jxvf gcc-core-4.3.2.tar.bz2
tar -jxvf gmp-4.2.4.tar.bz2
ldm@ldm-TOP2:~/buildarmlinuxgcc/cross_source$ unzip mpfr-3.0.0.zip
mv mpfr-3.0.0 gcc-4.3.2/mpfr
vim gcc-4.3.2/gcc/config/arm/t-linux
TARGET_LIBGCC2_CFLAGS = 增加操作参数 -Dinhibit_libc -D__gthr_posix_h
../configure --target=arm-linux --prefix=/home/ldm/buildarmlinuxgcc/ --disable-threads --disable-shared --enable-languages=c --disable-libmudflap --disable-libssp
make all
===
checking for gmp internal files... configure: error: header files gmp-impl.h and longlong.h not found
make[1]: *** [configure-mpfr] 错误 1
make[1]:正在离开目录 `/home/ldm/buildarmlinuxgcc/cross_source/gcc-4.3.2/build'
make: *** [all] 错误 2
===
换mpfr-2.4.2
===
checking for library containing strerror... configure: error: Link tests are not allowed after GCC_NO_EXECUTABLES.
make[1]: *** [configure-target-libiberty] 错误 1
make[1]:正在离开目录 `/home/ldm/buildarmlinuxgcc/cross_source/gcc-4.3.2/build'
make: *** [all] 错误 2
===
../configure --target=arm-linux --prefix=/home/ldm/buildarmlinuxgcc/ --disable-nls --disable-shared --disable-multilib --disable-decimal-float --disable-threads --disable-libmudflap --disable-libssp --disable-libgomp --disable-libquadmath --disable-target-libiberty --disable-target-zlib --enable-languages=c --without-ppl --without-cloog
===
这回编译没报错
sudo make install
~/buildarmlinuxgcc多了两个目录 libexec 和include
阅读(11633) | 评论(0) | 转发(1) |