Repository navigation
Description
Android ARM64 NativeAOT apps fail to link after the dependency update in dotnet/android#13572. Confirmed in Windows and macOS CI binlogs; the apps never reach execution.
error XA3007: Could not link native shared library
ld.lld: error: undefined symbol: tls_CurrentThread
>>> referenced by EHHelpers.S:77
>>> EHHelpers.S.o:(CallEHFunclet) in libRuntime.WorkstationGC.a
Regression range
Relevant changes in dotnet/android/eng/Versions.props:
- <MicrosoftNETSdkPackageVersion>12.0.100-alpha.1.26556.115</MicrosoftNETSdkPackageVersion>
+ <MicrosoftNETSdkPackageVersion>12.0.100-alpha.1.26565.104</MicrosoftNETSdkPackageVersion>
- <MicrosoftNETCoreAppRefPackageVersion>12.0.0-alpha.1.26556.115</MicrosoftNETCoreAppRefPackageVersion>
+ <MicrosoftNETCoreAppRefPackageVersion>12.0.0-alpha.1.26565.104</MicrosoftNETCoreAppRefPackageVersion>The failing archive comes from Microsoft.NETCore.App.Runtime.NativeAOT.android-arm64/12.0.0-alpha.1.26565.104.
VMR diff. The runtime source moves from 7066044546b54c4a84bd88a84d52bab5f09e603a to 00178ee32a0d46acf976f96f1d6fa4a65f8dfc74.
Suspected cause
dotnet/runtime#137168 adds the shared ARM64 exception helpers and replaces calls to RhpGetThread with INLINE_GETTHREAD in the NativeAOT exception paths. Full source diff.
The new CallEHFunclet uses:
#ifdef FEATURE_NATIVEAOT
str x2, [sp, #locRegs]
INLINE_GETTHREAD x4
str x4, [sp, #locThread]INLINE_GETTHREAD accesses native TLS through tls_CurrentThread. Android enables FEATURE_EMULATED_TLS, so the C++ runtime instead defines __emutls_v.tls_CurrentThread.
Comparing the old and new archives with NDK llvm-nm:
Old:
threadstore.cpp.o: D __emutls_v.tls_CurrentThread
No undefined native tls_CurrentThread reference.
New:
EHHelpers.S.o: U tls_CurrentThread
ExceptionHandling.S.o: U tls_CurrentThread
threadstore.cpp.o: D __emutls_v.tls_CurrentThread
Both exception-helper objects need checking, not only CallEHFunclet.
Small reproduction
With NDK r28c tools on PATH, run against the failing package's runtimes/android-arm64/native/libRuntime.WorkstationGC.a:
llvm-ar x <path-to-archive> EHHelpers.S.o
llvm-nm --undefined-only EHHelpers.S.o
ld.lld -shared --no-undefined EHHelpers.S.o -o repro.so
The object has exactly one undefined symbol, tls_CurrentThread. The link exits with code 1 and reproduces the CI error at EHHelpers.S:77.
AI-generated report; evidence checked against CI binlogs, pinned source, and the shipped archive. 🤖
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsNo status
Activity
dotnet-policy-service commentedon Nov 16, 2026
Tagging subscribers to this area: @agocke, @dotnet/ilc-contrib
See info in area-owners.md if you want to be subscribed.
jkotas commentedon Nov 16, 2026
@am11 Could you please take a look?
Use RhpGetThread with emulated TLS in arm64 EH helpers (dotnet#137697)