summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Stjernholm <mast@google.com>2023-12-20 17:32:04 +0000
committerMartin Stjernholm <mast@google.com>2023-12-20 18:29:21 +0000
commit50cfe06af2167fb4b554ab6ecc155571c5acc448 (patch)
tree2dc594b548a8ebcdb07e1bf5cd8e77c9a5ad8ab2
parent79248264f35b5ead4055bc42d7e17f56a58b7baa (diff)
downloadart-android13-tests-dev.tar.gz
Do not add the ART APEX to LD_LIBRARY_PATH in the CTS tests, and linkandroid13-tests-dev
statically what's needed instead. Adding /apex/com.android.art/${LIB} to LD_LIBRARY_PATH conflates the linker namespace separation and causes ART module libs to be loaded in the default (= system) namespace. That causes linker errors when the module is used on older system images where unstable shared libs are no longer compatible. Instead link all internal libs statically and only leave the ones with exported APIs (which these CTS tests are intended to test). Merged-In set to a CL in main to avoid merging there - gtests are already linked statically there - it'll require a different fix. Test: lunch aosp_x86_64 atest art_libnativebridge_cts_tests \ art_standalone_libdexfile_external_tests \ libnativeloader_test \ art_standalone_libartpalette_tests using a cvd with a TM system image (had to apply https://r.android.com/2654960 to make atest work in android13-tests-dev) Bug: 317042881 Change-Id: I538b00418f2e5563f6d88ae8a6aa99372e44bb78 Merged-In: I538b00418f2e5563f6d88ae8a6aa99372e44bb78 Merged-In: I75a844f53663385ef98351f60d3adb900157f5e5
-rw-r--r--libartpalette/Android.bp5
-rw-r--r--libdexfile/Android.bp7
-rw-r--r--test/art-gtests-target-standalone-cts-template.xml2
3 files changed, 8 insertions, 6 deletions
diff --git a/libartpalette/Android.bp b/libartpalette/Android.bp
index 6ed1045dba..773e7c16ed 100644
--- a/libartpalette/Android.bp
+++ b/libartpalette/Android.bp
@@ -111,9 +111,6 @@ art_cc_library {
art_cc_defaults {
name: "art_libartpalette_tests_defaults",
srcs: ["apex/palette_test.cc"],
- shared_libs: [
- "libartpalette",
- ],
}
// Version of ART gtest `art_libartpalette_tests` bundled with the ART APEX on target.
@@ -125,6 +122,7 @@ art_cc_test {
"art_libartpalette_tests_defaults",
],
shared_libs: [
+ "libartpalette",
"libnativehelper",
],
host_supported: true,
@@ -139,6 +137,7 @@ art_cc_test {
"art_libartpalette_tests_defaults",
],
static_libs: [
+ "libartpalette",
// libnativehelper_lazy has the glue we need to dlsym the platform-only
// APIs we need, like JniInvocationInit.
"libnativehelper_lazy",
diff --git a/libdexfile/Android.bp b/libdexfile/Android.bp
index fdc57d0f17..3d910f2c41 100644
--- a/libdexfile/Android.bp
+++ b/libdexfile/Android.bp
@@ -370,7 +370,6 @@ art_cc_defaults {
"external/dex_file_ext_test.cc",
],
shared_libs: [
- "libartbase",
"libdexfile",
],
header_libs: [
@@ -387,6 +386,9 @@ art_cc_test {
"art_test_defaults",
"art_libdexfile_external_tests_defaults",
],
+ shared_libs: [
+ "libartbase",
+ ],
}
// Standalone version of ART gtest `art_libdexfile_external_tests`, not bundled with the ART APEX on
@@ -397,6 +399,9 @@ art_cc_test {
"art_standalone_test_defaults",
"art_libdexfile_external_tests_defaults",
],
+ static_libs: [
+ "libartbase",
+ ],
// Support multilib variants (using different suffix per sub-architecture), which is needed on
// build targets with secondary architectures, as the CTS test suite packaging logic flattens
diff --git a/test/art-gtests-target-standalone-cts-template.xml b/test/art-gtests-target-standalone-cts-template.xml
index 3749c3e990..e862f171e2 100644
--- a/test/art-gtests-target-standalone-cts-template.xml
+++ b/test/art-gtests-target-standalone-cts-template.xml
@@ -30,8 +30,6 @@
<test class="com.android.tradefed.testtype.GTest" >
<option name="native-test-device-path" value="/data/local/tmp/{MODULE}" />
<option name="module-name" value="{MODULE}" />
- <option name="ld-library-path-32" value="/apex/com.android.art/lib" />
- <option name="ld-library-path-64" value="/apex/com.android.art/lib64" />
</test>
<!-- When this test is run in a Mainline context (e.g. with `mts-tradefed`), only enable it if