therecipe / qt

Qt binding for Go (Golang) with support for Windows / macOS / Linux / FreeBSD / Android / iOS / Sailfish OS / Raspberry Pi / AsteroidOS / Ubuntu Touch / JavaScript / WebAssembly
GNU Lesser General Public License v3.0
10.49k stars 748 forks source link

Linux->Windows setup fails with "File too big" #924

Open BenLubar opened 5 years ago

BenLubar commented 5 years ago

Compiling widgets.cpp fails with this error:

/usr/lib/mxe/usr/bin/x86_64-w64-mingw32.static-as: $WORK/b038/_x004.o: too many sections (53816)
{standard input}: Assembler messages:
{standard input}: Fatal error: can't write 1 bytes to section .text$_ZN17QtMetaTypePrivate23QMetaTypeFunctionHelperINS_23QSequentialIterableImplELb1EE8DestructEPv of $WORK/b038/_x004.o because: 'File too big'
/usr/lib/mxe/usr/bin/x86_64-w64-mingw32.static-as: $WORK/b038/_x004.o: too many sections (53816)
{standard input}: Fatal error: can't close $WORK/b038/_x004.o: File too big
therecipe commented 5 years ago

Hey

Could it be that you were running out of disk space?

BenLubar commented 5 years ago

no, this is because of the number of sections in the file.

I'm not sure how to solve this because most of the people that ran into this kind of error message solved it with -Wa,-mbig-obj but CGo doesn't think the C compiler works at all if I do that.

therecipe commented 5 years ago

I looked into this and was able to reproduce it with the windows_64_static image when running:

docker run --rm -e QT_FAT=true -it therecipe/qt:windows_64_static /home/user/work/bin/qtsetup full windows

It could be that this is caused by the old version of gcc (5.5.0) used by mxe: https://github.com/mxe/mxe/blob/master/src/gcc.mk

And that using some newer version of gcc fixes this. I will look into it.

therecipe commented 5 years ago

Okay, I looked into this again and it seems like using gcc 8 with something like

cd /usr/lib/mxe && make -j 8 MXE_PLUGIN_DIRS=plugins/gcc8 MXE_TARGETS='x86_64-w64-mingw32.static' qt5

won't fix it.

I could be that we are unlucky and that we just crossed the threshold of the max number of sections with the recent update to Qt 5.13 Because IIRC, I was able to fully install the widgets module when using Qt 5.12 a while back