Skip to content

Conversation

grendello
Copy link
Contributor

@grendello grendello commented Aug 22, 2025

Fixes: #10383

This is an optimization for when shared libraries aren't extracted from the APK.
In this case, we can load them faster by using extended dlopen API provided by
Android, which allows us to skip path scanning by dlopen.

This is done by recording file offset of any .so library inside the APK at
application startup and then using it, together with the APK file descriptor
that we keep around, to load the library using Android extended version of
dlopen.

This does not apply to any libraries using JNI, as they have to be loaded
using the Java System.loadLibrary API (see cba39dc and 1a62af3)

@grendello grendello force-pushed the dev/grendel/dso-load-apk branch from 4a8ebdc to 06003e7 Compare August 29, 2025 13:51
@grendello grendello marked this pull request as ready for review September 1, 2025 09:38
@grendello grendello merged commit 6539337 into main Sep 1, 2025
59 checks passed
@grendello grendello deleted the dev/grendel/dso-load-apk branch September 1, 2025 09:39
@github-actions github-actions bot locked and limited conversation to collaborators Oct 2, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[clr,native] Shared libraries are loaded via filesystem API instead of directly from APK
1 participant