Skip to content
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

[android] Don't include JNI_OnLoad in libSystem.Security.Cryptography.Native.Android.a #103231

Merged
merged 7 commits into from
Jul 9, 2024

Commits on Jul 2, 2024

  1. [android] Don't include JNI_OnLoad in `libSystem.Security.Cryptogra…

    …phy.Native.Android.a`
    
    I'm working on a feature in .NET For Android which will allow us to link
    all the native bits into a single shared library at application build
    time.  In order to make it possible, no archive (`.a`) may contain any
    `JNI_OnLoad` functions (called by `JavaVM` when initializing a Java
    extension DSO), because our runtime already contains one and there Can
    be Only One(tm).
    
    `libSystem.Security.Cryptography.Native.Android` is currently the only
    BCL support native library which contains `JNI_OnLoad` and thus it
    prevents us from linking it into our runtime.  This PR changes things
    a bit my moving the initialization code to a separate
    function (`init_library_on_load`) which remains in the `.a` archive and
    can be called by `.NET For Android` runtime from its own `JNI_OnLoad` as
    well as by the `libSystem.Security.Cryptography.Native.Android.so` from
    its `JNI_OnLoad`, which this PR moves to a separate source file that is
    compiled only into the shared version of the crypto support library.
    grendello committed Jul 2, 2024
    Configuration menu
    Copy the full SHA
    460de9a View commit details
    Browse the repository at this point in the history
  2. Address feedback

    grendello committed Jul 2, 2024
    Configuration menu
    Copy the full SHA
    17806dc View commit details
    Browse the repository at this point in the history
  3. Update src/native/libs/System.Security.Cryptography.Native.Android/pa…

    …l_jni_onload.c
    
    Co-authored-by: Alexander Köplinger <[email protected]>
    grendello and akoeplinger committed Jul 2, 2024
    Configuration menu
    Copy the full SHA
    915ebe7 View commit details
    Browse the repository at this point in the history
  4. Add explanatory comment

    grendello committed Jul 2, 2024
    Configuration menu
    Copy the full SHA
    f21ae0b View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    b850666 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    3de32bd View commit details
    Browse the repository at this point in the history
  7. Prettier

    grendello committed Jul 2, 2024
    Configuration menu
    Copy the full SHA
    e212ed4 View commit details
    Browse the repository at this point in the history