如何在没有.o的Cygwin64中编译繁重的模板项目:文件太大错误

时间:2018-04-20 07:17:16

标签: c++11 gcc cygwin

这不是一个新问题,但我没有按照这些步骤的说明解决它。我有一个沉重的C ++模板项目要在cygwin64环境中构建,gcc命令是:

/usr/local/bin/gcc -std=c++11 -DPACKAGE_VERSION=\"1.7\" -DPACKAGE_STRING=\"\1.7\" -DPACKAGE_BUGREPORT=\"online@meeting.com\" -DPACKAGE_URL=\"\" -DPACKAGE=\"lib\" -DVERSION=\"1.7\" -DNDEBUG=1 -DBOOST_UBLAS_NDEBUG=1 -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE__BOOL=1 -DHAVE_STDBOOL_H=1 -I.  -I../../src  -I/usr/include/boost  -I/usr/local/include -I/usr/local/include  -I/usr/local/include -I/usr/local/include -I/usr/include/superlu  -I/usr/local/include   -O2 -g -pthread  -MT error.t.o -MD -MP -MF .deps/error.t.Tpo -c -o error.t.o error.t.cc

错误消息是:

/usr/lib/gcc/x86_64-pc-cygwin/7.3.0/../../../../x86_64-pc-cygwin/bin/as: error.t.o: section .data$_ZZN21lib_elemIN15radlib_elements4ticEEENS5_13StreamingNormISC_N229_SB_NSA_8ConstantEEEEELj1ENS5_11SignedValueES3_E23EnergyValueFunctorEEEENT1_11result_typeESN_ERule: string table overflow at offset 10000423
1>/cygdrive/c/Users/yu/AppData/Local/Temp/cclLkrFN.s: Assembler messages:
1>/cygdrive/c/Users/yu/AppData/Local/Temp/cclLkrFN.s : Fatal error : can't close error.t.o: File too big
1>make[3]: *** [Makefile:834: error.t.o] Error 1

根据谷歌搜索,我尝试了以下方法:

1> Changing the compiling flag from "-O2" to "-Og -Os"
2> Changing the compiling flag from "-O2" to "-O3"
3> Changing the compiling flag from "-O2" to "-O"
4> Changing the compiler from "gcc" to "clang" (version 5.0)
5> Add option "-Wa,-mbig-obj" to explicitly open big obj

但是,上述方法都不适合我。有没有办法通过编译?非常感谢!

0 个答案:

没有答案