From 162e2634caca054659a829df1040ee052b900c34 Mon Sep 17 00:00:00 2001 From: Martin Stjernholm Date: Tue, 21 Jan 2025 15:07:40 +0000 Subject: Allow ART internal libs to load libs in NATIVELOADER_DEFAULT_NAMESPACE_LIBS. This complements the treatment of NATIVELOADER_DEFAULT_NAMESPACE_LIBS, so that ART internal libs can load the libraries listed in that variable, as well as the other way around. This makes it possible to load libartagent(d).so without absolute paths in run tests on target, so use that to re-enable 900-hello-plugin. Test: art/test/testrunner/testrunner.py --target --64 900 in armv8 target chroot Test: art/test/testrunner/testrunner.py --host 900 Bug: 186654484 Change-Id: Ic418b26b2b77af8839af7b65ad44ea8b5121169c --- libnativeloader/native_loader.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'libnativeloader/native_loader.cpp') diff --git a/libnativeloader/native_loader.cpp b/libnativeloader/native_loader.cpp index f37f661a3e..964279446f 100644 --- a/libnativeloader/native_loader.cpp +++ b/libnativeloader/native_loader.cpp @@ -70,6 +70,11 @@ using ::android::nativeloader::LibraryNamespaces; // the APEX. In that case the default namespace links to the ART namespace // (com_android_art) for all libraries, which means this can be used to load // test libraries that depend on ART internal libraries. +// +// There's also code in art/dalvikvm.cc to add links from com_android_art back +// to the default namespace for NATIVELOADER_DEFAULT_NAMESPACE_LIBS, enabling +// access in the opposite direction as well. Useful e.g. to load ART plugins in +// NATIVELOADER_DEFAULT_NAMESPACE_LIBS. constexpr const char* kNativeloaderExtraLibs = "nativeloader-extra-libs"; std::mutex g_namespaces_mutex; -- cgit v1.2.3-59-g8ed1b