免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1882 | 回复: 0
打印 上一主题 下一主题

自己动手编译一次arm-linux4.3.2 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2011-12-23 02:09 |只看该作者 |倒序浏览
参考文档
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
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP