QQ登录

只需一步,快速开始

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 1475|回复: 5

LFS GCC 4.6.1 编译失败。。。(已解决)

[复制链接]
发表于 2011-10-19 11:01:02 | 显示全部楼层 |阅读模式
这些提示我看不出可以调整解决的地方
gcc version 4.6.1 (GCC)
configure:3039: $? = 0
configure:3028: /mnt/lfs/tools/sources/build/gcc-build/./gcc/xgcc -B/mnt/lfs/tools/sources/build/gcc-build/./gcc/ -B/tools/i686-lfs-linux-gnu/bin/ -B/tools/i686-lfs-linux-gnu/lib/ -isystem /tools/i686-lfs-linux-gnu/include -isystem /tools/i686-lfs-linux-gnu/sys-include    -V >&5
xgcc: error: unrecognized option '-V'
xgcc: fatal error: no input files
compilation terminated.
configure:3039: $? = 1
configure:3028: /mnt/lfs/tools/sources/build/gcc-build/./gcc/xgcc -B/mnt/lfs/tools/sources/build/gcc-build/./gcc/ -B/tools/i686-lfs-linux-gnu/bin/ -B/tools/i686-lfs-linux-gnu/lib/ -isystem /tools/i686-lfs-linux-gnu/include -isystem /tools/i686-lfs-linux-gnu/sys-include    -qversion >&5
xgcc: error: unrecognized option '-qversion'
xgcc: fatal error: no input files
compilation terminated.
configure:3039: $? = 1
configure:3055: /mnt/lfs/tools/sources/build/gcc-build/./gcc/xgcc -B/mnt/lfs/tools/sources/build/gcc-build/./gcc/ -B/tools/i686-lfs-linux-gnu/bin/ -B/tools/i686-lfs-linux-gnu/lib/ -isystem /tools/i686-lfs-linux-gnu/include -isystem /tools/i686-lfs-linux-gnu/sys-include    -o conftest -g -O2   conftest.c  >&5
/mnt/lfs/tools/sources/build/gcc-build/./gcc/as: line 87: exec: --: invalid option
exec: usage: exec [-cl] [-a name] [command [arguments ...]] [redirection ...]
configure:3058: $? = 1
configure:3246: checking for suffix of object files
configure:3268: /mnt/lfs/tools/sources/build/gcc-build/./gcc/xgcc -B/mnt/lfs/tools/sources/build/gcc-build/./gcc/ -B/tools/i686-lfs-linux-gnu/bin/ -B/tools/i686-lfs-linux-gnu/lib/ -isystem /tools/i686-lfs-linux-gnu/include -isystem /tools/i686-lfs-linux-gnu/sys-include    -c -g -O2  conftest.c >&5
/mnt/lfs/tools/sources/build/gcc-build/./gcc/as: line 87: exec: --: invalid option
exec: usage: exec [-cl] [-a name] [command [arguments ...]] [redirection ...]
configure:3272: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "GNU C Runtime Library"
| #define PACKAGE_TARNAME "libgcc"
| #define PACKAGE_VERSION "1.0"
| #define PACKAGE_STRING "GNU C Runtime Library 1.0"
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL "http://www.gnu.org/software/libgcc/"
| /* end confdefs.h.  */
|
| int
| main ()
| {
|
|   ;
|   return 0;
| }
configure:3286: error: in `/mnt/lfs/tools/sources/build/gcc-build/i686-lfs-linux-gnu/libgcc':
configure:3289: error: cannot compute suffix of object files: cannot compile
See `config.log' for more details.

找到原因了,原来差一步没有声明 gmp 5.0.2 的 lib 位置,依赖 gmp 编译的 mpfr mpc 变成从 MGC 环境下 gmp 4.2.4 下编译出的 mpfr mpc 是不能用于 LFS 环境下的 gcc 编译。难怪乎 LFS 编译要尽可能踢除外界环境。

[ 本帖最后由 haulm 于 2011-10-19 23:28 编辑 ]
发表于 2011-10-19 13:09:07 | 显示全部楼层
See `config.log' for more details.
回复

使用道具 举报

 楼主| 发表于 2011-10-19 23:22:09 | 显示全部楼层
no see config.log,看不出问题的。
讨论一下LFS GCC4.5 pass1 pass2 的编译过程那篇文章我重新修改过了,问题就出在
在 编译GCC之前准备环节中以及后面的几个组件编译都需要增加 LD_LIBRARY_PATH 的定义,否则经常出现编译中断。
这个自己写的备注,半年后自己也没看懂。。。,也就是说在 GCC 编译前 mpfr mpc 的编译也要声明 LD_LIBRARY_PATH,指定 gmp 的位置,否则只要有一步没有指明,编译 gcc 时就和系统原有的编译器依赖相混乱了。
回复

使用道具 举报

 楼主| 发表于 2011-10-20 00:57:07 | 显示全部楼层
lfs:/mnt/lfs/sources/build/gcc-build$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/mnt/lfs/tools/bin/../libexec/gcc/i686-pc-linux-gnu/4.6.1/lto-wrapper
Target: i686-pc-linux-gnu
Configured with: ../gcc-4.6.1/configure --prefix=/tools --with-local-prefix=/tools --enable-clocale=gnu --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-languages=c,c++ --disable-libstdcxx-pch --disable-multilib --disable-bootstrap --disable-libgomp --without-ppl --without-cloog --with-gmp=/tools --with-mpfr=/tools --with-mpc=/tools
Thread model: posix
gcc version 4.6.1 (GCC)
lfs:/mnt/lfs/sources/build/gcc-build$
回复

使用道具 举报

发表于 2011-10-20 09:11:45 | 显示全部楼层
原帖由 haulm 于 2011-10-19 11:22 PM 发表
no see config.log,看不出问题的。
讨论一下LFS GCC4.5 pass1 pass2 的编译过程那篇文章我重新修改过了,问题就出在
在 编译GCC之前准备环节中以及后面的几个组件编译都需要增加 LD_LIBRARY_PATH 的定义,否则经常出现编 ...

如果需要这个变量,证明你前面的编译过程有问题。
回复

使用道具 举报

 楼主| 发表于 2011-10-20 11:19:19 | 显示全部楼层
原帖由 jiangtao9999 于 2011-10-20 09:11 发表

如果需要这个变量,证明你前面的编译过程有问题。

前面的编译全部删除了,重新编译时认真看了之前的笔记,现在明白 LFS 编译不光是编译要用到的类库需要声明指定,连 libs 也需要指定才能正确编译。
回复

使用道具 举报

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

本版积分规则

GMT+8, 2024-5-23 12:16 , Processed in 0.073320 second(s), 16 queries .

© 2021 Powered by Discuz! X3.5.

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