Problem with code generated with cmake vs. make files
Posted: Wed Feb 07, 2018 12:14 pm
I tried creating cmake files for my old GBA project to have a bit more convenience and flexibility. I have the problem though, that the code generated with the CMake files is not the same as with the regular Makefiles - The later works, but the CMake-generated .gba crashes in the emulator after a short while, although compiler and linker options "should be" the same.
I diff'ed the object files. The all the object files generated by the assembler (from .s) are binary identical. The data object files, generated with the MaxMOD utility are binary identical. Some of the object files generated from .cpp files are identical, except the order of the compiler arguments (in the .o file due to debug output generated by "-g"). Some object files generated from .cpp are very different though and I got no idea why. Also the .elfs differ slightly in size and are linked differently when you take a look at the .map files generated.
The .gba crashes in the player routines somewhere in the emulator (visualboyadvance-m 2.0.1 on Ubuntu) with a noticeable click in the music. If I comment out the MaxMOD player routines (as-in setting IRQs, vblank-handlers etc. up, but simply not calling mmStart() to play a mod), the CMake-generated .gba does not crash...
I attached a zip with the build files and the .map, .elf and .gba files generated. I would appreciate if someone had a clue as to why the code generated is different and what could cause the problem.
I diff'ed the object files. The all the object files generated by the assembler (from .s) are binary identical. The data object files, generated with the MaxMOD utility are binary identical. Some of the object files generated from .cpp files are identical, except the order of the compiler arguments (in the .o file due to debug output generated by "-g"). Some object files generated from .cpp are very different though and I got no idea why. Also the .elfs differ slightly in size and are linked differently when you take a look at the .map files generated.
The .gba crashes in the player routines somewhere in the emulator (visualboyadvance-m 2.0.1 on Ubuntu) with a noticeable click in the music. If I comment out the MaxMOD player routines (as-in setting IRQs, vblank-handlers etc. up, but simply not calling mmStart() to play a mod), the CMake-generated .gba does not crash...
I attached a zip with the build files and the .map, .elf and .gba files generated. I would appreciate if someone had a clue as to why the code generated is different and what could cause the problem.