]> jfr.im git - irc/hexchat/hexchat.git/commitdiff
win32: Disable ASLR for Windows debug builds
authordelthas <redacted>
Sun, 19 Apr 2020 21:59:26 +0000 (23:59 +0200)
committerPatrick <redacted>
Sun, 19 Apr 2020 23:13:18 +0000 (16:13 -0700)
GDB is usually able to debug executables with ASLR by temporarily
disabling ASLR when running that executable. This is only supported on
Linux. On Windows, GDB cannot debug ASLR executables.

This removes the dynamicbase linker flag on Windows for debug builds in
order to be able to debug that executable later.

Hardening an executable with ASLR is important for release builds, but
for debug builds being able to debug is much more important.

meson.build

index 645e685ee2a726b704bd673aacb252a9e86657be..9b33574b6d95ece8f4793f6523fd26162da763cc 100644 (file)
@@ -134,9 +134,11 @@ test_ldflags = [
   '-Wl,-z,relro',
   '-Wl,-z,now',
   # mingw
-  '-Wl,--dynamicbase',
   '-Wl,--nxcompat',
 ]
+if not (host_machine.system() == 'windows' and get_option('debug'))
+ test_ldflags += '-Wl,--dynamicbase'
+endif
 foreach ldflag : test_ldflags
   if meson.version().version_compare('>= 0.46.0')
     has_arg = cc.has_link_argument(ldflag)