From a2ab6834f008581a9708c17b40ceb9fd29189ed7 Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Thu, 27 Apr 2023 18:22:06 +0000 Subject: [PATCH 1/3] Prefer lld in NativeAot when using clang This detects availability of lld and prefers it, when using clang. If not found, falls back on bfd as before. --- .../Microsoft.NETCore.Native.Unix.targets | 14 +++++++++++--- .../Microsoft.NETCore.Native.targets | 4 ++-- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Unix.targets b/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Unix.targets index bb457c8c166bc..71d9b1ef51bb9 100644 --- a/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Unix.targets +++ b/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Unix.targets @@ -22,7 +22,6 @@ The .NET Foundation licenses this file to you under the MIT license. --flat <_SymbolPrefix Condition="'$(_IsApplePlatform)' == 'true'">_ lld - bfd @@ -104,7 +103,6 @@ The .NET Foundation licenses this file to you under the MIT license. - @@ -180,11 +178,21 @@ The .NET Foundation licenses this file to you under the MIT license. - + + + lld + bfd + + + + + + <_LinkerVersion>$([System.Text.RegularExpressions.Regex]::Match($(_LinkerVersionString), '[1-9]\d*')) diff --git a/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.targets b/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.targets index 2ead5803e5cea..0d5451a5b1f1f 100644 --- a/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.targets +++ b/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.targets @@ -321,7 +321,7 @@ The .NET Foundation licenses this file to you under the MIT license. - + @@ -340,7 +340,7 @@ The .NET Foundation licenses this file to you under the MIT license. - + From a1d7be84c1f9f6acb3ffc95938bd8f28ddc47cc2 Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Thu, 27 Apr 2023 18:30:29 +0000 Subject: [PATCH 2/3] Remove LinkerFlavor settings from runtime build --- eng/testing/tests.singlefile.targets | 1 - src/coreclr/tools/aot/crossgen2/crossgen2.csproj | 5 ----- src/tests/Directory.Build.targets | 1 - 3 files changed, 7 deletions(-) diff --git a/eng/testing/tests.singlefile.targets b/eng/testing/tests.singlefile.targets index 5fb0e1bd643ea..232114834721a 100644 --- a/eng/testing/tests.singlefile.targets +++ b/eng/testing/tests.singlefile.targets @@ -29,7 +29,6 @@ $(CoreCLRAotSdkDir) $(NetCoreAppCurrentTestHostSharedFrameworkPath) $(NetCoreAppCurrentTestHostSharedFrameworkPath) - lld $(NoWarn);IL1005;IL2105;IL3000;IL3001;IL3002;IL3003 partial true diff --git a/src/coreclr/tools/aot/crossgen2/crossgen2.csproj b/src/coreclr/tools/aot/crossgen2/crossgen2.csproj index e19cbbeae9f6e..a18ff70964a1d 100644 --- a/src/coreclr/tools/aot/crossgen2/crossgen2.csproj +++ b/src/coreclr/tools/aot/crossgen2/crossgen2.csproj @@ -88,11 +88,6 @@ - - clang - lld - - $(MicrosoftNetCoreAppRuntimePackNativeDir) $(OutputRID) - lld $(ROOTFS_DIR) true true From c21d315b11b69423903cf13f04068cb93b14ad39 Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Fri, 28 Apr 2023 15:46:17 +0000 Subject: [PATCH 3/3] Fix logic to work with overridden CppLinker Also use CppCompilerAndLinker to match existing pattern --- .../BuildIntegration/Microsoft.NETCore.Native.Unix.targets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Unix.targets b/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Unix.targets index 71d9b1ef51bb9..558a37784fb11 100644 --- a/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Unix.targets +++ b/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Unix.targets @@ -178,7 +178,7 @@ The .NET Foundation licenses this file to you under the MIT license. -