我尝试在 Windows 上使用 MinGW-w64 编译 GCC 13.2.0,但在构建过程中遇到以下错误:
make[3]: Entering directory '/d/Develop/devtool/gcc/gcc-13.2.0/build/gcc'
g++ -std=c++11 -no-pie -g -D__USE_MINGW_ACCESS -DIN_GCC -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wno-format -Wmissing-format-attribute -Wconditionally-supported -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -fno-common -DHAVE_CONFIG_H -static-libstdc++ -static-libgcc -Wl,--stack,12582912 -Wl,--undefined=HOST_EXTRA_OBJS_SYMBOL -o cc1.exe c/c-lang.o c-family/stub-objc.o attribs.o c/c-errors.o c/c-decl.o c/c-typeck.o c/c-convert.o c/c-aux-info.o c/c-objc-common.o c/c-parser.o c/c-fold.o c/gimple-parser.o c-family/c-common.o c-family/c-cppbuiltin.o c-family/c-dump.o c-family/c-format.o c-family/c-gimplify.o c-family/c-indentation.o c-family/c-lex.o c-family/c-omp.o c-family/c-opts.o c-family/c-pch.o c-family/c-ppoutput.o c-family/c-pragma.o c-family/c-pretty-print.o c-family/c-semantics.o c-family/c-ada-spec.o c-family/c-ubsan.o c-family/known-headers.o c-family/c-attribs.o c-family/c-warn.o c-family/c-spellcheck.o i386-c.o winnt-c.o msformat-c.o \
cc1-checksum.o libbackend.a main.o libcommon-target.a libcommon.a ../libcpp/libcpp.a ../libdecnumber/libdecnumber.a libcommon.a ../libcpp/libcpp.a -lintl -liconv ../libbacktrace/.libs/libbacktrace.a ../libiberty/libiberty.a ../libdecnumber/libdecnumber.a -L/d/Develop/devtool/gcc/gcc-13.2.0/build/./isl/.libs -lisl -L/d/Develop/devtool/gcc/gcc-13.2.0/build/./gmp/.libs -L/d/Develop/devtool/gcc/gcc-13.2.0/build/./mpfr/src/.libs -L/d/Develop/devtool/gcc/gcc-13.2.0/build/./mpc/src/.libs -lmpc -lmpfr -lgmp -Wl,--export-all-symbols -Wl,--out-implib=cc1.exe.a -L./../zlib -lz -lzstd
D:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: error: export ordinal too large: 77583
collect2.exe: error: ld returned 1 exit status
make[3]: *** [../../gcc/c/Make-lang.in:87: cc1.exe] Error 1
make[3]: Leaving directory '/d/Develop/devtool/gcc/gcc-13.2.0/build/gcc'
make[2]: *** [Makefile:4988: all-stage1-gcc] Error 2
make[2]: Leaving directory '/d/Develop/devtool/gcc/gcc-13.2.0/build'
make[1]: *** [Makefile:27677: stage1-bubble] Error 2
make[1]: Leaving directory '/d/Develop/devtool/gcc/gcc-13.2.0/build'
make: *** [Makefile:1099: all] Error 2
链接器似乎遇到了“导出序号太大”错误。我尝试寻找解决方案,但没有找到任何可以解决此问题的方法。
以下是有关我的环境的一些详细信息:
有人以前遇到过这个问题或对如何解决它有任何建议吗?
提前致谢!
尝试使用
--disable-host-shared
构建 GCC。
由于这将静态构建一些东西,您也许能够避免错误。