GNU Assembler error building CsGui from 11.28 pull
Posted: Sat Dec 19 2020 3:10 pm
I have run into what I believe is a GNU assembler error building a number of the source files in CsGui.
The following MinGW64 thread seems to have a good handle in what I'm seeing:
https://sourceforge.net/p/mingw-w64/mailman/mingw-w64-public/thread/5097CA60.9090000%40doxos.eu/
Ruben and Vaclav detail the problem this way:
<Ruben>
It seems you are running into a binutils "as" implementation limit. I think it might be related to the PE+ object format, which probably
cannot handle more than 2**15 sections (all the errors have numbers like 38k sections and such)? I've never ever seen this problem in Linux (ELF).
<Vaclav>
Ok, got it:
http://waleedassar.blogspot.cz/2012/04/ollydbg-numberofsections-crash.html (that mentions 65239 (0xFEFF) however);
there is link to MSDN (http://msdn.microsoft.com/en-us/windows/hardware/gg463119.aspx) as well.
<Vaclav>
It seems therefore that using -finline-functions for heavy-template code is the way to go - I imagine a new section is created for each template instantiation; since most of those functions are small and get only called one or twice (serialization code), they can be effectively inlined and need no additional sections afterwards.
<Vaclav>
It is just a wild guess that new section gets created for each template (I can't imagine why there would be 38k sections otherwise). The final link is not a problem, it is the intermediary .o file written by as.exe which is problematic.
I reran the single file compilation and watched /tmp seeing:
asahukar@Satchmo MSYS /tmp
$ ls -al
total 116M
drwxr-xr-x 1 asahukar None 0 Dec 18 20:42 ./
drwxr-xr-x 1 asahukar None 0 Dec 15 18:54 ../
-rw-r--r-- 1 asahukar None 116M Dec 18 20:40 ccCUrEe0.s
This, along with the error output below (qcolordialog - reformatted a bit) seems confirmatory to me.
What is a version of Cs I should pull to avoid this error?
Assuming the diagnosis offered makes sense to you, would you attack this problem by splitting the source as the above thread suggests or recommend I take some other action?
Thanks in advance for the help,
AJ
Error Details:
------------------------------>
From build.ninja >
------------------------------>
build src/gui/CMakeFiles/CsGui.dir/dialogs/qcolordialog.cpp.obj:
CXX_COMPILER__CsGui_Debug ../src/gui/dialogs/qcolordialog.cpp || cmake_object_order_depends_target_CsGui
DEFINES = -DCsGui_EXPORTS -DFT2_BUILD_LIBRARY -DHAVE_ATEXIT -DHB_EXTERN="" -DHB_NDEBUG
-DHB_NO_UNICODE_FUNCS -DMNG_BUILD_SO -DMNG_NO_INCLUDE_JNG -DPNG_NO_CONFIG_H
-DQT_BUILD_GUI_LIB -DQT_BUILTIN_GIF_READER -DQT_NO_CUPS -DQT_NO_DIRECTDRAW
-DQT_NO_GLIB -DQT_NO_LPR -DQT_NO_STYLE_GTK -DQT_NO_STYLE_MAC -DQT_SHARED
-DQT_USE_FREETYPE -DUNICODE
DEP_FILE = src\gui\CMakeFiles\CsGui.dir\dialogs\qcolordialog.cpp.obj.d
FLAGS = -Wa,-mbig-obj -g -std=gnu++1z
INCLUDES = -Isrc/gui -I../src/gui -I../src/3rdparty/libjpeg -I../src/3rdparty/libpng -I../src/3rdparty/libmng
-I../src/3rdparty/libtiff/libtiff -I../src/3rdparty/zlib -I../src/3rdparty/harfbuzz/src
-I../src/3rdparty/freetype/include/freetype -I../src/3rdparty/freetype/include -I../src/gui/widgets
-I../src/gui/util -I../src/gui/text -I../src/gui/styles -I../src/gui/statemachine -I../src/gui/printing
-I../src/gui/platform -I../src/gui/painting -I../src/gui/math3d -I../src/gui/kernel
-I../src/gui/itemviews -I../src/gui/image -I../src/gui/graphicsview -I../src/gui/effects
-I../src/gui/dialogs -I../src/gui/animation -I../src/gui/accessible -Iprivateinclude/QtGui/private
-Iinclude/QtGui -Iprivateinclude/QtCore/private -Iinclude/QtCore -Iprivateinclude -Iinclude
OBJECT_DIR = src\gui\CMakeFiles\CsGui.dir
OBJECT_FILE_DIR = src\gui\CMakeFiles\CsGui.dir\dialogs
RSP_FILE = src\gui\CMakeFiles\CsGui.dir\dialogs\qcolordialog.cpp.obj.rsp
------------------------------>
From Ninja output >
------------------------------>
[584/3850] Building CXX object src/gui/CMakeFiles/CsGui.dir/dialogs/qcolordialog.cpp.obj
FAILED: src/gui/CMakeFiles/CsGui.dir/dialogs/qcolordialog.cpp.obj
D:\DevApps\MinGW64\7.3\bin\c++.exe @src\gui\CMakeFiles\CsGui.dir\dialogs\qcolordialog.cpp.obj.rsp
-MD -MT src/gui/CMakeFiles/CsGui.dir/dialogs/qcolordialog.cpp.obj
-MF src\gui\CMakeFiles\CsGui.dir\dialogs\qcolordialog.cpp.obj.d
-o src/gui/CMakeFiles/CsGui.dir/dialogs/qcolordialog.cpp.obj
-c ../src/gui/dialogs/qcolordialog.cpp
D:/DevApps/MinGW64/7.3/bin/../lib/gcc/x86_64-w64-mingw32/7.3.0/../../../../x86_64-w64-mingw32/bin/as.exe:
src/gui/CMakeFiles/CsGui.dir/dialogs/qcolordialog.cpp.obj:
section .pdata$_ZNSt8__detail9__variant15_Variadic_unionIJPvSt10shared_ptrIN8QVariant10CustomTypeEEEEC1ILy1EJS3_I12CustomType_TIN7QAction8MenuRoleEEEEEESt16in_place_index_tIXT_EEDpOT0_: string table overflow at offset 10000004
D:\DevApps\MSys2\tmp\ccRRVbg4.s: Assembler messages:
D:\DevApps\MSys2\tmp\ccRRVbg4.s: Fatal error: can't close src/gui/CMakeFiles/CsGui.dir/dialogs/qcolordialog.cpp.obj: File too big
------------------------------------>
From qcolordialog.cpp.obj.rsp >
------------------------------------>
-DCsGui_EXPORTS -DFT2_BUILD_LIBRARY -DHAVE_ATEXIT -DHB_EXTERN="" -DHB_NDEBUG
-DHB_NO_UNICODE_FUNCS -DMNG_BUILD_SO -DMNG_NO_INCLUDE_JNG -DPNG_NO_CONFIG_H
-DQT_BUILD_GUI_LIB -DQT_BUILTIN_GIF_READER -DQT_NO_CUPS -DQT_NO_DIRECTDRAW
-DQT_NO_GLIB -DQT_NO_LPR -DQT_NO_STYLE_GTK -DQT_NO_STYLE_MAC -DQT_SHARED
-DQT_USE_FREETYPE -DUNICODE
-Isrc/gui -I../src/gui -I../src/3rdparty/libjpeg -I../src/3rdparty/libpng -I../src/3rdparty/libmng
-I../src/3rdparty/libtiff/libtiff -I../src/3rdparty/zlib -I../src/3rdparty/harfbuzz/src
-I../src/3rdparty/freetype/include/freetype -I../src/3rdparty/freetype/include -I../src/gui/widgets
-I../src/gui/util -I../src/gui/text -I../src/gui/styles -I../src/gui/statemachine -I../src/gui/printing
-I../src/gui/platform -I../src/gui/painting -I../src/gui/math3d -I../src/gui/kernel
-I../src/gui/itemviews -I../src/gui/image -I../src/gui/graphicsview -I../src/gui/effects
-I../src/gui/dialogs -I../src/gui/animation -I../src/gui/accessible -Iprivateinclude/QtGui/private
-Iinclude/QtGui -Iprivateinclude/QtCore/private -Iinclude/QtCore -Iprivateinclude -Iinclude
-Wa,-mbig-obj -g -std=gnu++1z
The following MinGW64 thread seems to have a good handle in what I'm seeing:
https://sourceforge.net/p/mingw-w64/mailman/mingw-w64-public/thread/5097CA60.9090000%40doxos.eu/
Ruben and Vaclav detail the problem this way:
<Ruben>
It seems you are running into a binutils "as" implementation limit. I think it might be related to the PE+ object format, which probably
cannot handle more than 2**15 sections (all the errors have numbers like 38k sections and such)? I've never ever seen this problem in Linux (ELF).
<Vaclav>
Ok, got it:
http://waleedassar.blogspot.cz/2012/04/ollydbg-numberofsections-crash.html (that mentions 65239 (0xFEFF) however);
there is link to MSDN (http://msdn.microsoft.com/en-us/windows/hardware/gg463119.aspx) as well.
<Vaclav>
It seems therefore that using -finline-functions for heavy-template code is the way to go - I imagine a new section is created for each template instantiation; since most of those functions are small and get only called one or twice (serialization code), they can be effectively inlined and need no additional sections afterwards.
<Vaclav>
It is just a wild guess that new section gets created for each template (I can't imagine why there would be 38k sections otherwise). The final link is not a problem, it is the intermediary .o file written by as.exe which is problematic.
I reran the single file compilation and watched /tmp seeing:
asahukar@Satchmo MSYS /tmp
$ ls -al
total 116M
drwxr-xr-x 1 asahukar None 0 Dec 18 20:42 ./
drwxr-xr-x 1 asahukar None 0 Dec 15 18:54 ../
-rw-r--r-- 1 asahukar None 116M Dec 18 20:40 ccCUrEe0.s
This, along with the error output below (qcolordialog - reformatted a bit) seems confirmatory to me.
What is a version of Cs I should pull to avoid this error?
Assuming the diagnosis offered makes sense to you, would you attack this problem by splitting the source as the above thread suggests or recommend I take some other action?
Thanks in advance for the help,
AJ
Error Details:
------------------------------>
From build.ninja >
------------------------------>
build src/gui/CMakeFiles/CsGui.dir/dialogs/qcolordialog.cpp.obj:
CXX_COMPILER__CsGui_Debug ../src/gui/dialogs/qcolordialog.cpp || cmake_object_order_depends_target_CsGui
DEFINES = -DCsGui_EXPORTS -DFT2_BUILD_LIBRARY -DHAVE_ATEXIT -DHB_EXTERN="" -DHB_NDEBUG
-DHB_NO_UNICODE_FUNCS -DMNG_BUILD_SO -DMNG_NO_INCLUDE_JNG -DPNG_NO_CONFIG_H
-DQT_BUILD_GUI_LIB -DQT_BUILTIN_GIF_READER -DQT_NO_CUPS -DQT_NO_DIRECTDRAW
-DQT_NO_GLIB -DQT_NO_LPR -DQT_NO_STYLE_GTK -DQT_NO_STYLE_MAC -DQT_SHARED
-DQT_USE_FREETYPE -DUNICODE
DEP_FILE = src\gui\CMakeFiles\CsGui.dir\dialogs\qcolordialog.cpp.obj.d
FLAGS = -Wa,-mbig-obj -g -std=gnu++1z
INCLUDES = -Isrc/gui -I../src/gui -I../src/3rdparty/libjpeg -I../src/3rdparty/libpng -I../src/3rdparty/libmng
-I../src/3rdparty/libtiff/libtiff -I../src/3rdparty/zlib -I../src/3rdparty/harfbuzz/src
-I../src/3rdparty/freetype/include/freetype -I../src/3rdparty/freetype/include -I../src/gui/widgets
-I../src/gui/util -I../src/gui/text -I../src/gui/styles -I../src/gui/statemachine -I../src/gui/printing
-I../src/gui/platform -I../src/gui/painting -I../src/gui/math3d -I../src/gui/kernel
-I../src/gui/itemviews -I../src/gui/image -I../src/gui/graphicsview -I../src/gui/effects
-I../src/gui/dialogs -I../src/gui/animation -I../src/gui/accessible -Iprivateinclude/QtGui/private
-Iinclude/QtGui -Iprivateinclude/QtCore/private -Iinclude/QtCore -Iprivateinclude -Iinclude
OBJECT_DIR = src\gui\CMakeFiles\CsGui.dir
OBJECT_FILE_DIR = src\gui\CMakeFiles\CsGui.dir\dialogs
RSP_FILE = src\gui\CMakeFiles\CsGui.dir\dialogs\qcolordialog.cpp.obj.rsp
------------------------------>
From Ninja output >
------------------------------>
[584/3850] Building CXX object src/gui/CMakeFiles/CsGui.dir/dialogs/qcolordialog.cpp.obj
FAILED: src/gui/CMakeFiles/CsGui.dir/dialogs/qcolordialog.cpp.obj
D:\DevApps\MinGW64\7.3\bin\c++.exe @src\gui\CMakeFiles\CsGui.dir\dialogs\qcolordialog.cpp.obj.rsp
-MD -MT src/gui/CMakeFiles/CsGui.dir/dialogs/qcolordialog.cpp.obj
-MF src\gui\CMakeFiles\CsGui.dir\dialogs\qcolordialog.cpp.obj.d
-o src/gui/CMakeFiles/CsGui.dir/dialogs/qcolordialog.cpp.obj
-c ../src/gui/dialogs/qcolordialog.cpp
D:/DevApps/MinGW64/7.3/bin/../lib/gcc/x86_64-w64-mingw32/7.3.0/../../../../x86_64-w64-mingw32/bin/as.exe:
src/gui/CMakeFiles/CsGui.dir/dialogs/qcolordialog.cpp.obj:
section .pdata$_ZNSt8__detail9__variant15_Variadic_unionIJPvSt10shared_ptrIN8QVariant10CustomTypeEEEEC1ILy1EJS3_I12CustomType_TIN7QAction8MenuRoleEEEEEESt16in_place_index_tIXT_EEDpOT0_: string table overflow at offset 10000004
D:\DevApps\MSys2\tmp\ccRRVbg4.s: Assembler messages:
D:\DevApps\MSys2\tmp\ccRRVbg4.s: Fatal error: can't close src/gui/CMakeFiles/CsGui.dir/dialogs/qcolordialog.cpp.obj: File too big
------------------------------------>
From qcolordialog.cpp.obj.rsp >
------------------------------------>
-DCsGui_EXPORTS -DFT2_BUILD_LIBRARY -DHAVE_ATEXIT -DHB_EXTERN="" -DHB_NDEBUG
-DHB_NO_UNICODE_FUNCS -DMNG_BUILD_SO -DMNG_NO_INCLUDE_JNG -DPNG_NO_CONFIG_H
-DQT_BUILD_GUI_LIB -DQT_BUILTIN_GIF_READER -DQT_NO_CUPS -DQT_NO_DIRECTDRAW
-DQT_NO_GLIB -DQT_NO_LPR -DQT_NO_STYLE_GTK -DQT_NO_STYLE_MAC -DQT_SHARED
-DQT_USE_FREETYPE -DUNICODE
-Isrc/gui -I../src/gui -I../src/3rdparty/libjpeg -I../src/3rdparty/libpng -I../src/3rdparty/libmng
-I../src/3rdparty/libtiff/libtiff -I../src/3rdparty/zlib -I../src/3rdparty/harfbuzz/src
-I../src/3rdparty/freetype/include/freetype -I../src/3rdparty/freetype/include -I../src/gui/widgets
-I../src/gui/util -I../src/gui/text -I../src/gui/styles -I../src/gui/statemachine -I../src/gui/printing
-I../src/gui/platform -I../src/gui/painting -I../src/gui/math3d -I../src/gui/kernel
-I../src/gui/itemviews -I../src/gui/image -I../src/gui/graphicsview -I../src/gui/effects
-I../src/gui/dialogs -I../src/gui/animation -I../src/gui/accessible -Iprivateinclude/QtGui/private
-Iinclude/QtGui -Iprivateinclude/QtCore/private -Iinclude/QtCore -Iprivateinclude -Iinclude
-Wa,-mbig-obj -g -std=gnu++1z