Repository navigation
Closed
Description
Android framework version
net11.0-android (Preview)
Affected platform version
.NET 11
Description
We should consider using tools from https://github.com/dotnet/android-native-tools when linking a native AOT executable, instead of requiring the android NDK. This would simplify the acquisition experience.
Open questions:
- Are the workload pack tools sufficient to replace dependencies from the NDK?
- Should runtime tests use the tools from the workload pack?
@MichalStrehovsky pointed to some prior art in
android/build-tools/create-packs/Microsoft.Android.Runtime.proj
Lines 81 to 104 in fbc6689
| <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" /> | |
| </ItemGroup> | |
| <ItemGroup Condition=" '$(AndroidRuntime)' == 'Mono' "> | |
| <NativeRuntimeAsset Include="$(NativeRuntimeOutputRootDir)$(_RuntimeFlavorDirName)\$(AndroidRID)\libmono-android.debug.so" /> | |
| <NativeRuntimeAsset Include="$(NativeRuntimeOutputRootDir)$(_RuntimeFlavorDirName)\$(AndroidRID)\libmono-android.release.so" /> | |
| <NativeRuntimeAsset Include="$(NativeRuntimeOutputRootDir)$(_RuntimeFlavorDirName)\$(AndroidRID)\libxamarin-debug-app-helper.so" /> | |
| <NativeRuntimeAsset Include="$(NativeRuntimeOutputRootDir)$(_RuntimeFlavorDirName)\$(AndroidRID)\libxamarin-native-tracing.so" /> | |
| <NativeRuntimeAsset Include="$(NativeRuntimeOutputRootDir)$(_RuntimeFlavorDirName)\$(AndroidRID)\libunwind_xamarin-debug.a" /> | |
| <NativeRuntimeAsset Include="$(NativeRuntimeOutputRootDir)$(_RuntimeFlavorDirName)\$(AndroidRID)\libunwind_xamarin-release.a" /> | |
| </ItemGroup> | |
| <ItemGroup Condition=" '$(AndroidRuntime)' != 'NativeAOT' "> | |
| <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" /> | |
| <NativeRuntimeAsset Condition=" Exists('$(NativeRuntimeOutputRootDir)$(_RuntimeFlavorDirName)\$(AndroidRID)\libarchive-dso-stub.so') " Include="$(NativeRuntimeOutputRootDir)$(_RuntimeFlavorDirName)\$(AndroidRID)\libarchive-dso-stub.so" /> |
Next step is to prototype this - I plan on taking a stab at it. @jonathanpeppers @grendello
Implementation plan:
- Override ILC's built-in linker invocation so we control the arguments
- Invoke lld directly instead of using clang wrapper
- Add ci configuration that can run tests without a provisioned NDK, plus smoke test
- Add initial implementation to use workload bits under opt-in flag (should pass smoke test)
- Expand ci coverage to cover all existing nativeaot tests
- Flip the default
Metadata
Metadata
Assignees
Labels
enhancementProposed change to current functionality.
Type
Projects
- StatusShow more project fieldsNo status
Activity
grendello commentedon Jan 16, 2026
Since we package not only the tools but also shared libraries from the NDK (libc, libm, libdl, liblog, libz), to make "verified" linking process possible, I think it should be possible to implement this.
Add NativeAOT no-NDK smoke test
[NativeAOT] Enable workload-provided linker for NDK-free builds (#11303)
sbomer commentedon May 15, 2026
Completed in: