LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1271|回复: 1

编译arm-linux-gcc遇到问题, 求救~~~~~~~~~~~~~

[复制链接]
发表于 2005-5-5 23:09:35 | 显示全部楼层 |阅读模式
大家好, 又是我, 今天照着<Building embedded linux system>这本书第四章的内容编译工具链, 在编译GCC的时候遇到问题, 过程是这样的:
我下载了这些文件:
binutils 2.10.1
gcc 2.95.3
glibc 2.1.3
glibc-linuxthreads 2.1.3
在编译GCC的时候执行了../configure --target=$TARGET --prefix=${PREFIX} --without-headers --with-newlib --enable-language=c
然后在make all-gcc的时候出现如下错误:
decl.c: In function `start_struct':

decl.c:4451: error: argument "code" doesn't match prototype

ch-tree.h:736: error: prototype declaration

make[2]: *** [decl.o] Error 1

make[2]: Leaving directory `/root/armlinux/build-tools/gcc-2.95.3/gcc/ch'

make[1]: *** [cc1chill] Error 2

make[1]: Leaving directory `/root/armlinux/build-tools/gcc-2.95.3/gcc'

make: *** [all-gcc] Error 2

不晓得出了什么问题, 请大家帮帮我, 谢谢
 楼主| 发表于 2005-5-6 12:17:52 | 显示全部楼层
我搞定了^^
原来在第一次编译GCC的时候要修改gcc/config/arm/t-linux这个文件
参考资料---------------------------------
The -Dinhibit_libc hack
Upon installing a successful build of gcc, some headers will get put in the target's include directory. However, if you are building a (cross) compiler for the very first time, or with a different set of paths, it won't have these headers to hand. For the first time you build a gcc then, you can follow through these steps to fix the problem:


Edit gcc/config/arm/t-linux

and add

-Dinhibit_libc and -D__gthr_posix_h

to:

TARGET_LIBGCC2_CFLAGS.

That is, change the line that looks like:

TARGET_LIBGCC2_CFLAGS = -fomit-frame-pointer -fPIC

to:

TARGET_LIBGCC2_CFLAGS = -fomit-frame-pointer -fPIC -Dinhibit_libc -D__gthr_posix_h.

Re-run configure, but supplying the extra parameter --disable-threads.
[摘自 http://www.aleph1.co.uk]
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表