无法在 Ubuntu 20.04.4 LTS 上构建 gcc-core-4.1.2

无法在 Ubuntu 20.04.4 LTS 上构建 gcc-core-4.1.2

我无法在 Ubuntu 20.04.4 LTS 上编译 gcc-core-4.1.2。'make bootstrap' 失败,并显示

$ make bootstrap
make[1]: Entering directory '/home/user/Development/gcc-build-root/gcc-core-4.1.2.build/build-x86_64-unknown-linux-gnu/libiberty'
make[2]: Entering directory '/home/user/Development/gcc-build-root/gcc-core-4.1.2.build/build-x86_64-unknown-linux-gnu/libiberty/testsuite'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/home/user/Development/gcc-build-root/gcc-core-4.1.2.build/build-x86_64-unknown-linux-gnu/libiberty/testsuite'
make[1]: Leaving directory '/home/user/Development/gcc-build-root/gcc-core-4.1.2.build/build-x86_64-unknown-linux-gnu/libiberty'
make[1]: Entering directory '/home/user/Development/gcc-build-root/gcc-core-4.1.2.build/build-x86_64-unknown-linux-gnu/fixincludes'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/home/user/Development/gcc-build-root/gcc-core-4.1.2.build/build-x86_64-unknown-linux-gnu/fixincludes'
make[1]: Entering directory '/home/user/Development/gcc-build-root/gcc-core-4.1.2.build/intl'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/home/user/Development/gcc-build-root/gcc-core-4.1.2.build/intl'
make[1]: Entering directory '/home/user/Development/gcc-build-root/gcc-core-4.1.2.build/libiberty'
make[2]: Entering directory '/home/user/Development/gcc-build-root/gcc-core-4.1.2.build/libiberty/testsuite'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/home/user/Development/gcc-build-root/gcc-core-4.1.2.build/libiberty/testsuite'
make[1]: Leaving directory '/home/user/Development/gcc-build-root/gcc-core-4.1.2.build/libiberty'
make[1]: Entering directory '/home/user/Development/gcc-build-root/gcc-core-4.1.2.build/libcpp'
test -f config.h || (rm -f stamp-h1 && make stamp-h1)
make[1]: Leaving directory '/home/user/Development/gcc-build-root/gcc-core-4.1.2.build/libcpp'
Bootstrapping the compiler
make[1]: Entering directory '/home/user/Development/gcc-build-root/gcc-core-4.1.2.build/gcc'
make CC="gcc" libdir=/usr/local/lib LANGUAGES="c " \
        CFLAGS="-g -DENABLE_CHECKING -DENABLE_ASSERT_CHECKING" \
        MAKEINFO="makeinfo --split-size=5000000" MAKEINFOFLAGS="--no-split" \
        COVERAGE_FLAGS= OBJS-onestep="tree-chrec.o tree-scalar-evolution.o tree-data-ref.o tree-cfg.o tree-dfa.o tree-eh.o tree-ssa.o tree-optimize.o tree-gimple.o gimplify.o tree-pretty-print.o tree-into-ssa.o tree-outof-ssa.o tree-ssa-ccp.o tree-vn.o tree-ssa-uncprop.o tree-ssa-dce.o  tree-ssa-copy.o tree-nrv.o tree-ssa-copyrename.o tree-ssa-pre.o tree-ssa-live.o tree-ssa-operands.o tree-ssa-alias.o tree-ssa-phiopt.o tree-ssa-forwprop.o tree-nested.o tree-ssa-dse.o tree-ssa-dom.o domwalk.o tree-tailcall.o gimple-low.o tree-iterator.o tree-phinodes.o tree-ssanames.o tree-sra.o tree-complex.o tree-vect-generic.o tree-ssa-loop.o tree-ssa-loop-niter.o tree-ssa-loop-manip.o tree-ssa-threadupdate.o tree-vectorizer.o tree-vect-analyze.o tree-vect-transform.o tree-ssa-loop-ivcanon.o tree-ssa-propagate.o tree-ssa-address.o tree-ssa-math-opts.o tree-ssa-loop-ivopts.o tree-if-conv.o tree-ssa-loop-unswitch.o alias.o bb-reorder.o bitmap.o builtins.o caller-save.o calls.o cfg.o cfganal.o cfgbuild.o cfgcleanup.o cfglayout.o cfgloop.o cfgloopanal.o cfgloopmanip.o loop-init.o loop-unswitch.o loop-unroll.o cfgrtl.o combine.o conflict.o convert.o coverage.o cse.o cselib.o dbxout.o ddg.o tree-ssa-loop-ch.o loop-invariant.o tree-ssa-loop-im.o debug.o df.o diagnostic.o dojump.o dominance.o loop-doloop.o dwarf2asm.o dwarf2out.o emit-rtl.o except.o explow.o loop-iv.o expmed.o expr.o final.o flow.o fold-const.o function.o gcse.o genrtl.o ggc-common.o global.o graph.o gtype-desc.o haifa-sched.o hooks.o ifcvt.o insn-attrtab.o insn-emit.o insn-modes.o insn-extract.o insn-opinit.o insn-output.o insn-peep.o insn-recog.o integrate.o intl.o jump.o  langhooks.o lcm.o lists.o local-alloc.o loop.o mode-switching.o modulo-sched.o optabs.o options.o opts.o params.o postreload.o postreload-gcse.o predict.o insn-preds.o pointer-set.o print-rtl.o print-tree.o profile.o value-prof.o var-tracking.o real.o recog.o reg-stack.o regclass.o regmove.o regrename.o reload.o reload1.o reorg.o resource.o rtl.o rtlanal.o rtl-error.o sbitmap.o sched-deps.o sched-ebb.o sched-rgn.o sched-vis.o sdbout.o simplify-rtx.o sreal.o stmt.o stor-layout.o stringpool.o targhooks.o timevar.o toplev.o tracer.o tree.o tree-dump.o varasm.o varray.o vec.o version.o vmsdbgout.o xcoffout.o alloc-pool.o et-forest.o cfghooks.o bt-load.o pretty-print.o ggc-page.o web.o passes.o tree-profile.o rtlhooks.o cfgexpand.o lambda-mat.o lambda-trans.o        lambda-code.o tree-loop-linear.o tree-ssa-sink.o tree-vrp.o tree-stdarg.o tree-cfgcleanup.o tree-ssa-reassoc.o tree-ssa-structalias.o tree-object-size.o i386.o  host-linux.o tree-inline.o cgraph.o cgraphunit.o tree-nomudflap.o ipa.o ipa-inline.o ipa-utils.o ipa-reference.o ipa-pure-const.o ipa-type-escape.o ipa-prop.o ipa-cp.o"
