summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLoïc Guilloux <glx22@users.noreply.github.com>2021-12-28 21:08:09 +0100
committerGitHub <noreply@github.com>2021-12-28 21:08:09 +0100
commitc85557e553123a04506147ff54a5ffaddd6e8d87 (patch)
treefa173e75c23dc8048b6684e5364bac0ba6963e13
parent3ed7910cfe05e062d6279c303ac74078e8c1ce38 (diff)
downloadopenttd-c85557e553123a04506147ff54a5ffaddd6e8d87.tar.xz
Fix: [MinGW] Disable ASLR for x64 Debug builds (#9773)
-rw-r--r--cmake/CompileFlags.cmake5
1 files changed, 5 insertions, 0 deletions
diff --git a/cmake/CompileFlags.cmake b/cmake/CompileFlags.cmake
index 659a9ca72..ad4a46aca 100644
--- a/cmake/CompileFlags.cmake
+++ b/cmake/CompileFlags.cmake
@@ -43,6 +43,11 @@ macro(compile_flags)
add_link_options(
"$<$<NOT:$<CONFIG:Debug>>:-fstack-protector>" # Prevent undefined references when _FORTIFY_SOURCE > 0
)
+ if(CMAKE_SIZEOF_VOID_P EQUAL 8)
+ add_link_options(
+ "$<$<CONFIG:Debug>:-Wl,--disable-dynamicbase,--disable-high-entropy-va,--default-image-base-low>" # ASLR somehow breaks linking for x64 Debug builds
+ )
+ endif()
endif()
# Prepare a generator that checks if we are not a debug, and don't have asserts