From ff9ff4115a9ff47002c152e3e2cefce39ce5be8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Strehovsk=C3=BD?= Date: Wed, 11 Dec 2024 14:54:25 +0100 Subject: [PATCH] Generate CFG-enabled VxSortDisabled flavor of runtime libs I haven't done this originally but CFG enabled is starting to be popular and this is an easy 100 kB saving. We could also build a server GC less flavor of the runtime (another 250 kB saving), but that slows down the build by several seconds so not sure if we want that tradeoff for dev innerloop. --- .../BuildIntegration/Microsoft.NETCore.Native.Windows.targets | 2 +- src/coreclr/nativeaot/Runtime/Full/CMakeLists.txt | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Windows.targets b/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Windows.targets index 67a2686336514b..0a071e6cf01acc 100644 --- a/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Windows.targets +++ b/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Windows.targets @@ -25,7 +25,7 @@ The .NET Foundation licenses this file to you under the MIT license. bootstrapper bootstrapperdll Runtime.VxsortEnabled - Runtime.VxsortDisabled + Runtime.VxsortDisabled standalonegc-disabled standalonegc-enabled wmainCRTStartup diff --git a/src/coreclr/nativeaot/Runtime/Full/CMakeLists.txt b/src/coreclr/nativeaot/Runtime/Full/CMakeLists.txt index f717c2786e0a2f..4ecf60ae384b80 100644 --- a/src/coreclr/nativeaot/Runtime/Full/CMakeLists.txt +++ b/src/coreclr/nativeaot/Runtime/Full/CMakeLists.txt @@ -67,6 +67,8 @@ if (CLR_CMAKE_TARGET_WIN32) if (CLR_CMAKE_TARGET_ARCH_AMD64) add_library(Runtime.VxsortEnabled.GuardCF STATIC ${VXSORT_SOURCES}) set_target_properties(Runtime.VxsortEnabled.GuardCF PROPERTIES CLR_CONTROL_FLOW_GUARD ON) + add_library(Runtime.VxsortDisabled.GuardCF STATIC ${DUMMY_VXSORT_SOURCES}) + set_target_properties(Runtime.VxsortDisabled.GuardCF PROPERTIES CLR_CONTROL_FLOW_GUARD ON) endif (CLR_CMAKE_TARGET_ARCH_AMD64) set_target_properties(aotminipal PROPERTIES @@ -135,5 +137,6 @@ if (CLR_CMAKE_TARGET_ARCH_AMD64) install_static_library(Runtime.VxsortDisabled aotsdk nativeaot) if (CLR_CMAKE_TARGET_WIN32) install_static_library(Runtime.VxsortEnabled.GuardCF aotsdk nativeaot) + install_static_library(Runtime.VxsortDisabled.GuardCF aotsdk nativeaot) endif (CLR_CMAKE_TARGET_WIN32) endif (CLR_CMAKE_TARGET_ARCH_AMD64)