Bithack / principia

Open source physics-based sandbox game.
https://principia-web.se
Other
260 stars 25 forks source link

Remove `-rdynamic` linker flag #142

Closed griffi-gh closed 7 months ago

griffi-gh commented 8 months ago

Seems to fix debug builds on windows

rollerozxa commented 8 months ago

Just wondering, what does -rdynamic do and could we remove it for all platforms? I just brought it over from the old build flags, but if it doesn't do much we can just completely remove it.

griffi-gh commented 8 months ago

Just wondering, what does -rdynamic do and could we remove it for all platforms? I just brought it over from the old build flags, but if it doesn't do much we can just completely remove it.

im actually not sure... if i understand it correctly, it exports everything (even otherwise unused stuff) in the final binary, which probably makes debugging easier or something? (or required by some dbg tool?)

... If you use "dlopen" to load a dynamic object which needs to refer back to the symbols defined by the program, rather than some other dynamic object, then you will probably need to use this option when linking the program itself. ...

it's not used in release builds and only supported by ELF binaries....; so it can probably be safely removed; But I just did the most non-invasive change i could think of

rollerozxa commented 7 months ago

Linking a debug version of Principia with -rdynamic and without produces the exact same binary. So I assume it is entirely safe to remove for all platforms without any debug information being lost.