Re: [hatari-devel] Enabling _FORTIFY_SOURCE for Debug builds? |
[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-devel Archives ]
Hi, On 14.4.2024 12.26, Thomas Huth wrote:
Am Sun, 14 Apr 2024 11:47:25 +0300On 13.4.2024 22.53, Thomas Huth wrote:Weird, I'm using 3.27.7 (on Fedora), and for me, it does not add the -O0 after the -g ... but OK, if there are versions that add -O0 automatically, it's likely better to remove the -D_FORTIFY_SOURCE again. Done now.Why you moved FORTIFY_SOURCE behind Debug check few months ago: https://github.com/hatari/hatari/commit/adc8ae2c9d0a28886e8f70f24ebfceb5097e54a0 ? The reason for it being in the options was catching things before release i.e. before distros package new Hatari release and complain about things it warns about (some distros enable FORTIFY_SOURCE for packages, and Mac tooling also enables some similar checks).
Ubuntu enables it by default, Debian does not: * https://wiki.ubuntu.com/ToolChain/CompilerFlags#A-D_FORTIFY_SOURCE.3D3* https://salsa.debian.org/toolchain-team/gcc/-/blob/master/debian/patches/gcc-distro-specs.diff?ref_type=heads#L84 * https://salsa.debian.org/toolchain-team/gcc/-/blob/master/debian/rules.patch?ref_type=heads#L326
=> Wouldn't it have made more sense to invert your Debug check?Sorry, I don't quite get your suggestion... you noticed that the line was completely commented out before adc8ae2c9d0a288, did you?
Oh, I completely missed that (red-on-black "git show" uses for removed lines is not as visible as green-on-black it uses for additions)!
But for reasons I mentioned, maybe it would still be useful to enable it when _not_ doing Debug build?
- Eero
Mail converted by MHonArc 2.6.19+ | http://listengine.tuxfamily.org/ |