Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
a1c7ecc
Use android-native-tools for NativeAOT linking instead of Android NDK
sbomer Jan 17, 2026
b9bb3ce
Add --eh-frame-hdr linker flag for NativeAOT builds
sbomer Jan 20, 2026
2395d8f
Fix NativeAOT linking for projects with spaces in names
sbomer Jan 21, 2026
d2c6f45
Remove sysroot libraries from NativeAOT publish output
sbomer Feb 2, 2026
27b43fa
Merge origin/main into workload-aot
sbomer Feb 2, 2026
2a742d0
Copy CRT object files to NativeAOT runtime pack
sbomer Feb 3, 2026
844cb82
Skip runtime pack directories without DSO stub instead of throwing
sbomer Feb 12, 2026
1559887
Merge remote-tracking branch 'origin/main' into workload-aot
sbomer Feb 17, 2026
fdbf242
Fix NativeAOT build failure when llvm-objcopy is not in PATH
sbomer Feb 18, 2026
885a2aa
Merge remote-tracking branch 'origin/main' into workload-aot
sbomer Feb 18, 2026
d912268
Fix _TouchAndroidLinkFlag skipping on NativeAOT incremental builds
sbomer Feb 20, 2026
9b4279e
Exclude NativeAOT runtime pack .so shims from APK packaging
sbomer Feb 21, 2026
35053c5
Merge branch 'main' into dev/sbomer/workload-aot
sbomer Mar 5, 2026
faa097c
Fix NativeAOT build failure on Windows due to llvm-objcopy probe
sbomer Mar 6, 2026
0231cc5
Fix review issues in NativeAOT linking: soname, NDK clang, DSOWrapper…
sbomer Mar 8, 2026
56c7793
Merge remote-tracking branch 'origin/main' into workload-aot
sbomer Mar 11, 2026
16c44e9
Fix legacy NDK path: invoke clang++ directly instead of relying on IL…
sbomer Mar 11, 2026
dbe5b72
Merge remote-tracking branch 'origin/main' into workload-aot
sbomer Mar 19, 2026
a83a028
Merge remote-tracking branch 'origin/main' into workload-aot
sbomer Apr 2, 2026
1baad99
Add NativeAOT workload pack (NDK-free) CI test mode
sbomer Apr 3, 2026
aee9a5d
Fix NativeAOT parallel multi-RID race: set RunILLink=true at property…
sbomer Apr 7, 2026
1e40bf7
Fix NativeAOT parallel multi-RID build race condition
sbomer Apr 7, 2026
ccced4f
Merge branch 'workload-aot' into workload-aot-validation
sbomer Apr 7, 2026
60ed98f
Skip NDK provisioning in test scenarios via new NdkDependency flag
sbomer Apr 8, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions build-tools/automation/yaml-templates/stage-package-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,19 @@ stages:
artifactSource: bin/Test$(XA.Build.Configuration)/$(DotNetTargetFramework)-android/Mono.Android.NET_Tests-Signed.aab
artifactFolder: $(DotNetTargetFramework)-NativeAOT

- template: /build-tools/automation/yaml-templates/apk-instrumentation.yaml
parameters:
configuration: $(XA.Build.Configuration)
testName: Mono.Android.NET_Tests-NativeAOTWorkload
project: tests/Mono.Android-Tests/Mono.Android-Tests/Mono.Android.NET-Tests.csproj
testResultsFiles: TestResult-Mono.Android.NET_Tests-$(XA.Build.Configuration)NativeAOTWorkload.xml
extraBuildArgs: >-
-p:TestsFlavor=NativeAOTWorkload
-p:PublishAot=true
-p:AndroidNativeAotUseNdk=false
artifactSource: bin/Test$(XA.Build.Configuration)/$(DotNetTargetFramework)-android/Mono.Android.NET_Tests-Signed.aab
artifactFolder: $(DotNetTargetFramework)-NativeAOTWorkload

- template: /build-tools/automation/yaml-templates/apk-instrumentation.yaml
parameters:
configuration: $(XA.Build.Configuration)
Expand Down
14 changes: 14 additions & 0 deletions build-tools/create-packs/Microsoft.Android.Runtime.proj
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,20 @@ projects that use the Microsoft.Android.Runtimes framework in .NET 6+.
</ItemGroup>