make[2]: Entering directory '/home/user/Development/gcc-build-root/gcc-core-4.1.2.build/gcc'
gcc   -g -DENABLE_CHECKING -DENABLE_ASSERT_CHECKING -DIN_GCC   -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -pedantic -Wno-long-long -Wno-variadic-macros -Wold-style-definition -Wmissing-format-attribute    -DHAVE_CONFIG_H -I. -I. -I../../gcc-core-4.1.2/gcc -I../../gcc-core-4.1.2/gcc/. -I../../gcc-core-4.1.2/gcc/../include -I../../gcc-core-4.1.2/gcc/../libcpp/include     \
  -DTARGET_NAME=\"x86_64-unknown-linux-gnu\" \
  -c ../../gcc-core-4.1.2/gcc/toplev.c -o toplev.o
In file included from ../../gcc-core-4.1.2/gcc/toplev.c:31:
../../gcc-core-4.1.2/gcc/basic-block.h: In function ‘single_succ_edge’:
../../gcc-core-4.1.2/gcc/system.h:575:55: warning: ISO C does not support ‘__FUNCTION__’ predefined identifier [-Wpedantic]
    ((void)(!(EXPR) ? fancy_abort (__FILE__, __LINE__, __FUNCTION__), 0 : 0))
                                                       ^~~~~~~~~~~~
../../gcc-core-4.1.2/gcc/basic-block.h:620:3: note: in expansion of macro ‘gcc_assert’
   gcc_assert (single_succ_p (bb));
   ^~~~~~~~~~
In file included from ../../gcc-core-4.1.2/gcc/tree.h:28,
                 from ../../gcc-core-4.1.2/gcc/toplev.c:46:
../../gcc-core-4.1.2/gcc/vec.h:403:43: warning: ISO C does not support ‘__FUNCTION__’ predefined identifier [-Wpedantic]
 #define VEC_CHECK_INFO ,__FILE__,__LINE__,__FUNCTION__
                                           ^~~~~~~~~~~~
