diff --git a/src/coreclr/build-runtime.cmd b/src/coreclr/build-runtime.cmd index 71ab99aaccf24..b52037b80e438 100644 --- a/src/coreclr/build-runtime.cmd +++ b/src/coreclr/build-runtime.cmd @@ -433,10 +433,6 @@ 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 6d7edfb62ca70..34a42781ab2c8 100644 --- a/src/coreclr/pgosupport.cmake +++ b/src/coreclr/pgosupport.cmake @@ -59,11 +59,9 @@ 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) - # 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) + 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))