Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2530618
  • 博文数量: 401
  • 博客积分: 12926
  • 博客等级: 上将
  • 技术积分: 4578
  • 用 户 组: 普通用户
  • 注册时间: 2009-02-22 14:51
文章分类

全部博文(401)

文章存档

2015年(16)

2014年(4)

2013年(12)

2012年(82)

2011年(98)

2010年(112)

2009年(77)

分类: C/C++

2012-03-01 21:52:41

参考文档
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
阅读(8835) | 评论(0) | 转发(1) |
给主人留下些什么吧!~~