From a7f46777f30f035a3003cddb45af7c27d2b77733 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Strehovsk=C3=BD?= Date: Fri, 16 Jun 2023 14:25:31 +0900 Subject: [PATCH] Build integration support for Bionic in NativeAOT (#87595) Doesn't actually work E2E because the inline threadstatics work broke our Android support (the one added in https://github.com/dotnet/corert/pull/8323). ``` C:\Users\michals\.nuget\packages\microsoft.netcore.app.runtime.nativeaot.linux-bionic-arm64\8.0.0-preview.6.23307.4/r untimes/linux-bionic-arm64/\native\libRuntime.WorkstationGC.a(MiscStubs.S.o): In function `RhpGetInlinedThreadStaticB ase': /__w/1/s/src/coreclr/nativeaot/Runtime/arm64/MiscStubs.S:12: undefined reference to `tls_InlinedThreadStatics' /__w/1/s/src/coreclr/nativeaot/Runtime/arm64/MiscStubs.S:12: undefined reference to `tls_InlinedThreadStatics' /__w/1/s/src/coreclr/nativeaot/Runtime/arm64/MiscStubs.S:12: undefined reference to `tls_InlinedThreadStatics' /__w/1/s/src/coreclr/nativeaot/Runtime/arm64/MiscStubs.S:12: undefined reference to `tls_InlinedThreadStatics' ``` --- Directory.Build.props | 1 + ...osoft.DotNet.ILCompiler.SingleEntry.targets | 1 + .../Microsoft.NETCore.Native.Unix.targets | 18 ++++++++++++------ 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index 66120a0e9db69..144752e8d9f9c 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -54,6 +54,7 @@ - eng/native/build-commons.sh - src/native/libs/build-native.sh - src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/ObjectWriter.cs + - src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Unix.targets - src/installer/pkg/sfx/bundle/shared-framework-distribution-template-x64.xml - src/installer/pkg/sfx/bundle/shared-framework-distribution-template-arm64.xml --> diff --git a/src/coreclr/nativeaot/BuildIntegration/Microsoft.DotNet.ILCompiler.SingleEntry.targets b/src/coreclr/nativeaot/BuildIntegration/Microsoft.DotNet.ILCompiler.SingleEntry.targets index 43cdfe872bba1..178d8aaa93aa9 100644 --- a/src/coreclr/nativeaot/BuildIntegration/Microsoft.DotNet.ILCompiler.SingleEntry.targets +++ b/src/coreclr/nativeaot/BuildIntegration/Microsoft.DotNet.ILCompiler.SingleEntry.targets @@ -21,6 +21,7 @@ <_targetPackageName>runtime.$(_targetOS)-$(_targetArchitecture).Microsoft.DotNet.ILCompiler + <_linuxLibcFlavor Condition="$(_targetOS.StartsWith('linux-'))">$(_targetOS.SubString(6)) <_targetOS Condition="$(_targetOS.StartsWith('linux'))">linux diff --git a/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Unix.targets b/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Unix.targets index d758e3b9d27fa..c2cdf1613aaf8 100644 --- a/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Unix.targets +++ b/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Unix.targets @@ -42,6 +42,7 @@ The .NET Foundation licenses this file to you under the MIT license. $(CrossCompileArch)-linux-gnu $(CrossCompileArch)-alpine-linux-musl + $(CrossCompileArch)-linux-android21 $(CrossCompileArch)-unknown-freebsd12 $ORIGIN @@ -64,7 +65,7 @@ The .NET Foundation licenses this file to you under the MIT license. - + @@ -122,7 +123,7 @@ The .NET Foundation licenses this file to you under the MIT license. - + @@ -153,11 +154,16 @@ The .NET Foundation licenses this file to you under the MIT license. - + + <_CommandProbe>command -v + <_CommandProbe Condition="$([MSBuild]::IsOSPlatform('Windows'))">where + + + - + @@ -189,11 +195,11 @@ The .NET Foundation licenses this file to you under the MIT license. <_LinkerVersion>$([System.Text.RegularExpressions.Regex]::Match($(_LinkerVersionString), '[1-9]\d*')) - + - +