A lib in APK can depend on other libs in the same APK
This hasn't worked because the path /mnt/apk/lib/<abi> wasn't in the
search paths of the linker namespace that the library is loaded (which
is the default namespace).
Fixing that by creating a new linker namespace 'microdroid' that
inherits the settings from the default namespace but adds the library
directory to the search paths, and loading the library from that
namespace.
Bug: N/A
Test: atest MicrodroidHostTestCases
Change-Id: I30c4ce86a48b80fa65e3b5ffeb90561fa1d2544e
diff --git a/tests/testapk/src/native/testbinary.cpp b/tests/testapk/src/native/testbinary.cpp
index 682ab2a..9bd594b 100644
--- a/tests/testapk/src/native/testbinary.cpp
+++ b/tests/testapk/src/native/testbinary.cpp
@@ -24,6 +24,8 @@
using aidl::android::system::keystore2::IKeystoreSecurityLevel;
using aidl::android::system::keystore2::IKeystoreService;
+extern void testlib_sub();
+
namespace {
bool test_keystore() {
@@ -52,6 +54,7 @@
printf(" ");
}
}
+ testlib_sub();
printf("\n");
__system_property_set("debug.microdroid.app.run", "true");
diff --git a/tests/testapk/src/native/testlib.cpp b/tests/testapk/src/native/testlib.cpp
new file mode 100644
index 0000000..792c6c8
--- /dev/null
+++ b/tests/testapk/src/native/testlib.cpp
@@ -0,0 +1,5 @@
+#include <sys/system_properties.h>
+
+void testlib_sub() {
+ __system_property_set("debug.microdroid.app.sublib.run", "true");
+}