Gcc编译“无法计算目标文件的后缀:无法编译". [英] Gcc compilation "cannot compute suffix of object files: cannot compile"

查看:379
本文介绍了Gcc编译“无法计算目标文件的后缀:无法编译".的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我实际上正在阅读LFS书籍(7.1版),但在第53页被阻止.尝试编译gcc时,我尝试了以下命令:

I'm actually reading the LFS book (version 7.1) and I'm blocked at page 53. Trying to compile gcc, I tried the following command:

./configure --target=$LFS_TGT --prefix=$LFS/build/gcc-build --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\
--with-mpfr-include=$LFS/source/mpfr/src
--with-mpfr-lib=$LFS/source/mpfr/src/.libs\
--with-gmp-include=/mnt/LFS/source/gmp\
--with-gmp-lib=/mnt/LFS/source/gmp/.libs\
--with-mpc-include=/mnt/LFS/source/mpc/src\
--with-mpc-lib=/mnt/LFS/source/mpc/src/.libs

运行gcc的配置脚本(当然我已经编译了mpfr,mpc和gmp). 但是一旦我启动:

to run the configure script of gcc (of course I already compiled mpfr, mpc and gmp as well). But once I launch:

make -j4

我收到以下错误:

checking for suffix of object files... configure: error: in `/mnt/LFS/source/gcc-4.6.2/x86_64-lfs-linux-gnu/libgcc':
configure: error: cannot compute suffix of object files: cannot compile
See `config.log' for more details.
make[1]: *** [configure-target-libgcc] Error 1

我尝试用Google搜索它,并尝试了找到的解决方案,但没有任何效果.有人知道我为什么会收到此错误吗?

I tried to google for it and tried the solutions I found but nothing worked. Does anyone know why I get this error?

推荐答案

当测试程序尝试针对libmpc/libmpfr/libgmp进行链接时,此问题是由动态链接库路径问题引起的.

This issue is caused by dyanmic link library path issue when the test programs try to link against libmpc/libmpfr/libgmp.

在环境变量后面追加允许 ld 链接到正确的 so 文件:

Append below environment variable to allow ld link against the correct so file:

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/path/to/mpc/lib/

然后尝试再次构建gcc.

Then try build gcc again.

这篇关于Gcc编译“无法计算目标文件的后缀:无法编译".的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