libRS is LLNDK
CTS JniStaticTest tries to load every *.so under /system/lib and
compares the actual result with the expected result.
Dlopening /system/lib/vndk-sp/libRS.so should fail since the vndk-sp
libs are not for apps. However, the dlopen is successful because
libRS.so is in /system/etc/public.libraries.txt.
In order to fix the problem, libRS is marked as LLNDK so that there is
only one instance of libRS.so in /system/lib. This possible since libRS
is already NDK and thus its ABI is guaranteed to be stable.
Bug: 64888291
Test: JniStaticTest#test_linker_namespaces successful
Change-Id: I42f8c8883215b4c852aa5792048a2fa4fb883b76
diff --git a/Android.bp b/Android.bp
index bbccf13..444379b 100644
--- a/Android.bp
+++ b/Android.bp
@@ -238,12 +238,6 @@
cc_library_shared {
name: "libRS",
defaults: ["rs_defaults"],
- vendor_available: true,
- vndk: {
- enabled: true,
- support_system_process: true,
- },
-
srcs: [
"rsApiStubs.cpp",
"rsHidlAdaptation.cpp",
@@ -280,6 +274,11 @@
version_script: "libRS.map",
}
+llndk_library {
+ name: "libRS",
+ symbol_file: "libRS.map",
+}
+
cc_library_shared {
name: "libRSCacheDir",
defaults: ["rs_defaults"],
diff --git a/CleanSpec.mk b/CleanSpec.mk
index 6a04662..6ab6d9f 100644
--- a/CleanSpec.mk
+++ b/CleanSpec.mk
@@ -53,6 +53,8 @@
$(call add-clean-step, rm -rf $(OUT_DIR)/target/product/*/obj/SHARED_LIBRARIES/librs*_intermediates)
$(call add-clean-step, rm -rf $(OUT_DIR)/target/product/*/obj/SHARED_LIBRARIES/libhellocomputendk_intermediates)
$(call add-clean-step, rm -rf $(OUT_DIR)/host/*/obj/SHARED_LIBRARIES/librsrt*.bc)
+# libRS is no longer vndk-sp, but llndk
+$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/lib/vndk-sp/libRS.so)
# ************************************************
# NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST