summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Stjernholm <mast@google.com>2024-02-16 14:13:19 +0000
committerMartin Stjernholm <mast@google.com>2024-02-29 15:23:40 +0000
commit56ab4a69151d4fc9308058a6ba8059ee49d8633f (patch)
treed09e44949a42475e9aada67dd64569954d71db70
parentaa02410a2de17b638a1eb5c664b390c4b1c36aed (diff)
downloadart-56ab4a69151d4fc9308058a6ba8059ee49d8633f.tar.gz
Don't set LD_LIBRARY_PATH to the ART module for any tests.
It makes us mix together the linker namespaces for system and the ART module, which is only safe to do if we can guarantee that both are built at the same time. In many cases it's not necessary after gtests got statically linked in https://r.android.com/2623410. Fix remaining dynamically linked tests: - Remove unnecessary libartbase dependency from art_standalone_libdexfile_external_tests and art_standalone_libdexfile_support_tests. - Link internal libs statically into art_standalone_artd_tests, art_standalone_libartservice_tests, art_standalone_libarttools_tests, and art_standalone_odrefresh_tests. This carries over part of (and extends) https://r.android.com/2886226, which wasn't merged into main. Test: Apply https://r.android.com/2966686 Build a platform image and boot a device with it. Revert https://r.android.com/2966686 banchan com.android.art m dist adb install out/dist/com.android.art.apex adb reboot atest art_standalone_artd_tests art_standalone_cmdline_tests \ art_standalone_compiler_tests art_standalone_dex2oat_cts_tests \ art_standalone_dex2oat_tests art_standalone_dexdump_tests \ art_standalone_dexlist_tests \ art_standalone_dexopt_chroot_setup_tests \ art_standalone_dexoptanalyzer_tests \ art_standalone_dexpreopt_tests \ art_standalone_disassembler_tests \ art_standalone_libartbase_tests \ art_standalone_libartpalette_tests \ art_standalone_libartservice_tests \ art_standalone_libarttools_tests \ art_standalone_libdexfile_external_tests \ art_standalone_libdexfile_support_tests \ art_standalone_libdexfile_tests \ art_standalone_libprofile_tests art_standalone_oatdump_tests \ art_standalone_odrefresh_tests art_standalone_profman_tests \ art_standalone_runtime_tests art_standalone_sigchain_tests \ art_libdexfile_external_tests art_libdexfile_support_tests Test: find out/target/product/vsoc_x86_64/testcases/ -executable \ -type f | xargs readelf -d | egrep -B10 \ 'libandroidio.so|libart-dexlayout.so|libart-disassembler.so|libart.so|libartbase.so|libartpalette.so|libartservice.so|libarttools.so|libdt_fd_forward.so|libdt_socket.so|libjavacore.so|libjdwp.so|libnativebridge.so|libopenjdk.so|libopenjdkjvm.so|libopenjdkjvmti.so|libperfetto_hprof.so|libprofile.so|libsigchain.so' check that there are no matches in the standalone tests Test: atest art_artd_tests art_libartservice_tests \ art_libarttools_tests art_odrefresh_tests no new test failures Bug: 247108425 Change-Id: I291c49a730c187630bf81b1b055ad0a7776150ec
-rw-r--r--artd/Android.bp19
-rw-r--r--artd/art_standalone_artd_tests.xml2
-rw-r--r--compiler/art_standalone_compiler_tests.xml2
-rw-r--r--dex2oat/art_standalone_dex2oat_cts_tests.xml2
-rw-r--r--dex2oat/art_standalone_dex2oat_tests.xml2
-rw-r--r--dexoptanalyzer/art_standalone_dexoptanalyzer_tests.xml2
-rw-r--r--libartservice/service/Android.bp9
-rw-r--r--libarttools/Android.bp7
-rw-r--r--libdexfile/Android.bp2
-rw-r--r--libdexfile/art_standalone_libdexfile_tests.xml2
-rw-r--r--libprofile/art_standalone_libprofile_tests.xml2
-rw-r--r--oatdump/art_standalone_oatdump_tests.xml2
-rw-r--r--odrefresh/Android.bp8
-rw-r--r--profman/art_standalone_profman_tests.xml2
-rw-r--r--runtime/art_standalone_runtime_tests.xml2
-rw-r--r--test/art-gtests-target-standalone-cts-template.xml2
-rw-r--r--test/art-gtests-target-standalone-template.xml2
-rw-r--r--test/art-gtests-target-standalone-with-boot-image-template.xml2
-rw-r--r--test/dexpreopt/art_standalone_dexpreopt_tests.xml2
19 files changed, 37 insertions, 36 deletions
diff --git a/artd/Android.bp b/artd/Android.bp
index 8b74981e2f..50f5428435 100644
--- a/artd/Android.bp
+++ b/artd/Android.bp
@@ -35,11 +35,8 @@ cc_defaults {
"profman_headers",
],
shared_libs: [
- "libartservice",
- "libarttools", // Contains "libc++fs".
"libbase",
"libbinder_ndk",
- "libdexfile",
"libselinux",
],
static_libs: [
@@ -57,6 +54,9 @@ art_cc_binary {
shared_libs: [
"libart",
"libartbase",
+ "libartservice",
+ "libarttools", // Contains "libc++fs".
+ "libdexfile",
],
apex_available: [
"com.android.art",
@@ -93,6 +93,11 @@ art_cc_test {
"art_gtest_defaults",
"art_artd_tests_defaults",
],
+ shared_libs: [
+ "libartservice",
+ "libarttools",
+ "libdexfile",
+ ],
}
// Standalone version of ART gtest `art_artd_tests`, not bundled with the ART
@@ -103,6 +108,11 @@ art_cc_test {
"art_standalone_gtest_defaults",
"art_artd_tests_defaults",
],
+ static_libs: [
+ "libartservice",
+ "libarttools",
+ "libdexfile",
+ ],
test_config_template: "art_standalone_artd_tests.xml",
}
@@ -124,6 +134,9 @@ cc_fuzz {
shared_libs: [
"libart",
"libartbase",
+ "libartservice",
+ "libarttools",
+ "libdexfile",
"liblog",
],
fuzz_config: {
diff --git a/artd/art_standalone_artd_tests.xml b/artd/art_standalone_artd_tests.xml
index 27e7001218..a5c6c994b1 100644
--- a/artd/art_standalone_artd_tests.xml
+++ b/artd/art_standalone_artd_tests.xml
@@ -33,8 +33,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
diff --git a/compiler/art_standalone_compiler_tests.xml b/compiler/art_standalone_compiler_tests.xml
index 8e8636cca4..c2065dd766 100644
--- a/compiler/art_standalone_compiler_tests.xml
+++ b/compiler/art_standalone_compiler_tests.xml
@@ -47,8 +47,6 @@
<test class="com.android.tradefed.testtype.GTest" >
<option name="native-test-device-path" value="/data/local/tmp/art_standalone_compiler_tests" />
<option name="module-name" value="art_standalone_compiler_tests" />
- <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
diff --git a/dex2oat/art_standalone_dex2oat_cts_tests.xml b/dex2oat/art_standalone_dex2oat_cts_tests.xml
index 254f11d3d7..b6f4a3d5f2 100644
--- a/dex2oat/art_standalone_dex2oat_cts_tests.xml
+++ b/dex2oat/art_standalone_dex2oat_cts_tests.xml
@@ -54,8 +54,6 @@
<test class="com.android.tradefed.testtype.GTest" >
<option name="native-test-device-path" value="/data/local/tmp/art_standalone_dex2oat_cts_tests" />
<option name="module-name" value="art_standalone_dex2oat_cts_tests" />
- <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
diff --git a/dex2oat/art_standalone_dex2oat_tests.xml b/dex2oat/art_standalone_dex2oat_tests.xml
index 7b53f1f101..d0c3f40738 100644
--- a/dex2oat/art_standalone_dex2oat_tests.xml
+++ b/dex2oat/art_standalone_dex2oat_tests.xml
@@ -73,8 +73,6 @@
<option name="test-case-timeout" value="5m" />
<option name="native-test-device-path" value="/data/local/tmp/art_standalone_dex2oat_tests" />
<option name="module-name" value="art_standalone_dex2oat_tests" />
- <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
diff --git a/dexoptanalyzer/art_standalone_dexoptanalyzer_tests.xml b/dexoptanalyzer/art_standalone_dexoptanalyzer_tests.xml
index c04deaa488..07e5ed6c27 100644
--- a/dexoptanalyzer/art_standalone_dexoptanalyzer_tests.xml
+++ b/dexoptanalyzer/art_standalone_dexoptanalyzer_tests.xml
@@ -54,8 +54,6 @@
<test class="com.android.tradefed.testtype.GTest" >
<option name="native-test-device-path" value="/data/local/tmp/art_standalone_dexoptanalyzer_tests" />
<option name="module-name" value="art_standalone_dexoptanalyzer_tests" />
- <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
diff --git a/libartservice/service/Android.bp b/libartservice/service/Android.bp
index efd0f10d2d..652d49d50e 100644
--- a/libartservice/service/Android.bp
+++ b/libartservice/service/Android.bp
@@ -32,7 +32,6 @@ cc_defaults {
],
export_include_dirs: ["native"],
shared_libs: [
- "libarttools", // Contains "libc++fs".
"libbase",
"libnativehelper",
],
@@ -48,6 +47,7 @@ cc_library {
shared_libs: [
"libart",
"libartbase",
+ "libarttools", // Contains "libc++fs".
],
}
@@ -64,6 +64,7 @@ cc_library {
shared_libs: [
"libartd",
"libartbased",
+ "libarttools", // Contains "libc++fs".
],
}
@@ -198,6 +199,9 @@ art_cc_test {
"art_gtest_defaults",
"art_libartservice_tests_defaults",
],
+ shared_libs: [
+ "libarttools",
+ ],
}
// Standalone version of ART gtest `art_libartservice_tests`, not bundled with the ART APEX on
@@ -208,6 +212,9 @@ art_cc_test {
"art_standalone_gtest_defaults",
"art_libartservice_tests_defaults",
],
+ static_libs: [
+ "libarttools",
+ ],
}
android_test {
diff --git a/libarttools/Android.bp b/libarttools/Android.bp
index 5997e5d3c1..2c036fb96b 100644
--- a/libarttools/Android.bp
+++ b/libarttools/Android.bp
@@ -59,7 +59,6 @@ art_cc_defaults {
"tools_test.cc",
],
shared_libs: [
- "libarttools",
"libbase",
],
static_libs: [
@@ -80,6 +79,9 @@ art_cc_test {
"art_gtest_defaults",
"art_libarttools_tests_defaults",
],
+ shared_libs: [
+ "libarttools",
+ ],
}
// Standalone version of ART gtest `art_libarttools_tests`, not bundled with the ART APEX on
@@ -90,6 +92,9 @@ art_cc_test {
"art_standalone_gtest_defaults",
"art_libarttools_tests_defaults",
],
+ static_libs: [
+ "libarttools",
+ ],
}
cc_binary {
diff --git a/libdexfile/Android.bp b/libdexfile/Android.bp
index ad528c1dd2..b51456c6d9 100644
--- a/libdexfile/Android.bp
+++ b/libdexfile/Android.bp
@@ -385,7 +385,6 @@ art_cc_defaults {
"external/dex_file_ext_test.cc",
],
shared_libs: [
- "libartbase",
"libdexfile",
],
header_libs: [
@@ -467,7 +466,6 @@ art_cc_defaults {
"external/dex_file_supp_test.cc",
],
shared_libs: [
- "libartbase",
"libbase",
"libdexfile",
"liblog",
diff --git a/libdexfile/art_standalone_libdexfile_tests.xml b/libdexfile/art_standalone_libdexfile_tests.xml
index ca30d749e2..4f18d8ab8b 100644
--- a/libdexfile/art_standalone_libdexfile_tests.xml
+++ b/libdexfile/art_standalone_libdexfile_tests.xml
@@ -37,8 +37,6 @@
<test class="com.android.tradefed.testtype.GTest" >
<option name="native-test-device-path" value="/data/local/tmp/art_standalone_libdexfile_tests" />
<option name="module-name" value="art_standalone_libdexfile_tests" />
- <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
diff --git a/libprofile/art_standalone_libprofile_tests.xml b/libprofile/art_standalone_libprofile_tests.xml
index fc4ebdc389..8a4cf8d627 100644
--- a/libprofile/art_standalone_libprofile_tests.xml
+++ b/libprofile/art_standalone_libprofile_tests.xml
@@ -33,8 +33,6 @@
<test class="com.android.tradefed.testtype.GTest" >
<option name="native-test-device-path" value="/data/local/tmp/art_standalone_libprofile_tests" />
<option name="module-name" value="art_standalone_libprofile_tests" />
- <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
diff --git a/oatdump/art_standalone_oatdump_tests.xml b/oatdump/art_standalone_oatdump_tests.xml
index bb5cc0a2cd..15dba47e93 100644
--- a/oatdump/art_standalone_oatdump_tests.xml
+++ b/oatdump/art_standalone_oatdump_tests.xml
@@ -45,8 +45,6 @@
<test class="com.android.tradefed.testtype.GTest" >
<option name="native-test-device-path" value="/data/local/tmp/art_standalone_oatdump_tests" />
<option name="module-name" value="art_standalone_oatdump_tests" />
- <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
diff --git a/odrefresh/Android.bp b/odrefresh/Android.bp
index 7b9aad7913..8b6ea8de6f 100644
--- a/odrefresh/Android.bp
+++ b/odrefresh/Android.bp
@@ -41,7 +41,6 @@ cc_defaults {
"art-odrefresh-operator-srcs",
],
shared_libs: [
- "libarttools", // Contains "libc++fs".
"libbase",
"liblog",
"libselinux",
@@ -65,6 +64,7 @@ cc_defaults {
],
srcs: ["odrefresh_main.cc"],
shared_libs: [
+ "libarttools", // Contains "libc++fs".
"libdexfile",
],
target: {
@@ -210,6 +210,9 @@ art_cc_test {
"art_odrefresh_tests_defaults",
],
host_supported: false,
+ shared_libs: [
+ "libarttools",
+ ],
// The test config template is needed even though it's not used by the test
// runner. Otherwise, Soong will generate a test config, which is adding
// `art-host-test` as a test tag, while this test does not support running
@@ -225,6 +228,9 @@ art_cc_test {
"art_standalone_gtest_defaults",
"art_odrefresh_tests_defaults",
],
+ static_libs: [
+ "libarttools",
+ ],
}
genrule {
diff --git a/profman/art_standalone_profman_tests.xml b/profman/art_standalone_profman_tests.xml
index 94a54a7875..875f263d8f 100644
--- a/profman/art_standalone_profman_tests.xml
+++ b/profman/art_standalone_profman_tests.xml
@@ -46,8 +46,6 @@
<test class="com.android.tradefed.testtype.GTest" >
<option name="native-test-device-path" value="/data/local/tmp/art_standalone_profman_tests" />
<option name="module-name" value="art_standalone_profman_tests" />
- <option name="ld-library-path-32" value="/apex/com.android.art/lib" />
- <option name="ld-library-path-64" value="/apex/com.android.art/lib64" />
<!-- The following tests from `art_standalone_profman_tests` are currently failing when
run as 32-bit on a 64-bit device, because they try to execute other system (64-bit)
diff --git a/runtime/art_standalone_runtime_tests.xml b/runtime/art_standalone_runtime_tests.xml
index 76c1e5434c..d0e959c345 100644
--- a/runtime/art_standalone_runtime_tests.xml
+++ b/runtime/art_standalone_runtime_tests.xml
@@ -81,8 +81,6 @@
<test class="com.android.tradefed.testtype.GTest" >
<option name="native-test-device-path" value="/data/local/tmp/art_standalone_runtime_tests" />
<option name="module-name" value="art_standalone_runtime_tests" />
- <option name="ld-library-path-32" value="/apex/com.android.art/lib" />
- <option name="ld-library-path-64" value="/apex/com.android.art/lib64" />
<!-- The following tests from `art_standalone_runtime_tests` are currently failing
(observed on `aosp_cf_x86_64_phone-userdebug`).
diff --git a/test/art-gtests-target-standalone-cts-template.xml b/test/art-gtests-target-standalone-cts-template.xml
index a5ac30bfee..42ad284978 100644
--- a/test/art-gtests-target-standalone-cts-template.xml
+++ b/test/art-gtests-target-standalone-cts-template.xml
@@ -32,8 +32,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
diff --git a/test/art-gtests-target-standalone-template.xml b/test/art-gtests-target-standalone-template.xml
index d8981128d4..1c21620342 100644
--- a/test/art-gtests-target-standalone-template.xml
+++ b/test/art-gtests-target-standalone-template.xml
@@ -27,8 +27,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
diff --git a/test/art-gtests-target-standalone-with-boot-image-template.xml b/test/art-gtests-target-standalone-with-boot-image-template.xml
index 9d2a4c4ef3..7f44ba6a9b 100644
--- a/test/art-gtests-target-standalone-with-boot-image-template.xml
+++ b/test/art-gtests-target-standalone-with-boot-image-template.xml
@@ -40,8 +40,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
diff --git a/test/dexpreopt/art_standalone_dexpreopt_tests.xml b/test/dexpreopt/art_standalone_dexpreopt_tests.xml
index 67faa76586..cf459e65af 100644
--- a/test/dexpreopt/art_standalone_dexpreopt_tests.xml
+++ b/test/dexpreopt/art_standalone_dexpreopt_tests.xml
@@ -35,8 +35,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>
<!-- Only run tests if the device under test is SDK version 31 (Android 12) or above. -->