qskinny
qskinny copied to clipboard
File too big error qt6.6.1 mingw64
H:/QTinstall/Tools/mingw1120_64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/as.exe: qmlexport/CMakeFiles/qskqmlexport.dir/QskQml.cpp.obj: too many sections (32785) C:\Users\SF738~1.ABO\AppData\Local\Temp\ccbeDjsK.s: Assembler messages: C:\Users\SF738~1.ABO\AppData\Local\Temp\ccbeDjsK.s: Fatal error: can't write 27 bytes to section .text of qmlexport/CMakeFiles/qskqmlexport.dir/QskQml.cpp.obj: 'file too big' H:/QTinstall/Tools/mingw1120_64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/as.exe: qmlexport/CMakeFiles/qskqmlexport.dir/QskQml.cpp.obj: too many sections (32785) C:\Users\SF738~1.ABO\AppData\Local\Temp\ccbeDjsK.s: Fatal error: qmlexport/CMakeFiles/qskqmlexport.dir/QskQml.cpp.obj: file too big [254/480 0.8/sec] Building CXX object support/CMakeFiles/qsktestsupport.dir/qrc_fonts.cpp.obj ninja: build stopped: subcommand failed. 14:53:57: The process "H:\QTinstall\Tools\CMake_64\bin\cmake.exe" exited with code 1. Error while building/deploying project QSkinny (kit: Desktop Qt 6.6.1 MinGW 64-bit) When executing step "Build" 14:53:57: Elapsed time: 05:10.
How to fix this error??
@rick-vogel: any clue: ( as you are the only windows user )
@AraSaWCH did you try adding -Wa,-mbig-obj
to the qskqmlexport
CMake target's compiler flags? I'm not experienced with mingw, these are just a guesses.
C:\Users\SF7381.ABO\AppData\Local\Temp\ccbeDjsK.s: Fatal error: can't write 27 bytes to section .text of qmlexport/CMakeFiles/qskqmlexport.dir/QskQml.cpp.obj: 'file too big'
I once had a similiar output with MSVC
and had to pass it MSVC
's /bigobj
what makes me think -mbig-obj
might be right for mingw
Found these after 5s of google, maybe they help:
- https://stackoverflow.com/questions/31890021/mingw-too-many-sections-bug-while-compiling-huge-header-file-in-qt
- https://stackoverflow.com/questions/16596876/gcc-equivalent-of-mss-bigobj
PS: Unfortunately I was not able to reproduce it locally with: Qt 6.6.1, Qt 6.6.1 MinGW 64-bit Kit from the Qt Maintenance Tool, Win11 Host, 64 GB RAM
PPS: @uwerat @AraSaWCH I noticed the [254/480 0.8/sec] Building CXX object support/CMakeFiles/qsktestsupport.dir/qrc_fonts.cpp.obj ninja: build stopped: subcommand failed.
line and saw that the qrc_fonts.cpp.obj
has 14 MiBi.
Don't know if this is related but there is a BIG_RESOURCES
keyword in the qt_add_resources woth giving it a try.
Note that BIG_RESOURCES is not compatible with iOS due to restrictions of CMake's Xcode project generator. See QTBUG-103497 for details. Also, BIG_RESOURCES only works reliably from CMake 3.17 onwards.
PPPS: I can reproduce the error when building Debug
instead of Release
The main reason for the object size is related to exporting lists to QML. The culprit is QMetaType::fromType< QList<T> >( ) that creates tons of symbols for all the types, that are Q_GADGET. As we do not register any of these lists to the metaobject system I simply disabled exporting them. That reduces the size on my box ( Linux/gcc ) by ~66%.
I also removed unused SegoeUI fonts ( emojis, symbols ... ) and split the fonts into different resource files for SegoeUI/Roboto/DejaVu. The largest of them ( SegoeUI ) ends up as binary with 6359496 bytes.
@AraSaWCH please let us know if this solves the issue