File tree Expand file tree Collapse file tree 4 files changed +28
-11
lines changed Expand file tree Collapse file tree 4 files changed +28
-11
lines changed Original file line number Diff line number Diff line change @@ -47,6 +47,25 @@ foreach(var ${export_variables})
47
47
_export_var_to_external(${var} )
48
48
endforeach ()
49
49
50
+ # If we're building wine-powered RemoteVstPlugins for Linux,
51
+ # use a custom winebuild to fix ASLR-related VST crashes.
52
+ # See upstream bug report: https://bugs.winehq.org/show_bug.cgi?id=58480
53
+ if (LMMS_BUILD_LINUX AND (LMMS_HAVE_VST_32 OR LMMS_HAVE_VST_64))
54
+ ExternalProject_Add(wine
55
+ GIT_REPOSITORY https://github.com/tresf/wine
56
+ GIT_TAG 1f8bb63e75baa5c9f901c8f50b4ea9dd69e0baa0
57
+ GIT_SHALLOW ON
58
+ SOURCE_DIR "${CMAKE_CURRENT_BINARY_DIR} /wine"
59
+ SOURCE_SUBDIR tools/winebuild
60
+ BUILD_ALWAYS ON
61
+ BUILD_IN_SOURCE ON
62
+ INSTALL_COMMAND ""
63
+ )
64
+ ExternalProject_Get_Property(wine SOURCE_DIR)
65
+ set (CUSTOM_WINEBUILD_EXECUTABLE "${SOURCE_DIR} /tools/winebuild/winebuild" )
66
+ message (STATUS "Using custom winebuild: ${CUSTOM_WINEBUILD_EXECUTABLE} " )
67
+ endif ()
68
+
50
69
# build 32 bit version of RemoteVstPlugin
51
70
if (LMMS_HAVE_VST_32)
52
71
INCLUDE ("${CMAKE_CURRENT_LIST_DIR} /RemoteVstPlugin32.cmake" )
Original file line number Diff line number Diff line change @@ -72,18 +72,12 @@ if(MSVC)
72
72
endif ()
73
73
74
74
# If we're building a Windows executable, add linker flags to disable ASLR
75
- # This is needed because several old VST dlls crash when ASLR is in use (see bug #7830)
75
+ # This is needed because several old VST dlls crash when high entropy ASLR is in use
76
+ # /HIGHENTROPYVA:YES relies on /DYNAMICBASE:YES so this ensures maximum VST compatiblity
76
77
if (MSVC )
77
78
target_link_options (${EXE_NAME} PRIVATE "/DYNAMICBASE:NO" )
78
- if (BITNESS EQUAL 64)
79
- target_link_options (${EXE_NAME} PRIVATE "/HIGHENTROPYVA:NO" )
80
- endif ()
81
79
elseif (IS_MINGW)
82
- if (BITNESS EQUAL 32)
83
- target_link_options (${EXE_NAME} PRIVATE "-Wl,--disable-dynamicbase" )
84
- else ()
85
- target_link_options (${EXE_NAME} PRIVATE "-Wl,--disable-dynamicbase,--disable-high-entropy-va" )
86
- endif ()
80
+ target_link_options (${EXE_NAME} PRIVATE "-Wl,--disable-dynamicbase" )
87
81
endif ()
88
82
89
83
if (IS_MINGW)
Original file line number Diff line number Diff line change @@ -34,7 +34,9 @@ ELSEIF(LMMS_BUILD_LINUX)
34
34
CMAKE_ARGS
35
35
"${EXTERNALPROJECT_CMAKE_ARGS} "
36
36
"-DCMAKE_CXX_COMPILER=${WINEGCC} "
37
- "-DCMAKE_CXX_FLAGS=-m32"
37
+ # Pass /DYNAMICBASE:NO to custom winebuild per #7987
38
+ "-DCMAKE_CXX_FLAGS=-m32 --winebuild \" ${CUSTOM_WINEBUILD_EXECUTABLE} \" -Wb,--disable-dynamicbase"
39
+ DEPENDS wine
38
40
)
39
41
40
42
INSTALL (PROGRAMS "${CMAKE_CURRENT_BINARY_DIR} /../32/RemoteVstPlugin32" "${CMAKE_CURRENT_BINARY_DIR} /../32/RemoteVstPlugin32.exe.so" DESTINATION "${PLUGIN_DIR} /32" )
Original file line number Diff line number Diff line change @@ -9,7 +9,9 @@ ELSEIF(LMMS_BUILD_LINUX)
9
9
CMAKE_ARGS
10
10
"${EXTERNALPROJECT_CMAKE_ARGS} "
11
11
"-DCMAKE_CXX_COMPILER=${WINEGCC} "
12
- "-DCMAKE_CXX_FLAGS=${CXX_FLAGS} "
12
+ # Pass /DYNAMICBASE:NO to custom winebuild per #7987
13
+ "-DCMAKE_CXX_FLAGS=${CXX_FLAGS} --winebuild \" ${CUSTOM_WINEBUILD_EXECUTABLE} \" -Wb,--disable-dynamicbase"
14
+ DEPENDS wine
13
15
)
14
16
INSTALL (PROGRAMS "${CMAKE_CURRENT_BINARY_DIR} /../RemoteVstPlugin64" "${CMAKE_CURRENT_BINARY_DIR} /../RemoteVstPlugin64.exe.so" DESTINATION "${PLUGIN_DIR} " )
15
17
ENDIF ()
You can’t perform that action at this time.
0 commit comments