• Dear Cerberus X User!

    As we prepare to transition the forum ownership from Mike to Phil (TripleHead GmbH), we need your explicit consent to transfer your user data in accordance with our amended Terms and Rules in order to be compliant with data protection laws.

    Important: If you accept the amended Terms and Rules, you agree to the transfer of your user data to the future forum owner!

    Please read the new Terms and Rules below, check the box to agree, and click "Accept" to continue enjoying your Cerberus X Forum experience. The deadline for consent is April 5, 2024.

    Do not accept the amended Terms and Rules if you do not wish your personal data to be transferred to the future forum owner!

    Accepting ensures:

    - Continued access to your account with a short break for the actual transfer.

    - Retention of your data under the same terms.

    Without consent:

    - You don't have further access to your forum user account.

    - Your account and personal data will be deleted after April 5, 2024.

    - Public posts remain, but usernames indicating real identity will be anonymized. If you disagree with a fictitious name you have the option to contact us so we can find a name that is acceptable to you.

    We hope to keep you in our community and see you on the forum soon!

    All the best

    Your Cerberus X Team

Bug "File too big" in debug mode

olive

Member
3rd Party Module Dev
Tutorial Author
Patreon Bronze
Joined
Jul 17, 2017
Messages
76
I'm porting over my rather-large project from Monkey to Cerberus, and getting a new error when I compile for glfw in debug mode:

Semanting...
Translating...
Building...
g++ -m64 -O0 -Wno-free-nonheap-object -I../curl/include -I../glfw3/include -I../glfw3/src -I../openal/include -I../stb -I../zlib-1.2.8 -I../lpng1610 -c -o build/Debug64/main.o ../main.cpp
C:/MinGW/bin/........./x86_64-w64-mingw32/bin/as.exe: build/Debug64/main.o: too many sections (43479)
C:\.........\gcc_winnt\build\Debug64\ccr26HyC.s: Assembler messages:
C:\.........\gcc_winnt\build\Debug64\ccr26HyC.s: Fatal error: can't write build/Debug64/main.o: File too big
C:/........./x86_64-w64-mingw32/bin/as.exe: build/Debug64/main.o: too many sections (43479)
C:\.........\gcc_winnt\build\Debug64\ccr26HyC.s: Fatal error: can't close build/Debug64/main.o: File too big
Makefile:59: recipe for target 'build/Debug64/main.o' failed
mingw32-make: *** [build/Debug64/main.o] Error 1
TRANS FAILED: Error executing 'mingw32-make CCOPTS=" -m64 -O0" LDOPTS=" -m64 -LC:/Cerberus/libs/Win64" LIBOPTS=" -lopenal32 -lcurldll" OUT="Debug64/CerberusGame"', return code=2
Abnormal program termination.
Exit code: -1

(truncated for clarity & emphasis mine)

Compiles in html5 fine, and release-mode for glfw. I'm on windows. Any thoughts?
 
Last edited:
This is one of the major flaws with how Monkey/Cerberus works when using any GCC compiler. You will have to use a Visual Studio compiler to compile large projects. The original design of Monkey using MinGW as far as I can gather, was only meant to be used to compile simple command line applications such as transcc. I guess the main reason MinGW was chosen over the Microsoft native compiler tool chains (not MSBUILD) for this task was that it requires a bit of shell environment trickery to set up.

Google: MinGW object file too large too many sections.

One solution would be to have the debug information as an external file, thus reducing the size of the object file.
 
did it compile fine in debug mode in MX?
Excellent question, should have double-checked before I posted. But yeah, I just compiled it with Ted in MX versus CX, and I only get the error in CX debug mode.

For comparison, here's the readout I get when compiling in MX debug mode (again, which works):
Semanting...
Translating...
Building...
g++ -m32 -O0 -Wno-free-nonheap-object -I../glfw3/include -I../glfw3/src -I../openal/include -I../stb -I../zlib-1.2.8 -I../lpng1610 -c -o build/Debug32/main.o ../main.cpp
g++ -m32 -Wl,--subsystem,windows -L../openal/libs/Win32 -L../openal/libs/Win64 -o Debug32/MonkeyGame build/Debug32/context.o build/Debug32/init.o build/Debug32/input.o build/Debug32/monitor.o build/Debug32/wgl_context.o build/Debug32/win32_init.o build/Debug32/win32_monitor.o build/Debug32/win32_time.o build/Debug32/win32_tls.o build/Debug32/win32_window.o build/Debug32/window.o build/Debug32/winmm_joystick.o build/Debug32/stb_vorbis.o build/Debug32/stb_image.o build/Debug32/main.o -lcomdlg32 -lgdi32 -lopengl32 -lOpenAL32 -lws2_32

Compiler commands are pretty much black magic to me, but is there a difference between the -m64 in the CX message versus -m32 in MX?

@dawlane:
Thanks --- I found this stackoverflow. They say to "pass -Wa,-mbig-obj to gcc", but I'm really not sure how to do that. Or, alternatively, how I'd go about telling CX to use a visual studio compiler. I see a couple of references in the mojolabs archives (one two three), do you think I should just poke around and try to follow those directions?
 
Thanks --- I found this stackoverflow. They say to "pass -Wa,-mbig-obj to gcc", but I'm really not sure how to do that. Or, alternatively, how I'd go about telling CX to use a visual studio compiler. I see a couple of references in the mojolabs archives (one two three), do you think I should just poke around and try to follow those directions?

Online Docs App configs.

#GLFW_USE_MINGW=True 'Set to false on Windows to use MSVC instead of MinGW to build glfw apps. Needs VS 2015 installed.
#GLFW_GCC_CC_OPTS="" 'Pass compiler options to GCC type compilers
#GLFW_GCC_LD_OPTS="" 'Pass linker options to GCC type compilers

but is there a difference between the -m64 in the CX message versus -m32 in MX?
From https://gcc.gnu.org/onlinedocs/gcc/x86-Options.html#x86-Options
These ‘-m’ switches are supported in addition to the above on x86-64 processors in 64-bit environments.

-m32
-m64
-mx32
-m16
-miamcu
Generate code for a 16-bit, 32-bit or 64-bit environment. The -m32 option sets int, long, and pointer types to 32 bits, and generates code that runs on any i386 system.

The -m64 option sets int to 32 bits and long and pointer types to 64 bits, and generates code for the x86-64 architecture. For Darwin only the -m64 option also turns off the -fno-pic and -mdynamic-no-pic options.

The -mx32 option sets int, long, and pointer types to 32 bits, and generates code for the x86-64 architecture.

The -m16 option is the same as -m32, except for that it outputs the .code16gcc assembly directive at the beginning of the assembly output so that the binary can run in 16-bit mode.

The -miamcu option generates code which conforms to Intel MCU psABI. It requires the -m32 option to be turned on.
 
Last edited:
Back
Top Bottom