vendredi 20 avril 2018

How to compile heavy template projects in Cygwin64 without .o: File too big error

This is not a new issue, but I did not solve it with the instruction of those steps. I have a heavy template project to build in cygwin64 environment, the gcc command is:

/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

The error messages are:

/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

I have tried the following methods according to google searched:

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

However, none of the above method works for me. Is there any way to pass the compilation? Thanks very much!

Aucun commentaire:

Enregistrer un commentaire