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

File too big error qt6.6.1 mingw64 #399

Open
AraSaWCH opened this issue Feb 27, 2024 · 6 comments · May be fixed by #401
Open

File too big error qt6.6.1 mingw64 #399

AraSaWCH opened this issue Feb 27, 2024 · 6 comments · May be fixed by #401
Assignees

Comments

@AraSaWCH
Copy link

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\SF7381.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??

@uwerat
Copy link
Owner

uwerat commented Feb 27, 2024

@rick-vogel: any clue: ( as you are the only windows user )

@vrcomputing
Copy link
Contributor

vrcomputing commented Feb 27, 2024

@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:

@vrcomputing
Copy link
Contributor

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

@vrcomputing
Copy link
Contributor

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.

@vrcomputing
Copy link
Contributor

PPPS: I can reproduce the error when building Debug instead of Release

vrcomputing added a commit to vrcomputing/qskinny that referenced this issue Feb 27, 2024
@vrcomputing vrcomputing linked a pull request Feb 27, 2024 that will close this issue
uwerat added a commit that referenced this issue Feb 28, 2024
@uwerat
Copy link
Owner

uwerat commented Feb 28, 2024

The main reason for the object size is related to exporting lists to QML. The culprit is QMetaType::fromType< QList >( ) 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

vrcomputing added a commit to vrcomputing/qskinny that referenced this issue Feb 28, 2024
vrcomputing added a commit to vrcomputing/qskinny that referenced this issue Feb 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants