Menu

Too many sections error when building

2016-08-25
2016-12-05
  • Arash Partow

    Arash Partow - 2016-08-25

    I'm having difficulty building the following project using mingw-w64:

    https://github.com/ArashPartow/exprtk

    When I build it vanilla, I get the following:

    exprtk>make exprtk_test
    c++ -pedantic-errors -Wall -Wextra -Werror -Wno-long-long -O1 -o exprtk_test exprtk_test.cpp -L/usr/lib -lstdc++ -lm
    C:/Program Files/mingw-w64/x86_64-6.2.0-win32-seh-rt_v5-rev0/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.2.0/../../../../x86_64-w64-mingw32/bin/a
    s.exe: ...\Temp\ccOqU8eK.o: too many sections (52426)
    ...\Temp\ccZewRfk.s: Assembler messages:
    ...\Temp\ccZewRfk.s: Fatal error: can't write ...\Temp\ccOqU8eK.o: File too big

    C:/Program Files/mingw-w64/x86_64-6.2.0-win32-seh-rt_v5-rev0/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.2.0/../../../../x86_64-w64-mingw32/bin/a
    s.exe: ...\Temp\ccOqU8eK.o: too many sections (52426)
    ...\Temp\ccZewRfk.s: Fatal error: can't close ...\Temp\ccOqU8eK.o: File too big
    Makefile:50: recipe for target 'exprtk_test' failed
    make: [exprtk_test] Error 1 (ignored)

    Adding -Wa,-mbig-obj to the linker options in the makefile, seems to cause ld to go into some infinite loop:

    exprtk>make clean exprtk_test
    c++ -pedantic-errors -Wall -Wextra -Werror -Wno-long-long -O1 -o exprtk_test exp
    rtk_test.cpp -Wa,-mbig-obj -L/usr/lib -lstdc++ -lm

    Before eventually killing it I let the above run for about 9hrs. During its run ld was continuously consuming one complete core and about ~980MB of RAM.

    Based on the following it seems that this issue has already been resolved. Is there an extra option that needs to be enabled? or is it something else that I'm missing?

    https://sourceware.org/ml/binutils/2014-03/msg00114.html
    https://sourceware.org/ml/binutils/2014-03/msg00127.html

    The project builds error and warning free using gcc and clang on linux, msvc and clang on windows.

     
  • Yoshinori Tahara

    I am troubled with the same problem, too.

    I develop the serializer for C++.
    I generate a lot of classes on the automatic test and got "too many sections" and "File too big" error at the time of the compilation of its automatic test program on Windows 10.

    I made a small test program to reproduce this problem.

    1. MinGW which a problem reproduces

    i686-5.4.0-posix-dwarf-rt_v5-rev0
    i686-6.2.0-posix-dwarf-rt_v5-rev1

    x86_64-5.4.0-posix-seh-rt_v5-rev0
    x86_64-6.2.0-posix-seh-rt_v5-rev1

    2. Reproduction procedure

    Please build this source in follows on Windows 10.

    g++ main.cpp

    I expect that I can build normally, but fail in a compilation by "too many sections" and "File too big" error.
    For example, in the case of MinGW5.4.0x64, the following error message appears.

    C:/mingw-w64/x86_64-5.4.0-posix-seh-rt_v5-rev0/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/5.4.0/../../../../x86_64-w64-mingw32/bin/as.exe: C:\Users\xxxxx\AppData\Local\Temp\ccEHI77w.o: too many sections (49157)
    C:\Users\xxxxx\AppData\Local\Temp\ccDkOima.s: Assembler messages:
    C:\Users\xxxxx\AppData\Local\Temp\ccDkOima.s: Fatal error: can't write C:\Users\xxxxx\AppData\Local\Temp\ccEHI77w.o: File too big
    C:/mingw-w64/x86_64-5.4.0-posix-seh-rt_v5-rev0/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/5.4.0/../../../../x86_64-w64-mingw32/bin/as.exe: C:\Users\xxxxx\AppData\Local\Temp\ccEHI77w.o: too many sections (49157)
    C:\Users\xxxxx\AppData\Local\Temp\ccDkOima.s: Fatal error: can't close C:\Users\xxxxx\AppData\Local\Temp\ccEHI77w.o: File too big
    

    3. I can build normally by gcc and msvc

    The compilers which I confirmed are as follows.

    ubuntu 16.04 LTC :
    g++ (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609

    Windows 10 :
    Microsoft(R) C/C++ Optimizing Compiler Version 19.00.24215.1 for x86
    Microsoft(R) C/C++ Optimizing Compiler Version 19.00.24215.1 for x64

    Even if these have a more large number of classes, I succeed in build.

    Finally, MinGW developers, thank you.
    And I am sorry that my English is poor.

     

    Last edit: Yoshinori Tahara 2016-12-05

Log in to post a comment.