From 8d21bf42ab28eba6a0e5eed57b2c12f20f0ac788 Mon Sep 17 00:00:00 2001 From: narknon Date: Sat, 22 Jun 2024 12:07:22 -0400 Subject: [PATCH 1/2] STL updates Mutex Fix https://github.com/microsoft/STL/pull/3824 https://github.com/microsoft/STL/pull/4000 https://github.com/microsoft/STL/pull/4339 Add escape hatch due to STL change resulting in issues with binary compatibility. https://github.com/microsoft/STL/wiki/Changelog "Fixed bugs: Fixed mutex's constructor to be constexpr. #3824 #4000 #4339 Note: Programs that aren't following the documented restrictions on binary compatibility may encounter null dereferences in mutex machinery. You must follow this rule: When you mix binaries built by different supported versions of the toolset, the Redistributable version must be at least as new as the latest toolset used by any app component. You can define _DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR as an escape hatch." --- tools/xmakescripts/rules/build_rules.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/xmakescripts/rules/build_rules.lua b/tools/xmakescripts/rules/build_rules.lua index 194d2849d..0a44ce2a7 100644 --- a/tools/xmakescripts/rules/build_rules.lua +++ b/tools/xmakescripts/rules/build_rules.lua @@ -109,6 +109,9 @@ local MSVC_COMPILE_OPTIONS = { }, ["shflags"] = { "/DEBUG:FULL" + }, + ["defines"] = { + "_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR=1" } } From bc157e88e55aebcabda5ae9abc452a3e74ae4be3 Mon Sep 17 00:00:00 2001 From: narknon <73571427+narknon@users.noreply.github.com> Date: Thu, 27 Jun 2024 14:01:36 -0400 Subject: [PATCH 2/2] Add mutex fix for polyhook --- deps/third-repo/packages/p/polyhook_2/CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/deps/third-repo/packages/p/polyhook_2/CMakeLists.txt b/deps/third-repo/packages/p/polyhook_2/CMakeLists.txt index f502acff3..196334bc4 100644 --- a/deps/third-repo/packages/p/polyhook_2/CMakeLists.txt +++ b/deps/third-repo/packages/p/polyhook_2/CMakeLists.txt @@ -4,6 +4,9 @@ include(FetchContent) set(FETCHCONTENT_QUIET OFF) +# Add the preprocessor definition to fix mutex +add_definitions(-D_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR) + FetchContent_Declare(PolyHook2 GIT_REPOSITORY https://github.com/stevemk14ebr/PolyHook_2_0.git GIT_TAG fd2a88f09c8ae89440858fc52573656141013c7f