gpt4 book ai didi

linux - 编译 libgcc xgcc 错误

转载 作者:IT王子 更新时间:2023-10-29 00:09:58 26 4
gpt4 key购买 nike

我正在尝试安装交叉编译器,this tutorial ,当我想制作 libgcc 时,我只是把 make all-target-libgcc在我的终端。这会抛出错误

checking whether ln -s works... yes
checking for i586-elf-gcc... /usr/src/build-gcc/./gcc/xgcc -B/usr/src/build-gcc/./gcc/ -B/usr/local/cross/i586-elf/bin/ -B/usr/local/cross/i586-elf/lib/ -isystem /usr/local/cross/i586-elf/include -isystem /usr/local/cross/i586-elf/sys-include
checking for suffix of object files... configure: error: in `/usr/src/build-gcc/i586-elf/libgcc':
configure: error: cannot compute suffix of object files: cannot compile
See `config.log' for more details.
make: *** [configure-target-libgcc] Error 1

我在config.log中找到

Target: i586-elf
Configured with: ../gcc-4.8.0/configure --target=i586-elf --prefix=/usr/local/cross -- disable-nls --enable-languages=c,c++ --without-headers : (reconfigured) ../gcc-4.8.0/configure --target=i586-elf --prefix=/usr/local/cross --disable-nls --enable-languages=c,c++ --without-headers : (reconfigured) ../gcc-4.8.0/configure --target=i586-elf --prefix=/usr/local/cross --disable-nls --enable-languages=c,c++ --without-headers
Thread model: single
gcc version 4.8.0 (GCC)
configure:3358: $? = 0
configure:3347: /usr/src/build-gcc/./gcc/xgcc -B/usr/src/build-gcc/./gcc/ - B/usr/local/cross/i586-elf/bin/ -B/usr/local/cross/i586-elf/lib/ -isystem /usr/local/cross/i586-elf/include -isystem /usr/local/cross/i586-elf/sys-include -V >&5
xgcc: error: unrecognized command line option '-V'
xgcc: fatal error: no input files

事实上 xgcc 没有 '-V' 选项。我正在寻找如何编译 libgcc 的方法。

提前致谢

最佳答案

这就是问题所在:在您尝试按照您的描述构建 libgcc 之前,您构建了一个极端的准系统交叉编译器。现在,configure 脚本运行的部分标准测试是测试编译器,看它是否会在正常条件下生成工作的可执行文件。你的基本编译器不能。幸运的是,对于 libgcc,您不需要生成可执行文件,只需生成一个静态库 libgcc.a。问题是愚蠢的 GNU autoconf 生成的脚本没有意识到这一点。

我遇到了同样的问题并设计了一个非常丑陋的解决方法。您需要在 gcc 源目录中注释掉 libgcc/configure 文件的一部分。这是我为我的版本注释掉的部分;做一些类似于你的事情:

第 3484 行:

{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
$as_echo "$ac_file" >&6; }
# BEGIN PHILLIP EDIT
# if test -z "$ac_file"; then :
# $as_echo "$as_me: failed program was:" >&5
# sed 's/^/| /' conftest.$ac_ext >&5

# { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
# $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
# { as_fn_set_status 77
# as_fn_error "C compiler cannot create executables
# See \`config.log' for more details." "$LINENO" 5; }; }
# fi
ac_file='a.out'
# END PHILLIP EDIT
ac_exeext=$ac_cv_exeext

希望这对您有所帮助。

关于linux - 编译 libgcc xgcc 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16076660/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com