-
Notifications
You must be signed in to change notification settings - Fork 555
Hook up more integrations to NativeAOT with Android RIDs #10402
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 4 commits
4d524ce
d0935b4
2676e47
05b63ea
4a59c50
a85d6fd
f110b38
89ac2ea
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,7 +18,7 @@ This file contains the NativeAOT-specific MSBuild logic for .NET for Android. | |
<AllowPublishAotWithoutRuntimeIdentifier Condition=" '$(AllowPublishAotWithoutRuntimeIdentifier)' == '' ">true</AllowPublishAotWithoutRuntimeIdentifier> | ||
<!-- NativeAOT's targets currently gives an error about cross-compilation --> | ||
<DisableUnsupportedError Condition=" $([MSBuild]::IsOSPlatform('windows')) and '$(DisableUnsupportedError)' == '' ">true</DisableUnsupportedError> | ||
<!-- HACK: make dotnet restore include Microsoft.NETCore.App.Runtime.NativeAOT.linux-bionic-arm64 --> | ||
<!-- HACK: make dotnet restore include Microsoft.NETCore.App.Runtime.NativeAOT.android-arm64 --> | ||
<_IsPublishing Condition=" '$(_IsPublishing)' == '' ">true</_IsPublishing> | ||
</PropertyGroup> | ||
|
||
|
@@ -80,18 +80,6 @@ This file contains the NativeAOT-specific MSBuild logic for .NET for Android. | |
<SuppressTrimAnalysisWarnings>true</SuppressTrimAnalysisWarnings> | ||
<!-- Ensure ILLink respects the value of SuppressTrimAnalysisWarnings --> | ||
<_ExtraTrimmerArgs>$(_ExtraTrimmerArgs) --notrimwarn</_ExtraTrimmerArgs> | ||
|
||
<!-- The list of hacks below should go away when we have NativeAOT.android-* packs --> | ||
<!-- HACK: we are android-arm64, so this is required for the right path(s) to be found --> | ||
<_OriginalRuntimeIdentifier>$(RuntimeIdentifier)</_OriginalRuntimeIdentifier> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There are some usages of |
||
<RuntimeIdentifier Condition=" '$(RuntimeIdentifier)' == 'android-arm64' ">linux-bionic-arm64</RuntimeIdentifier> | ||
<RuntimeIdentifier Condition=" '$(RuntimeIdentifier)' == 'android-x64' ">linux-bionic-x64</RuntimeIdentifier> | ||
<!-- HACK: -targetos:android results in error, so use linux --> | ||
<_targetOS>linux</_targetOS> | ||
<!-- HACK: prevents libSystem.Net.Security.Native.a from being added --> | ||
<_linuxLibcFlavor>bionic</_linuxLibcFlavor> | ||
<!-- HACK: prevents: java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "__start___modules" --> | ||
<LinkerFlavor Condition=" '$(LinkerFlavor)' == '' ">lld</LinkerFlavor> | ||
</PropertyGroup> | ||
|
||
<SetNdkPathForIlc NdkBinDirectory="$(_NdkBinDir)" /> | ||
|
@@ -122,16 +110,13 @@ This file contains the NativeAOT-specific MSBuild logic for .NET for Android. | |
<ResolvedFileToPublish Include="$(_NdkSysrootDir)libc++_shared.so" RuntimeIdentifier="$(_OriginalRuntimeIdentifier)" /> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This line and the one above need to use |
||
<!-- Satellite assemblies --> | ||
<IlcSatelliteAssembly Include="$(_OuterIntermediateSatelliteAssembliesWithTargetPath)" /> | ||
<!-- Native support libraries --> | ||
<NativeLibrary Include="@(RuntimePackAsset->WithMetadataValue('Filename', 'libnet-android-nativeaot.$(Configuration.ToLower())'))" /> | ||
<NativeLibrary Include="@(RuntimePackAsset->WithMetadataValue('Filename', 'libxa-shared-bits.$(Configuration.ToLower())'))" /> | ||
jkoritzinsky marked this conversation as resolved.
Show resolved
Hide resolved
|
||
<DirectPInvoke Include="xa-internal-api" /> | ||
</ItemGroup> | ||
</Target> | ||
|
||
<Target Name="_AndroidAfterLinkNative" AfterTargets="LinkNative"> | ||
<PropertyGroup> | ||
<!-- Turn $(RuntimeIdentifier) back to original value --> | ||
<RuntimeIdentifier>$(_OriginalRuntimeIdentifier)</RuntimeIdentifier> | ||
</PropertyGroup> | ||
</Target> | ||
|
||
<Target Name="_AndroidFixNativeLibraryFileName" AfterTargets="ComputeFilesToPublish"> | ||
<ItemGroup> | ||
<!-- Fix paths to contain lib-prefix --> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,6 +25,18 @@ string(TOLOWER ${CMAKE_BUILD_TYPE} XAMARIN_NET_ANDROID_SUFFIX) | |
set(XAMARIN_NET_ANDROID_LIB "net-android${CHECKED_BUILD_INFIX}.${XAMARIN_NET_ANDROID_SUFFIX}") | ||
set(XAMARIN_NET_ANDROID_STATIC_LIB "${XAMARIN_NET_ANDROID_LIB}-static") | ||
|
||
set(XAMARIN_NET_ANDROID_NATIVEAOT_LIB "net-android-nativeaot${CHECKED_BUILD_INFIX}.${XAMARIN_NET_ANDROID_SUFFIX}") | ||
|
||
set(XAMARIN_NET_ANDROID_NATIVEAOT_SOURCES | ||
bridge-processing.cc | ||
gc-bridge.cc | ||
internal-pinvokes.cc | ||
os-bridge.cc | ||
runtime-util.cc | ||
typemap.cc | ||
xamarin_getifaddrs.cc | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This will produce conflict with #10385. Not a big deal, just wanted to avoid dragging unused code into newly supported runtimes. |
||
) | ||
|
||
set(XAMARIN_MONODROID_SOURCES | ||
assembly-store.cc | ||
bridge-processing.cc | ||
|
@@ -71,6 +83,11 @@ if(BUILD_STATIC_LIBRARY) | |
) | ||
endif() | ||
|
||
add_library(${XAMARIN_NET_ANDROID_NATIVEAOT_LIB} | ||
STATIC | ||
${XAMARIN_NET_ANDROID_NATIVEAOT_SOURCES} | ||
) | ||
|
||
macro(lib_target_options TARGET_NAME) | ||
target_compile_definitions( | ||
${TARGET_NAME} | ||
|
@@ -154,11 +171,13 @@ macro(lib_target_options TARGET_NAME) | |
xa::pinvoke-override-precompiled | ||
xa::lz4 | ||
-llog | ||
-lcoreclr | ||
) | ||
endmacro () | ||
|
||
lib_target_options(${XAMARIN_NET_ANDROID_LIB}) | ||
target_link_libraries(${XAMARIN_NET_ANDROID_LIB} | ||
-lcoreclr | ||
) | ||
xa_add_compile_definitions(${XAMARIN_NET_ANDROID_LIB}) | ||
xa_add_include_directories(${XAMARIN_NET_ANDROID_LIB}) | ||
|
||
|
@@ -173,3 +192,7 @@ if(BUILD_STATIC_LIBRARY) | |
xa_add_compile_definitions(${XAMARIN_NET_ANDROID_STATIC_LIB}) | ||
xa_add_include_directories(${XAMARIN_NET_ANDROID_STATIC_LIB}) | ||
endif() | ||
|
||
lib_target_options(${XAMARIN_NET_ANDROID_NATIVEAOT_LIB}) | ||
xa_add_compile_definitions(${XAMARIN_NET_ANDROID_NATIVEAOT_LIB}) | ||
xa_add_include_directories(${XAMARIN_NET_ANDROID_NATIVEAOT_LIB}) |
Uh oh!
There was an error while loading. Please reload this page.