../../gcc-core-4.1.2/gcc/vec.h:175:62: note: in expansion of macro ‘VEC_CHECK_INFO’
 #define VEC_index(T,V,I) (VEC_OP(T,base,index)(VEC_BASE(V),I VEC_CHECK_INFO))
                                                              ^~~~~~~~~~~~~~
../../gcc-core-4.1.2/gcc/basic-block.h:596:27: note: in expansion of macro ‘VEC_index’
 #define EDGE_SUCC(bb,i)   VEC_index  (edge, (bb)->succs, (i))
                           ^~~~~~~~~
../../gcc-core-4.1.2/gcc/basic-block.h:621:10: note: in expansion of macro ‘EDGE_SUCC’
   return EDGE_SUCC (bb, 0);
          ^~~~~~~~~
In file included from ../../gcc-core-4.1.2/gcc/toplev.c:31:
../../gcc-core-4.1.2/gcc/basic-block.h: In function ‘single_pred_edge’:
../../gcc-core-4.1.2/gcc/system.h:575:55: warning: ISO C does not support ‘__FUNCTION__’ predefined identifier [-Wpedantic]
    ((void)(!(EXPR) ? fancy_abort (__FILE__, __LINE__, __FUNCTION__), 0 : 0))
                                                       ^~~~~~~~~~~~
../../gcc-core-4.1.2/gcc/basic-block.h:630:3: note: in expansion of macro ‘gcc_assert’
   gcc_assert (single_pred_p (bb));
   ^~~~~~~~~~
In file included from ../../gcc-core-4.1.2/gcc/tree.h:28,
                 from ../../gcc-core-4.1.2/gcc/toplev.c:46:
../../gcc-core-4.1.2/gcc/vec.h:403:43: warning: ISO C does not support ‘__FUNCTION__’ predefined identifier [-Wpedantic]
 #define VEC_CHECK_INFO ,__FILE__,__LINE__,__FUNCTION__
                                           ^~~~~~~~~~~~
../../gcc-core-4.1.2/gcc/vec.h:175:62: note: in expansion of macro ‘VEC_CHECK_INFO’
 #define VEC_index(T,V,I) (VEC_OP(T,base,index)(VEC_BASE(V),I VEC_CHECK_INFO))
                                                              ^~~~~~~~~~~~~~
../../gcc-core-4.1.2/gcc/basic-block.h:595:27: note: in expansion of macro ‘VEC_index’
 #define EDGE_PRED(bb,i)   VEC_index  (edge, (bb)->preds, (i))
                           ^~~~~~~~~
../../gcc-core-4.1.2/gcc/basic-block.h:631:10: note: in expansion of macro ‘EDGE_PRED’
   return EDGE_PRED (bb, 0);
          ^~~~~~~~~
In file included from ../../gcc-core-4.1.2/gcc/toplev.c:31:
../../gcc-core-4.1.2/gcc/basic-block.h: In function ‘ei_container’:
../../gcc-core-4.1.2/gcc/system.h:575:55: warning: ISO C does not support ‘__FUNCTION__’ predefined identifier [-Wpedantic]
    ((void)(!(EXPR) ? fancy_abort (__FILE__, __LINE__, __FUNCTION__), 0 : 0))
                                                       ^~~~~~~~~~~~
../../gcc-core-4.1.2/gcc/basic-block.h:662:3: note: in expansion of macro ‘gcc_assert’
   gcc_assert (i.container);
   ^~~~~~~~~~
../../gcc-core-4.1.2/gcc/basic-block.h: In function ‘ei_next’:
../../gcc-core-4.1.2/gcc/system.h:575:55: warning: ISO C does not support ‘__FUNCTION__’ predefined identifier [-Wpedantic]
    ((void)(!(EXPR) ? fancy_abort (__FILE__, __LINE__, __FUNCTION__), 0 : 0))
                                                       ^~~~~~~~~~~~
../../gcc-core-4.1.2/gcc/basic-block.h:713:3: note: in expansion of macro ‘gcc_assert’
   gcc_assert (i->index < EDGE_COUNT (ei_container (*i)));
   ^~~~~~~~~~
