gcc产生错误“无法计算目标文件的后缀:无法编译”

时间:2019-09-02 04:19:37

标签: gcc

我需要使用具有h8300架构的交叉编译选项来构建gcc,但出现以下错误。我缺少要安装的东西吗?

安装过程和错误消息。

# wget http://ftp.tsukuba.wide.ad.jp/software/gcc/releases/gcc-8.2.0/gcc-8.2.0.tar.gz
# wget http://ftp.tsukuba.wide.ad.jp/software/gcc/releases/gcc-8.2.0/sha512.sum
# sha512sum --check sha512.sum
# tar xzfv gcc-8.2.0.tar.gz -C /usr/local/src
# cd /usr/local/src/gcc-8.2.0/
# ./contrib/download_prerequisites
# mkdir build
# cd build
# ../configure --target=h8300-elf --disable-nls --disable-threads --disable-shared --enable-languages=c --prefix=/usr/local
# make
checking for h8300-elf-gcc... /usr/local/src/gcc-8.2.0/build/./gcc/xgcc -B/usr/local/src/gcc-8.2.0/build/./gcc/ -B/usr/local/h8300-elf/bin/ -B/usr/local/h8300-elf/lib/ -isystem /usr/local/h8300-elf/include -isystem /usr/local/h8300-elf/sys-include
checking for suffix of object files... configure: error: in `/usr/local/src/gcc-8.2.0/build/h8300-elf/libgcc':
configure: error: cannot compute suffix of object files: cannot compile
See `config.log' for more details.
Makefile:13187: recipe for target 'configure-target-libgcc' failed
make[1]: *** [configure-target-libgcc] Error 1
make[1]: Leaving directory '/usr/local/src/gcc-8.2.0/build'
Makefile:891: recipe for target 'all' failed
make: *** [all] Error 2

我确认它可以与其他类似选项一起使用。

# ../configure --enable-languages=c,c++ --prefix=/usr/local --disable-bootstrap --disable-multilib

我的环境。 (在Mac上为Docker)

# uname -a
Linux 72adbd5c70d9 4.9.184-linuxkit #1 SMP Tue Jul 2 22:58:16 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

0 个答案:

没有答案