<ItemGroup Condition=" '$(AndroidRuntime)' == 'NativeAOT' ">
<!-- Include sysroot libraries for NativeAOT linking -->
<NativeRuntimeAsset Include="$(NativeRuntimeOutputRootDir)$(_RuntimeRedistDirName)\$(AndroidRID)\libc.so" />
<NativeRuntimeAsset Include="$(NativeRuntimeOutputRootDir)$(_RuntimeRedistDirName)\$(AndroidRID)\libdl.so" />
<NativeRuntimeAsset Include="$(NativeRuntimeOutputRootDir)$(_RuntimeRedistDirName)\$(AndroidRID)\liblog.so" />
<NativeRuntimeAsset Include="$(NativeRuntimeOutputRootDir)$(_RuntimeRedistDirName)\$(AndroidRID)\libm.so" />
<NativeRuntimeAsset Include="$(NativeRuntimeOutputRootDir)$(_RuntimeRedistDirName)\$(AndroidRID)\libz.so" />
<!-- C++ runtime and compiler builtins for NativeAOT -->
<NativeRuntimeAsset Include="$(NativeRuntimeOutputRootDir)$(_RuntimeRedistDirName)\$(AndroidRID)\crtbegin_so.o" />
<NativeRuntimeAsset Include="$(NativeRuntimeOutputRootDir)$(_RuntimeRedistDirName)\$(AndroidRID)\crtend_so.o" />
<NativeRuntimeAsset Include="$(NativeRuntimeOutputRootDir)$(_RuntimeRedistDirName)\$(AndroidRID)\libc++_static.a" />
<NativeRuntimeAsset Include="$(NativeRuntimeOutputRootDir)$(_RuntimeRedistDirName)\$(AndroidRID)\libc++abi.a" />
<NativeRuntimeAsset Include="$(NativeRuntimeOutputRootDir)$(_RuntimeRedistDirName)\$(AndroidRID)\libclang_rt.builtins-$(_ClangArch)-android.a" />
<NativeRuntimeAsset Include="$(NativeRuntimeOutputRootDir)$(_RuntimeRedistDirName)\$(AndroidRID)\libunwind.a" />
<!-- NativeAOT runtime libraries -->
<NativeRuntimeAsset Condition=" Exists('$(NativeRuntimeOutputRootDir)$(_RuntimeFlavorDirName)\$(AndroidRID)\libnaot-android.debug-static-debug.a') " Include="$(NativeRuntimeOutputRootDir)$(_RuntimeFlavorDirName)\$(AndroidRID)\libnaot-android.debug-static-debug.a" />
<NativeRuntimeAsset Condition=" Exists('$(NativeRuntimeOutputRootDir)$(_RuntimeFlavorDirName)\$(AndroidRID)\libnaot-android.release-static-release.a') " Include="$(NativeRuntimeOutputRootDir)$(_RuntimeFlavorDirName)\$(AndroidRID)\libnaot-android.release-static-release.a" />
<_AndroidRuntimePackAssemblies Include="$(_MonoAndroidNETOutputRoot)$(AndroidLatestStableApiLevel)\Microsoft.Android.Runtime.NativeAOT.dll" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ enum AndroidToolchainComponentType
CoreDependency = 0,
BuildDependency = 1 << 0,
EmulatorDependency = 1 << 1,
All = CoreDependency | BuildDependency | EmulatorDependency,
NdkDependency = 1 << 2,
All = CoreDependency | BuildDependency | EmulatorDependency | NdkDependency,
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ public AndroidToolchain ()
new AndroidToolchainComponent ($"android-ndk-r{AndroidNdkVersion}-{osTag}",
destDir: AndroidNdkDirectory,
pkgRevision: AndroidPkgRevision,
dependencyType: AndroidToolchainComponentType.NdkDependency,
buildToolName: $"android-ndk-r{AndroidNdkVersion}",
buildToolVersion: AndroidPkgRevision
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,11 @@ bool AcceptLicenses (Context context, string sdkRoot)

bool GatherNDKInfo (Context context)
{
if (!DependencyTypeToInstall.HasFlag (AndroidToolchainComponentType.NdkDependency)) {
Log.StatusLine ("NDK not requested, skipping NDK info gathering");
return true;
}

if (!CopyRedistributableFiles (context)) {
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,11 @@ _ResolveAssemblies MSBuild target.
</PropertyGroup>

<PropertyGroup>
<!-- When marshal methods are enabled, AOT needs to run after the GenerateJavaStubs task -->
<_RunAotMaybe Condition=" '$(_AndroidUseMarshalMethods)' != 'True' ">_AndroidAot</_RunAotMaybe>
<!--
When marshal methods are enabled, AOT needs to run after the GenerateJavaStubs task.
For NativeAOT, _RunAotMaybe is set in Microsoft.Android.Sdk.NativeAOT.targets.
-->
<_RunAotMaybe Condition=" '$(_AndroidUseMarshalMethods)' != 'True' and '$(_AndroidRuntime)' != 'NativeAOT' ">_AndroidAot</_RunAotMaybe>
</PropertyGroup>

<Target Name="_ComputeFilesToPublishForRuntimeIdentifiers"
Expand Down Expand Up @@ -122,7 +125,6 @@ _ResolveAssemblies MSBuild target.
are never taken into consideration in any context.
-->
<ProcessRuntimePackLibraryDirectories
Condition=" '$(_AndroidRuntime)' != 'NativeAOT' "
ResolvedFilesToPublish="@(ResolvedFileToPublish)">
<Output TaskParameter="RuntimePackLibraryDirectories" ItemName="_RuntimePackLibraryDirectory" />
<Output TaskParameter="NativeLibrariesToRemove" ItemName="_NativeLibraryToRemove" />
Expand Down
Loading
Loading