Disable ASLR when building RemoteVstPlugin on Windows (#7976)

Disable ASLR when building RemoteVstPlugin executables on Windows in order to fix crashes when using certain VSTs

---------

Co-authored-by: Dalton Messmer <messmer.dalton@gmail.com>
This commit is contained in:
Fastigium
2025-08-14 22:07:45 +02:00
committed by GitHub
parent 981e266613
commit 4aed2a8e5b

View File

@@ -71,6 +71,21 @@ if(MSVC)
target_link_options(${EXE_NAME} PRIVATE "/entry:mainCRTStartup")
endif()
# If we're building a Windows executable, add linker flags to disable ASLR
# This is needed because several old VST dlls crash when ASLR is in use (see bug #7830)
if(MSVC)
target_link_options(${EXE_NAME} PRIVATE "/DYNAMICBASE:NO")
if(BITNESS EQUAL 64)
target_link_options(${EXE_NAME} PRIVATE "/HIGHENTROPYVA:NO")
endif()
elseif(IS_MINGW)
if(BITNESS EQUAL 32)
target_link_options(${EXE_NAME} PRIVATE "-Wl,--disable-dynamicbase")
else()
target_link_options(${EXE_NAME} PRIVATE "-Wl,--disable-dynamicbase,--disable-high-entropy-va")
endif()
endif()
if(IS_MINGW)
SET(CMAKE_REQUIRED_FLAGS "-std=c++20")
endif()