../../gcc-core-4.1.2/gcc/basic-block.h: In function ‘ei_prev’:
../../gcc-core-4.1.2/gcc/system.h:575:55: warning: ISO C does not support ‘__FUNCTION__’ predefined identifier [-Wpedantic]
    ((void)(!(EXPR) ? fancy_abort (__FILE__, __LINE__, __FUNCTION__), 0 : 0))
                                                       ^~~~~~~~~~~~
../../gcc-core-4.1.2/gcc/basic-block.h:721:3: note: in expansion of macro ‘gcc_assert’
   gcc_assert (i->index > 0);
   ^~~~~~~~~~
In file included from ../../gcc-core-4.1.2/gcc/tree.h:28,
                 from ../../gcc-core-4.1.2/gcc/toplev.c:46:
../../gcc-core-4.1.2/gcc/basic-block.h: In function ‘ei_edge’:
../../gcc-core-4.1.2/gcc/vec.h:403:43: warning: ISO C does not support ‘__FUNCTION__’ predefined identifier [-Wpedantic]
 #define VEC_CHECK_INFO ,__FILE__,__LINE__,__FUNCTION__
                                           ^~~~~~~~~~~~
../../gcc-core-4.1.2/gcc/vec.h:175:62: note: in expansion of macro ‘VEC_CHECK_INFO’
 #define VEC_index(T,V,I) (VEC_OP(T,base,index)(VEC_BASE(V),I VEC_CHECK_INFO))
                                                              ^~~~~~~~~~~~~~
../../gcc-core-4.1.2/gcc/basic-block.h:594:24: note: in expansion of macro ‘VEC_index’
 #define EDGE_I(ev,i)   VEC_index  (edge, (ev), (i))
                        ^~~~~~~~~
../../gcc-core-4.1.2/gcc/basic-block.h:729:10: note: in expansion of macro ‘EDGE_I’
   return EDGE_I (ei_container (i), i.index);
          ^~~~~~
In file included from ../../gcc-core-4.1.2/gcc/toplev.c:31:
../../gcc-core-4.1.2/gcc/gcov-io.h: In function ‘gcov_position’:
../../gcc-core-4.1.2/gcc/system.h:575:55: warning: ISO C does not support ‘__FUNCTION__’ predefined identifier [-Wpedantic]
    ((void)(!(EXPR) ? fancy_abort (__FILE__, __LINE__, __FUNCTION__), 0 : 0))
                                                       ^~~~~~~~~~~~
../../gcc-core-4.1.2/gcc/gcov-io.h:572:3: note: in expansion of macro ‘gcc_assert’
   gcc_assert (gcov_var.mode > 0);
   ^~~~~~~~~~
../../gcc-core-4.1.2/gcc/toplev.c: At top level:
../../gcc-core-4.1.2/gcc/toplev.c:524:1: error: redefinition of ‘floor_log2’
 floor_log2 (unsigned HOST_WIDE_INT x)
 ^~~~~~~~~~
In file included from ../../gcc-core-4.1.2/gcc/toplev.c:59:
../../gcc-core-4.1.2/gcc/toplev.h:175:1: note: previous definition of ‘floor_log2’ was here
 floor_log2 (unsigned HOST_WIDE_INT x)
 ^~~~~~~~~~
../../gcc-core-4.1.2/gcc/toplev.c:559:1: error: redefinition of ‘exact_log2’
 exact_log2 (unsigned HOST_WIDE_INT x)
 ^~~~~~~~~~
In file included from ../../gcc-core-4.1.2/gcc/toplev.c:59:
../../gcc-core-4.1.2/gcc/toplev.h:181:1: note: previous definition of ‘exact_log2’ was here
 exact_log2 (unsigned HOST_WIDE_INT x)
 ^~~~~~~~~~
make[2]: *** [Makefile:2064: toplev.o] Error 1
make[2]: Leaving directory '/home/user/Development/gcc-build-root/gcc-core-4.1.2.build/gcc'
make[1]: *** [Makefile:4084: stage1_build] Error 2
make[1]: Leaving directory '/home/user/Development/gcc-build-root/gcc-core-4.1.2.build/gcc'
make: *** [Makefile:9525: bootstrap] Error 2

我已经配置了 configure --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu --enable-languages=c,treelang

我该如何修复重新定义错误?

相关内容