diff --git a/eng/native/configurecompiler.cmake b/eng/native/configurecompiler.cmake index 24ab3c8cd96bb1..2844ba66293dda 100644 --- a/eng/native/configurecompiler.cmake +++ b/eng/native/configurecompiler.cmake @@ -70,6 +70,9 @@ if (MSVC) add_compile_options($<$:$>) add_link_options($<$>:/guard:cf>) + # Load all imported DLLs from the System32 directory. + add_linker_flag(/DEPENDENTLOADFLAG:0x800) + # Linker flags # set (WINDOWS_SUBSYSTEM_VERSION 6.01) diff --git a/eng/native/ijw/IJW.cmake b/eng/native/ijw/IJW.cmake index 4d145a68470a89..2529ec596f3bc3 100644 --- a/eng/native/ijw/IJW.cmake +++ b/eng/native/ijw/IJW.cmake @@ -64,6 +64,10 @@ if (CLR_CMAKE_HOST_WIN32) remove_ijw_incompatible_options("${dirCompileOptions}" dirCompileOptions) set_directory_properties(PROPERTIES COMPILE_OPTIONS "${dirCompileOptions}") + # IJW tests needs to load DLLs from somewhere other than System32 + string(REPLACE "/DEPENDENTLOADFLAG:0x800" "" CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}") + string(REPLACE "/DEPENDENTLOADFLAG:0x800" "" CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS}") + set(CLR_SDK_REF_PACK_OUTPUT "") set(CLR_SDK_REF_PACK_DISCOVERY_ERROR "") set(CLR_SDK_REF_PACK_DISCOVERY_RESULT 0)