notaz / picodrive

Fast MegaDrive/MegaCD/32X emulator
Other
291 stars 165 forks source link

Makefile: Only set -g for debug builds. #62

Closed orbea closed 6 years ago

orbea commented 6 years ago

I think -g is only needed for debug builds. Also setting -O0 is a little bit more explicit.

notaz commented 6 years ago

Actually it's intentionally done that way, I want debug symbols in release builds as some bugs/crashes only show up when optimizations are on. It results in larger binaries, yes, but the symbols are not loaded in memory on runtime (they're only read by debuggers), and with today's storage sizes and Internet speeds I don't think larger binary is a problem. The other benefit is that anyone can produce a nice backtrace anytime without having to rebuild if they experience a crash.

orbea commented 6 years ago

Hi, thanks for the response. If you really prefer it this way that is fine, but I suspect it will not work out as planned in many scenarios. A lot of distros strip out symbols from compiled binaries, this is the case for Slackware and also is true for the libretro build bot meaning anyone who gets picodrive from those sources will still have to specifically build it with debugging symbols and then not strip the binaries. Additionally backtraces without optimizations in many cases will prove more useful.

notaz commented 6 years ago

Well how the distros ship is up to them, I ship my builds for the platforms I maintain with debug symbols.

Some distros (like Debian family) build release builds with debug symbols and then split the debug sections into separate files and -dbg packages, so the way the makefile is now is what they would actually need.

orbea commented 6 years ago

Alright, I will close this. It can always be revisited in the future if need be.