构建 gcc 引发错误:Makefile:1087:目标“全部”的配方失败:*** [全部]错误 2

问题描述 投票:0回答:1

我使用以下代码

我 git clone gcc-13.2.0 并运行 contrib/download_preventions

./configure --prefix=$(pwd)/dist --disable-multilib --enable-libstdcxx-backtrace=yes
make -j$(nproc)

它引发错误:

Makefile:1087: recipe for target 'all' failed
make: *** [all] Error 2

我发现 Makefile:1087 是:

all:
    [ -f stage_final ] || echo stage3 > stage_final # here is Makefile:1087
    @r=`${PWD_COMMAND}`; export r; \
    s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
    $(MAKE) $(RECURSE_FLAGS_TO_PASS) `cat stage_final`-bubble
    @: $(MAKE); $(unstage)
    +@r=`${PWD_COMMAND}`; export r; \
    s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
    if [ -f stage_last ]; then \
      TFLAGS="$(STAGE$(shell test ! -f stage_last || sed s,^stage,, stage_last)_TFLAGS)"; \
      $(MAKE) $(TARGET_FLAGS_TO_PASS) all-host all-target; \
    else \
      $(MAKE) $(RECURSE_FLAGS_TO_PASS) \
        $(PGO_BUILD_GEN_FLAGS_TO_PASS) all-host all-target \
        ; \
    fi \
    && :

如何让 gcc 构建通过,我在 stackoverflow 中发现了很多类似的问题,但无法修复我的错误

c++ linux gcc
1个回答
0
投票

导致此错误的原因有很多

默认“make”合并stdout和stderr,因此很难在长输出中找到错误

使用以下 cli 拆分 stdout 和 stderr

make -j$(nproc) > /tmp/out.log 2> /tmp/err.log

查看 err.log 了解错误详细信息

© www.soinside.com 2019 - 2024. All rights reserved.