LinuxSir.cn,穿越时空的Linuxsir!

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

关于《手把手教你源代码制作龙芯64位系统 2.0预览版 》

[复制链接]
发表于 2009-3-2 23:31:42 | 显示全部楼层 |阅读模式
按照冲天飞豹的大作《手把手教你源代码制作龙芯64位系统 2.0预览版 》http://blog.chinaunix.net/u/13265/showart_1193259.html在制作工具链的第二步Binutils交叉工具,在configure时,config.log中出现如下的错误:
configure:3630: gcc -c -g -O2  conftest.c >&5
conftest.c:2: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'me'
configure:3636: $? = 1
configure: failed program was:
| #ifndef __cplusplus
|   choke me
| #endif在livecd,rhel5,centos上试过了,都是这样,问了别人,说是gcc中用来编译c中内嵌的汇编代码时,汇编代码中的最后一个分号引起的,不知道这个会不会影响后续的工作,补充一个,几乎每个tarball在进行configure时都会报这样的错误,另外还有一个错误也是雷打不动的会出现
configure:4082: g++ -c -g -O2  conftest.cc >&5
conftest.cc: In function 'int main()':
conftest.cc:13: error: 'exit' was not declared in this scope
configure:4088: $? = 1
configure: failed program was:
| /* confdefs.h.  */
|
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| /* end confdefs.h.  */
|
| int
| main ()
| {
| exit (42);
|   ;
|   return 0;
| }
在第三步--目标系统glibc头文件中make install-headers
也会报如下的错误:

In file included from ./posix/sys/types.h:31,
                 from include/sys/types.h:1,
                 from misc/sys/uio.h:24,
                 from <stdin>:3:
./bits/types.h:129:3: error: #error
迷茫,请各位指点一下
 楼主| 发表于 2009-3-5 23:43:35 | 显示全部楼层

关于《手把手教你源代码制作龙芯64位系统 2.0预览版 》

有哪位按照按照冲天飞豹的大作《手把手教你源代码制作龙芯64位系统 2.10预览版 》成功的为龙芯定制过操作系统的,交流一下吧,在下有几个问题想请教一下
回复 支持 反对

使用道具 举报

发表于 2009-3-6 09:00:02 | 显示全部楼层
binutils使用的什么版本?使用的configure参数是什么?
回复 支持 反对

使用道具 举报

 楼主| 发表于 2009-3-8 23:54:50 | 显示全部楼层
binutils用的是binutils-2.18.50.tar.bz2,完全是照着帖子上敲得,哎,郁闷?
configure是这样的,跟帖子上一模一样
CC="gcc" AR="ar" ../binutils-2.18.50/configure --prefix=${TARGET_DIR}/cross-tools \
                --build=${CROSS_HOST} --target=${CROSS_TARGET} --host=${CROSS_HOST} \
                --enable-64-bit-bfd --with-sysroot=${TARGET_DIR}  \
                --disable-nls --enable-shared
回复 支持 反对

使用道具 举报

发表于 2009-3-31 10:47:49 | 显示全部楼层
我正在做CLFS,刚刚也遇到了和楼主一模一样的错误,export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/cross-tools/lib解决了,此时/cross-tools/lib下只有gmp与mpfr的库.所以我想GCC 在configure时加上--with-mpfr-lib和--with-gmp-lib参数应该才完整.
回复 支持 反对

使用道具 举报

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

本版积分规则

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