From c85557e553123a04506147ff54a5ffaddd6e8d87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Guilloux?= Date: Tue, 28 Dec 2021 21:08:09 +0100 Subject: [PATCH] Fix: [MinGW] Disable ASLR for x64 Debug builds (#9773) --- cmake/CompileFlags.cmake | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cmake/CompileFlags.cmake b/cmake/CompileFlags.cmake index 659a9ca724..ad4a46aca7 100644 --- a/cmake/CompileFlags.cmake +++ b/cmake/CompileFlags.cmake @@ -43,6 +43,11 @@ macro(compile_flags) add_link_options( "$<$>:-fstack-protector>" # Prevent undefined references when _FORTIFY_SOURCE > 0 ) + if(CMAKE_SIZEOF_VOID_P EQUAL 8) + add_link_options( + "$<$:-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