当我尝试运行 LFS (with systemd) 一书的第 6.18 章时,make 失败,因为在文件 中crtstuff.c, line 695
,有一个对 的未定义引用__CTOR_END__
。对我来说,这似乎是某种 g++ 错误(C 没有构造函数,所以我猜这是 c++)。我检查了几次命令,所有的./configure
参数都是正确的,所以不幸的是,我不知道问题出在哪里。
编辑:如果您带着同样的问题来这里寻找解决方案,那么您就搞砸了构建交叉 gcc。重建gcc并仔细观察,它是--enable-initfini-array,而不是--disable-initfini--array。
我正在使用的命令是:
../configure --build=$(../config.guess) --host=$LFS_TGT --prefix=/usr CC_FOR_TARGET=$LFS_TGT-gcc --with-build-sysroot=$LFS --enable-initfini-array --disable-nls --disable-multilib --disable-decimal-float --disable--libatomic --disable-libgomp --disable-libquadmath --disable-libssp --disable-libvtv --disable-libstdcxx --enable-languages=c,c++ && make && make DESTDIR=$LFS install && ln -sv gcc $LFS/usr/bin/cc
我不认为我搞砸了 libgcc,因为否则我认为我不会走到这一步,或者我完全放弃了这个?
编辑:我被要求提供完整的 make 错误,就是这样:
大部分是 make 告诉我什么都不做,因为我之前运行过这个命令几次。
<code>
make[1]: Entering directory '/mnt/lfs/sources/gcc-10.2.0/build'
make[2]: Entering directory '/mnt/lfs/sources/gcc-10.2.0/build/intl'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/mnt/lfs/sources/gcc-10.2.0/build/intl'
make[2]: Entering directory '/mnt/lfs/sources/gcc-10.2.0/build/build-x86_64-pc-linux-gnu/libiberty'
make[2]: Entering directory '/mnt/lfs/sources/gcc-10.2.0/build/gmp'
make[2]: Entering directory '/mnt/lfs/sources/gcc-10.2.0/build/libiberty'
make[2]: Entering directory '/mnt/lfs/sources/gcc-10.2.0/build/libbacktrace'
make all-recursive
make[2]: Entering directory '/mnt/lfs/sources/gcc-10.2.0/build/libdecnumber'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/mnt/lfs/sources/gcc-10.2.0/build/libdecnumber'
make all-am
make[3]: Entering directory '/mnt/lfs/sources/gcc-10.2.0/build/gmp'
make[3]: Entering directory '/mnt/lfs/sources/gcc-10.2.0/build/libbacktrace'
true DO=all multi-do # make
make[3]: Entering directory '/mnt/lfs/sources/gcc-10.2.0/build/build-x86_64-pc-linux-gnu/libiberty/testsuite'
make[3]: Nothing to be done for 'all'.
make[3]: Leaving directory '/mnt/lfs/sources/gcc-10.2.0/build/build-x86_64-pc-linux-gnu/libiberty/testsuite'
Making all in tests
make[3]: Leaving directory '/mnt/lfs/sources/gcc-10.2.0/build/libbacktrace'
make[2]: Leaving directory '/mnt/lfs/sources/gcc-10.2.0/build/libbacktrace'
make[3]: Entering directory '/mnt/lfs/sources/gcc-10.2.0/build/libiberty/testsuite'
make[3]: Nothing to be done for 'all'.
make[3]: Leaving directory '/mnt/lfs/sources/gcc-10.2.0/build/libiberty/testsuite'
make[2]: Leaving directory '/mnt/lfs/sources/gcc-10.2.0/build/build-x86_64-pc-linux-gnu/libiberty'
make[4]: Entering directory '/mnt/lfs/sources/gcc-10.2.0/build/gmp/tests'
make[2]: Leaving directory '/mnt/lfs/sources/gcc-10.2.0/build/libiberty'
make[2]: Entering directory '/mnt/lfs/sources/gcc-10.2.0/build/zlib'
true "AR_FLAGS=rc" "CC_FOR_BUILD=gcc" "CFLAGS=-g -O2" "CXXFLAGS=-g -O2" "CFLAGS_FOR_BUILD=" "CFLAGS_FOR_TARGET=-g -O2" "INSTALL=/usr/bin/install -c" "INSTALL_DATA=/usr/bin/install -c -m 644" "INSTALL_PROGRAM=/usr/bin/install -c" "INSTALL_SCRIPT=/usr/bin/install -c" "LDFLAGS=-static-libstdc++ -static-libgcc " "LIBCFLAGS=-g -O2" "LIBCFLAGS_FOR_TARGET=-g -O2" "MAKE=make" "MAKEINFO=makeinfo --split-size=5000000 --split-size=5000000 " "PICFLAG=" "PICFLAG_FOR_TARGET=" "SHELL=/bin/sh" "EXPECT=expect" "RUNTEST=runtest" "RUNTESTFLAGS=" "exec_prefix=/usr" "infodir=/usr/share/info" "libdir=/usr/lib" "prefix=/usr" "tooldir=/usr/x86_64-lfs-linux-gnu" "AR=x86_64-lfs-linux-gnu-ar" "AS=x86_64-lfs-linux-gnu-as" "CC=x86_64-lfs-linux-gnu-gcc" "CXX=x86_64-lfs-linux-gnu-g++" "LD=/mnt/lfs/tools/lib/gcc/x86_64-lfs-linux-gnu/10.2.0/../../../../x86_64-lfs-linux-gnu/bin/ld" "LIBCFLAGS=-g -O2" "NM=x86_64-lfs-linux-gnu-nm" "PICFLAG=" "RANLIB=x86_64-lfs-linux-gnu-ranlib" "DESTDIR=" DO=all multi-do # make
make[2]: Leaving directory '/mnt/lfs/sources/gcc-10.2.0/build/zlib'
Making all in .
make[5]: Entering directory '/mnt/lfs/sources/gcc-10.2.0/build/gmp/tests'
make[5]: Nothing to be done for 'all-am'.
make[5]: Leaving directory '/mnt/lfs/sources/gcc-10.2.0/build/gmp/tests'
Making all in devel
make[5]: Entering directory '/mnt/lfs/sources/gcc-10.2.0/build/gmp/tests/devel'
make[5]: Nothing to be done for 'all'.
make[5]: Leaving directory '/mnt/lfs/sources/gcc-10.2.0/build/gmp/tests/devel'
Making all in mpn
make[2]: Entering directory '/mnt/lfs/sources/gcc-10.2.0/build/build-x86_64-pc-linux-gnu/fixincludes'
make[5]: Entering directory '/mnt/lfs/sources/gcc-10.2.0/build/gmp/tests/mpn'
make[5]: Nothing to be done for 'all'.
make[5]: Leaving directory '/mnt/lfs/sources/gcc-10.2.0/build/gmp/tests/mpn'
Making all in mpz
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/mnt/lfs/sources/gcc-10.2.0/build/build-x86_64-pc-linux-gnu/fixincludes'
make[2]: Entering directory '/mnt/lfs/sources/gcc-10.2.0/build/build-x86_64-pc-linux-gnu/libcpp'
test -f config.h || (rm -f stamp-h1 && make stamp-h1)
make[2]: Entering directory '/mnt/lfs/sources/gcc-10.2.0/build/fixincludes'
make[2]: Entering directory '/mnt/lfs/sources/gcc-10.2.0/build/lto-plugin'
make[5]: Entering directory '/mnt/lfs/sources/gcc-10.2.0/build/gmp/tests/mpz'
make[5]: Nothing to be done for 'all'.
make[5]: Leaving directory '/mnt/lfs/sources/gcc-10.2.0/build/gmp/tests/mpz'
make[2]: Leaving directory '/mnt/lfs/sources/gcc-10.2.0/build/build-x86_64-pc-linux-gnu/libcpp'
Making all in mpq
make[2]: Entering directory '/mnt/lfs/sources/gcc-10.2.0/build/libcpp'
test -f config.h || (rm -f stamp-h1 && make stamp-h1)
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/mnt/lfs/sources/gcc-10.2.0/build/fixincludes'
make[5]: Entering directory '/mnt/lfs/sources/gcc-10.2.0/build/gmp/tests/mpq'
make[5]: Nothing to be done for 'all'.
make[5]: Leaving directory '/mnt/lfs/sources/gcc-10.2.0/build/gmp/tests/mpq'
Making all in mpf
make all-am
make[2]: Leaving directory '/mnt/lfs/sources/gcc-10.2.0/build/libcpp'
make[3]: Entering directory '/mnt/lfs/sources/gcc-10.2.0/build/lto-plugin'
make[5]: Entering directory '/mnt/lfs/sources/gcc-10.2.0/build/gmp/tests/mpf'
make[5]: Nothing to be done for 'all'.
make[5]: Leaving directory '/mnt/lfs/sources/gcc-10.2.0/build/gmp/tests/mpf'
Making all in rand
make[5]: Entering directory '/mnt/lfs/sources/gcc-10.2.0/build/gmp/tests/rand'
make[5]: Nothing to be done for 'all'.
make[5]: Leaving directory '/mnt/lfs/sources/gcc-10.2.0/build/gmp/tests/rand'
Making all in misc
make[3]: Leaving directory '/mnt/lfs/sources/gcc-10.2.0/build/lto-plugin'
make[2]: Leaving directory '/mnt/lfs/sources/gcc-10.2.0/build/lto-plugin'
make[5]: Entering directory '/mnt/lfs/sources/gcc-10.2.0/build/gmp/tests/misc'
make[5]: Nothing to be done for 'all'.
make[5]: Leaving directory '/mnt/lfs/sources/gcc-10.2.0/build/gmp/tests/misc'
Making all in cxx
make[5]: Entering directory '/mnt/lfs/sources/gcc-10.2.0/build/gmp/tests/cxx'
make[5]: Nothing to be done for 'all'.
make[5]: Leaving directory '/mnt/lfs/sources/gcc-10.2.0/build/gmp/tests/cxx'
make[4]: Leaving directory '/mnt/lfs/sources/gcc-10.2.0/build/gmp/tests'
Making all in mpn
make[4]: Entering directory '/mnt/lfs/sources/gcc-10.2.0/build/gmp/mpn'
make[4]: Nothing to be done for 'all'.
make[4]: Leaving directory '/mnt/lfs/sources/gcc-10.2.0/build/gmp/mpn'
Making all in mpz
make[4]: Entering directory '/mnt/lfs/sources/gcc-10.2.0/build/gmp/mpz'
make[4]: Nothing to be done for 'all'.
make[4]: Leaving directory '/mnt/lfs/sources/gcc-10.2.0/build/gmp/mpz'
Making all in mpq
make[4]: Entering directory '/mnt/lfs/sources/gcc-10.2.0/build/gmp/mpq'
make[4]: Nothing to be done for 'all'.
make[4]: Leaving directory '/mnt/lfs/sources/gcc-10.2.0/build/gmp/mpq'
Making all in mpf
make[4]: Entering directory '/mnt/lfs/sources/gcc-10.2.0/build/gmp/mpf'
make[4]: Nothing to be done for 'all'.
make[4]: Leaving directory '/mnt/lfs/sources/gcc-10.2.0/build/gmp/mpf'
Making all in printf
make[4]: Entering directory '/mnt/lfs/sources/gcc-10.2.0/build/gmp/printf'
make[4]: Nothing to be done for 'all'.
make[4]: Leaving directory '/mnt/lfs/sources/gcc-10.2.0/build/gmp/printf'
Making all in scanf
make[4]: Entering directory '/mnt/lfs/sources/gcc-10.2.0/build/gmp/scanf'
make[4]: Nothing to be done for 'all'.
make[4]: Leaving directory '/mnt/lfs/sources/gcc-10.2.0/build/gmp/scanf'
Making all in rand
make[4]: Entering directory '/mnt/lfs/sources/gcc-10.2.0/build/gmp/rand'
make[4]: Nothing to be done for 'all'.
make[4]: Leaving directory '/mnt/lfs/sources/gcc-10.2.0/build/gmp/rand'
Making all in cxx
make[4]: Entering directory '/mnt/lfs/sources/gcc-10.2.0/build/gmp/cxx'
make[4]: Nothing to be done for 'all'.
make[4]: Leaving directory '/mnt/lfs/sources/gcc-10.2.0/build/gmp/cxx'
Making all in demos
make[4]: Entering directory '/mnt/lfs/sources/gcc-10.2.0/build/gmp/demos'
Making all in calc
make[5]: Entering directory '/mnt/lfs/sources/gcc-10.2.0/build/gmp/demos/calc'
make all-am
make[6]: Entering directory '/mnt/lfs/sources/gcc-10.2.0/build/gmp/demos/calc'
make[6]: Nothing to be done for 'all-am'.
make[6]: Leaving directory '/mnt/lfs/sources/gcc-10.2.0/build/gmp/demos/calc'
make[5]: Leaving directory '/mnt/lfs/sources/gcc-10.2.0/build/gmp/demos/calc'
Making all in expr
make[5]: Entering directory '/mnt/lfs/sources/gcc-10.2.0/build/gmp/demos/expr'
make[5]: Nothing to be done for 'all'.
make[5]: Leaving directory '/mnt/lfs/sources/gcc-10.2.0/build/gmp/demos/expr'
make[5]: Entering directory '/mnt/lfs/sources/gcc-10.2.0/build/gmp/demos'
make[5]: Nothing to be done for 'all-am'.
make[5]: Leaving directory '/mnt/lfs/sources/gcc-10.2.0/build/gmp/demos'
make[4]: Leaving directory '/mnt/lfs/sources/gcc-10.2.0/build/gmp/demos'
Making all in tune
make[4]: Entering directory '/mnt/lfs/sources/gcc-10.2.0/build/gmp/tune'
make[4]: Nothing to be done for 'all'.
make[4]: Leaving directory '/mnt/lfs/sources/gcc-10.2.0/build/gmp/tune'
Making all in doc
make[4]: Entering directory '/mnt/lfs/sources/gcc-10.2.0/build/gmp/doc'
make[4]: Nothing to be done for 'all'.
make[4]: Leaving directory '/mnt/lfs/sources/gcc-10.2.0/build/gmp/doc'
make[4]: Entering directory '/mnt/lfs/sources/gcc-10.2.0/build/gmp'
make[4]: Leaving directory '/mnt/lfs/sources/gcc-10.2.0/build/gmp'
make[3]: Leaving directory '/mnt/lfs/sources/gcc-10.2.0/build/gmp'
make[2]: Leaving directory '/mnt/lfs/sources/gcc-10.2.0/build/gmp'
make[2]: Entering directory '/mnt/lfs/sources/gcc-10.2.0/build/mpfr'
Making all in doc
make[3]: Entering directory '/mnt/lfs/sources/gcc-10.2.0/build/mpfr/doc'
make[3]: Nothing to be done for 'all'.
make[3]: Leaving directory '/mnt/lfs/sources/gcc-10.2.0/build/mpfr/doc'
Making all in src
make[3]: Entering directory '/mnt/lfs/sources/gcc-10.2.0/build/mpfr/src'
make all-am
make[4]: Entering directory '/mnt/lfs/sources/gcc-10.2.0/build/mpfr/src'
make[4]: Nothing to be done for 'all-am'.
make[4]: Leaving directory '/mnt/lfs/sources/gcc-10.2.0/build/mpfr/src'
make[3]: Leaving directory '/mnt/lfs/sources/gcc-10.2.0/build/mpfr/src'
Making all in tests
make[3]: Entering directory '/mnt/lfs/sources/gcc-10.2.0/build/mpfr/tests'
make[3]: Nothing to be done for 'all'.
make[3]: Leaving directory '/mnt/lfs/sources/gcc-10.2.0/build/mpfr/tests'
Making all in tune
make[3]: Entering directory '/mnt/lfs/sources/gcc-10.2.0/build/mpfr/tune'
make[3]: Nothing to be done for 'all'.
make[3]: Leaving directory '/mnt/lfs/sources/gcc-10.2.0/build/mpfr/tune'
Making all in tools/bench
make[3]: Entering directory '/mnt/lfs/sources/gcc-10.2.0/build/mpfr/tools/bench'
make[3]: Nothing to be done for 'all'.
make[3]: Leaving directory '/mnt/lfs/sources/gcc-10.2.0/build/mpfr/tools/bench'
make[3]: Entering directory '/mnt/lfs/sources/gcc-10.2.0/build/mpfr'
make[3]: Nothing to be done for 'all-am'.
make[3]: Leaving directory '/mnt/lfs/sources/gcc-10.2.0/build/mpfr'
make[2]: Leaving directory '/mnt/lfs/sources/gcc-10.2.0/build/mpfr'
make[2]: Entering directory '/mnt/lfs/sources/gcc-10.2.0/build/mpc'
make all-recursive
make[3]: Entering directory '/mnt/lfs/sources/gcc-10.2.0/build/mpc'
Making all in src
make[4]: Entering directory '/mnt/lfs/sources/gcc-10.2.0/build/mpc/src'
make[4]: Nothing to be done for 'all'.
make[4]: Leaving directory '/mnt/lfs/sources/gcc-10.2.0/build/mpc/src'
Making all in tests
make[4]: Entering directory '/mnt/lfs/sources/gcc-10.2.0/build/mpc/tests'
make[4]: Nothing to be done for 'all'.
make[4]: Leaving directory '/mnt/lfs/sources/gcc-10.2.0/build/mpc/tests'
Making all in doc
make[4]: Entering directory '/mnt/lfs/sources/gcc-10.2.0/build/mpc/doc'
make[4]: Nothing to be done for 'all'.
make[4]: Leaving directory '/mnt/lfs/sources/gcc-10.2.0/build/mpc/doc'
Making all in tools
make[4]: Entering directory '/mnt/lfs/sources/gcc-10.2.0/build/mpc/tools'
Making all in bench
make[5]: Entering directory '/mnt/lfs/sources/gcc-10.2.0/build/mpc/tools/bench'
make[5]: Nothing to be done for 'all'.
make[5]: Leaving directory '/mnt/lfs/sources/gcc-10.2.0/build/mpc/tools/bench'
Making all in mpcheck
make[5]: Entering directory '/mnt/lfs/sources/gcc-10.2.0/build/mpc/tools/mpcheck'
make[5]: Nothing to be done for 'all'.
make[5]: Leaving directory '/mnt/lfs/sources/gcc-10.2.0/build/mpc/tools/mpcheck'
make[5]: Entering directory '/mnt/lfs/sources/gcc-10.2.0/build/mpc/tools'
make[5]: Nothing to be done for 'all-am'.
make[5]: Leaving directory '/mnt/lfs/sources/gcc-10.2.0/build/mpc/tools'
make[4]: Leaving directory '/mnt/lfs/sources/gcc-10.2.0/build/mpc/tools'
make[4]: Entering directory '/mnt/lfs/sources/gcc-10.2.0/build/mpc'
make[4]: Leaving directory '/mnt/lfs/sources/gcc-10.2.0/build/mpc'
make[3]: Leaving directory '/mnt/lfs/sources/gcc-10.2.0/build/mpc'
make[2]: Leaving directory '/mnt/lfs/sources/gcc-10.2.0/build/mpc'
make[2]: Entering directory '/mnt/lfs/sources/gcc-10.2.0/build/gcc'
make[2]: Leaving directory '/mnt/lfs/sources/gcc-10.2.0/build/gcc'
Checking multilib configuration for libgcc...
make[2]: Entering directory '/mnt/lfs/sources/gcc-10.2.0/build/libcc1'
make all-am
make[2]: Entering directory '/mnt/lfs/sources/gcc-10.2.0/build/x86_64-lfs-linux-gnu/libgcc'
make[3]: Entering directory '/mnt/lfs/sources/gcc-10.2.0/build/libcc1'
make[3]: Leaving directory '/mnt/lfs/sources/gcc-10.2.0/build/libcc1'
make[2]: Leaving directory '/mnt/lfs/sources/gcc-10.2.0/build/libcc1'
# If this is the top-level multilib, build all the other
# multilibs.
x86_64-lfs-linux-gnu-gcc --sysroot=/mnt/lfs -g -O2 -O2 -g -O2 -DIN_GCC -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wno-error=format-diag -Wstrict-prototypes -Wmissing-prototypes -Wno-error=format-diag -Wold-style-definition -isystem ./include -I. -I. -I../.././gcc -I../../../libgcc -I../../../libgcc/. -I../../../libgcc/../gcc -I../../../libgcc/../include -g0 -finhibit-size-directive -fno-inline -fno-exceptions -fno-zero-initialized-in-bss -fno-toplevel-reorder -fno-tree-vectorize -fbuilding-libgcc -fno-stack-protector -I. -I. -I../.././gcc -I../../../libgcc -I../../../libgcc/. -I../../../libgcc/../gcc -I../../../libgcc/../include -o crtend.o -MT crtend.o -MD -MP -MF crtend.dep -fno-omit-frame-pointer -fno-asynchronous-unwind-tables -c ../../../libgcc/crtstuff.c -DCRT_END
x86_64-lfs-linux-gnu-gcc --sysroot=/mnt/lfs -g -O2 -O2 -g -O2 -DIN_GCC -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wno-error=format-diag -Wstrict-prototypes -Wmissing-prototypes -Wno-error=format-diag -Wold-style-definition -isystem ./include -I. -I. -I../.././gcc -I../../../libgcc -I../../../libgcc/. -I../../../libgcc/../gcc -I../../../libgcc/../include -g0 -finhibit-size-directive -fno-inline -fno-exceptions -fno-zero-initialized-in-bss -fno-toplevel-reorder -fno-tree-vectorize -fbuilding-libgcc -fno-stack-protector -I. -I. -I../.././gcc -I../../../libgcc -I../../../libgcc/. -I../../../libgcc/../gcc -I../../../libgcc/../include -o crtendS.o -MT crtendS.o -MD -MP -MF crtendS.dep -fno-omit-frame-pointer -fno-asynchronous-unwind-tables -fpic -c ../../../libgcc/crtstuff.c -DCRT_END -DCRTSTUFFS_O
dest=../.././gcc/include/tmp$$-unwind.h; \
cp unwind.h $dest; \
chmod a+r $dest; \
sh ../../../libgcc/../move-if-change $dest ../.././gcc/include/unwind.h
rm -f libgcc.a
objects="_muldi3.o _negdi2.o _lshrdi3.o _ashldi3.o _ashrdi3.o _cmpdi2.o _ucmpdi2.o _clear_cache.o _trampoline.o __main.o _absvsi2.o _absvdi2.o _addvsi3.o _addvdi3.o _subvsi3.o _subvdi3.o _mulvsi3.o _mulvdi3.o _negvsi2.o _negvdi2.o _ctors.o _ffssi2.o _ffsdi2.o _clz.o _clzsi2.o _clzdi2.o _ctzsi2.o _ctzdi2.o _popcount_tab.o _popcountsi2.o _popcountdi2.o _paritysi2.o _paritydi2.o _powisf2.o _powidf2.o _powixf2.o _mulhc3.o _mulsc3.o _muldc3.o _mulxc3.o _divhc3.o _divsc3.o _divdc3.o _divxc3.o _bswapsi2.o _bswapdi2.o _clrsbsi2.o _clrsbdi2.o _fixunssfsi.o _fixunsdfsi.o _fixunsxfsi.o _fixsfdi.o _fixdfdi.o _fixxfdi.o _fixunssfdi.o _fixunsdfdi.o _fixunsxfdi.o _floatdisf.o _floatdidf.o _floatdixf.o _floatundisf.o _floatundidf.o _floatundixf.o _eprintf.o __gcc_bcmp.o _divdi3.o _moddi3.o _divmoddi4.o _udivdi3.o _umoddi3.o _udivmoddi4.o _udiv_w_sdiv.o cpuinfo.o sfp-exceptions.o addtf3.o divtf3.o multf3.o negtf2.o subtf3.o unordtf2.o fixtfsi.o fixunstfsi.o floatsitf.o floatunsitf.o fixtfdi.o fixunstfdi.o floatditf.o floatunditf.o fixtfti.o fixunstfti.o floattitf.o floatuntitf.o extendsftf2.o extenddftf2.o extendxftf2.o trunctfsf2.o trunctfdf2.o trunctfxf2.o getf2.o letf2.o eqtf2.o _divtc3.o _multc3.o _powitf2.o enable-execute-stack.o avx_savms64.o avx_resms64.o avx_resms64x.o avx_savms64f.o avx_resms64f.o avx_resms64fx.o sse_savms64.o sse_resms64.o sse_resms64x.o sse_savms64f.o sse_resms64f.o sse_resms64fx.o generic-morestack.o generic-morestack-thread.o morestack.o"; \
if test -z "$objects"; then \
echo 'int __libgcc_eh_dummy;' > eh_dummy.c; \
x86_64-lfs-linux-gnu-gcc --sysroot=/mnt/lfs -g -O2 -O2 -g -O2 -DIN_GCC -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wno-error=format-diag -Wstrict-prototypes -Wmissing-prototypes -Wno-error=format-diag -Wold-style-definition -isystem ./include -fpic -mlong-double-80 -DUSE_ELF_SYMVER -g -DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector -fpic -mlong-double-80 -DUSE_ELF_SYMVER -I. -I. -I../.././gcc -I../../../libgcc -I../../../libgcc/. -I../../../libgcc/../gcc -I../../../libgcc/../include -DHAVE_CC_TLS -DUSE_TLS -fvisibility=hidden -DHIDE_EXPORTS -c eh_dummy.c \
-o eh_dummy.o; \
objects=eh_dummy.o; \
fi; \
/mnt/lfs/tools/lib/gcc/x86_64-lfs-linux-gnu/10.2.0/../../../../x86_64-lfs-linux-gnu/bin/ar rc libgcc.a $objects
/mnt/lfs/tools/lib/gcc/x86_64-lfs-linux-gnu/10.2.0/../../../../x86_64-lfs-linux-gnu/bin/ranlib libgcc.a
../../../libgcc/crtstuff.c: In function '__do_global_ctors_aux':
../../../libgcc/crtstuff.c:695:12: error: '__CTOR_END__' undeclared (first use in this function); did you mean '__TMC_END__'?
695 | for (p = __CTOR_END__ - 1; *p != (func_ptr) -1; p--)
| ^~~~~~~~~~~~
| __TMC_END__
../../../libgcc/crtstuff.c:695:12: note: each undeclared identifier is reported only once for each function it appears in
make[2]: *** [Makefile:1035: crtendS.o] Error 1
make[2]: *** Waiting for unfinished jobs....
../../../libgcc/crtstuff.c: In function '__do_global_ctors_aux':
../../../libgcc/crtstuff.c:695:12: error: '__CTOR_END__' undeclared (first use in this function); did you mean '__TMC_END__'?
695 | for (p = __CTOR_END__ - 1; *p != (func_ptr) -1; p--)
| ^~~~~~~~~~~~
| __TMC_END__
../../../libgcc/crtstuff.c:695:12: note: each undeclared identifier is reported only once for each function it appears in
make[2]: *** [Makefile:1028: crtend.o] Error 1
make[2]: Leaving directory '/mnt/lfs/sources/gcc-10.2.0/build/x86_64-lfs-linux-gnu/libgcc'
make[1]: *** [Makefile:12920: all-target-libgcc] Error 2
make[1]: Leaving directory '/mnt/lfs/sources/gcc-10.2.0/build'
make: *** [Makefile:945: all] Error 2
答案1
其他人来这里遇到类似的问题:你搞砸了你的跨海湾合作委员会。确保您已--enable-initfini-array
设置该选项。我不需要重建工具链的其余部分,但我不会依赖它。