Skip to content

Native AOT broken in Android-86x64 #94397

Closed as not planned
Closed as not planned

Description

@wuhongyi1977

Description

Similar to another bug that has been resolved:#76983
The difference is in linux-bionic-x64 instead of linux-bionic-arm64
The error is the same, opening the application closes it due to the absence of the "tls_CurrentThread" symbol into the compiled library.
net version:Net8.0 rc2
The JNI library code is: https://github.com/josephmoresena/NativeAOT-AndroidHelloJniLib

I try compile the arm64 package, it will be ok to run on an arm64 android phone.

Reproduction Steps

1.Download the NDK version r21e.
2.Install the NDK in ~/android-ndk-r21e
3.Clone the main branch of josephmoresena/NativeAOT-AndroidHelloJniLib.
4.Compile NativeAOT-AndroidHelloJniLib using
dotnet publish -r linux-bionic-x64 -p:DisableUnsupportedError=true -p:PublishAotUsingRuntimePack=true -p:AssemblyName=libhello-jni.
5.Rename output AndroidHelloJniLib.so file to libhello-jni.so and put it inside com.example.hellojni jniLibs/ folder.
6.Android studio, Compile and debug com.example.hellojni on Android 86x64 device(WSA).

Expected behavior

The android application loads an shows a text generated by NativeAOT JNI library.

Actual behavior

java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "tls_CurrentThread"

Regression?

Maybe only arm64 was fix but not 86x64, or maybe 86x64 was affected by fix arm64.

Known Workarounds

No response

Configuration

Win11,intel i3 12100,16G
Android version: 13(WSA)
Android Studio: 2022.2.1
Net8.0 rc2

Other information

No response

Activity

  1. ghost added
    untriaged
    on Nov 6, 2023
  2. MichalStrehovsky commented on Nov 6, 2023

    @MichalStrehovsky
    Member

    Duplicate of #93942

  3. ghost removed
    untriaged
    on Nov 6, 2023
  4. ghost locked as resolved and limited conversation to collaborators on Dec 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions