diff --git a/eng/native/configurecompiler.cmake b/eng/native/configurecompiler.cmake index 0be4937c7f8d4..70685a048aea0 100644 --- a/eng/native/configurecompiler.cmake +++ b/eng/native/configurecompiler.cmake @@ -56,6 +56,9 @@ add_compile_definitions("$<$,$>:NDEB if (MSVC) add_linker_flag(/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 9ef90525dda8b..7ca232ee4b8e7 100644 --- a/eng/native/ijw/IJW.cmake +++ b/eng/native/ijw/IJW.cmake @@ -70,6 +70,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) diff --git a/src/coreclr/build-runtime.cmd b/src/coreclr/build-runtime.cmd index ec6887c78d84c..7e85e50f9de4d 100644 --- a/src/coreclr/build-runtime.cmd +++ b/src/coreclr/build-runtime.cmd @@ -428,6 +428,10 @@ if %__BuildNative% EQU 1 ( goto ExitWithCode ) + @REM Temporarily disabling PGO until updated files with new linker flag are available. + @REM https://github.com/dotnet/runtime/pull/89311 + GOTO :SkipNativeBuild + if %__EnforcePgo% EQU 1 ( set PgoCheckCmd="!PYTHON!" "!__ProjectDir!\scripts\pgocheck.py" "!__BinDir!\coreclr.dll" "!__BinDir!\clrjit.dll" echo !PgoCheckCmd! diff --git a/src/coreclr/pgosupport.cmake b/src/coreclr/pgosupport.cmake index 719ac14ad990b..a0a2b2ab305dd 100644 --- a/src/coreclr/pgosupport.cmake +++ b/src/coreclr/pgosupport.cmake @@ -59,9 +59,11 @@ function(add_pgo TargetName) message("Cannot use PGO optimization built with Ninja from MSBuild. Re-run build with Ninja to apply PGO information") else(NOT EXISTS ${ProfilePath}) if(CLR_CMAKE_HOST_WIN32) - set_property(TARGET ${TargetName} APPEND_STRING PROPERTY LINK_FLAGS_RELEASE " /LTCG /USEPROFILE:PGD=\"${ProfilePath}\"") - set_property(TARGET ${TargetName} APPEND_STRING PROPERTY LINK_FLAGS_RELWITHDEBINFO " /LTCG /USEPROFILE:PGD=\"${ProfilePath}\"") - add_compile_definitions(WITH_NATIVE_PGO) + # Temporarily disabling PGO until updated files with new linker flag are available. + # https://github.com/dotnet/runtime/pull/89311 + # set_property(TARGET ${TargetName} APPEND_STRING PROPERTY LINK_FLAGS_RELEASE " /LTCG /USEPROFILE:PGD=\"${ProfilePath}\"") + # set_property(TARGET ${TargetName} APPEND_STRING PROPERTY LINK_FLAGS_RELWITHDEBINFO " /LTCG /USEPROFILE:PGD=\"${ProfilePath}\"") + # add_compile_definitions(WITH_NATIVE_PGO) else(CLR_CMAKE_HOST_WIN32) if(UPPERCASE_CMAKE_BUILD_TYPE STREQUAL RELEASE OR UPPERCASE_CMAKE_BUILD_TYPE STREQUAL RELWITHDEBINFO) if((CMAKE_CXX_COMPILER_ID MATCHES "Clang") AND (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 16))