Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MinGW build failure due to too many sections #33

Closed
syoyo opened this issue Oct 14, 2022 · 2 comments
Closed

MinGW build failure due to too many sections #33

syoyo opened this issue Oct 14, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@syoyo
Copy link
Collaborator

syoyo commented Oct 14, 2022

ascii-parser.cc generates too many sections and started to fail to compile with mingw(tested gcc version 10-win32 20220113 (GCC) )

/usr/bin/ccache /usr/bin/x86_64-w64-mingw32-g++-posix -DTINYUSDZ_USE_USDOBJ -DTINYUSDZ_USE_USDVOX -DTINYUSDZ_WITH_AUDIO -DTINYUSDZ_WITH_COLORIO -DTINYUSDZ_WITH_EXR -DTINYUSDZ_WITH_OPENSUBDIV @CMakeFiles/tinyusdz_static.dir/includes_CXX.rsp -fno-exceptions -std=c++14 -MD -MT CMakeFiles/tinyusdz_static.dir/src/ascii-parser.cc.obj -MF CMakeFiles/tinyusdz_static.dir/src/ascii-parser.cc.obj.d -o CMakeFiles/tinyusdz_static.dir/src/ascii-parser.cc.obj -c /home/syoyo/work/tinyusdz/src/ascii-parser.cc                                                                                                                                           /usr/bin/x86_64-w64-mingw32-as: CMakeFiles/tinyusdz_static.dir/src/ascii-parser.cc.obj: too many sections (49543)                                              /tmp/ccDaFAT8.s: Assembler messages:                                                                                                                           /tmp/ccDaFAT8.s: Fatal error: can't write 3887 bytes to section .text of CMakeFiles/tinyusdz_static.dir/src/ascii-parser.cc.obj: 'file too big'                /usr/bin/x86_64-w64-mingw32-as: CMakeFiles/tinyusdz_static.dir/src/ascii-parser.cc.obj: too many sections (49543)                                              /tmp/ccDaFAT8.s: Fatal error: CMakeFiles/tinyusdz_static.dir/src/ascii-parser.cc.obj: file too big                                                             make[2]: *** [CMakeFiles/tinyusdz_static.dir/build.make:140: CMakeFiles/tinyusdz_static.dir/src/ascii-parser.cc.obj] Error 1  

Maybe related to assimp/assimp#177

Solution

@syoyo
Copy link
Collaborator Author

syoyo commented Oct 14, 2022

One of the source of the issue is here: https://github.com/syoyo/tinyusdz/blob/39f0eec4b88b63c331749c183a7f417af8c54f50/src/ascii-parser.cc#L6729

Removing PARSE_TYPE goes compile ok.

Still linking takes too much time so it'd be better to do split a source file or investigate further to reduce sections generated in the object file.

@syoyo syoyo added the bug Something isn't working label Oct 14, 2022
syoyo added a commit that referenced this issue Oct 15, 2022
@syoyo
Copy link
Collaborator Author

syoyo commented Oct 15, 2022

Split ascii-parser.cc files into multiple files to work around this issue.

Good side effect is we now don't need /bigobj flag in MSVC build.

https://github.com/syoyo/tinyusdz/blob/2645cf722b99005320fe02712d448b87bcc783f9/CMakeLists.txt#L520

TODO: Use less template code in TimeSample and merge ascii-parser related .cc files into a single file.

@syoyo syoyo closed this as completed Oct 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant