diff options
| author | 2022-06-08 16:37:10 +0100 | |
|---|---|---|
| committer | 2022-06-10 13:25:54 +0000 | |
| commit | e631de122b065b014927c08df45258dffca27211 (patch) | |
| tree | 166639123ea97465e77fc2f9d4c9dcc59cff1bca | |
| parent | b054b2c013d9845089938486efdc7406dfb36d60 (diff) | |
Use compile_multilib: "both" with "32"/"64" suffixes by default for ART
native tests.
It cannot be used for shared testing libraries since the suffixes
aren't picked up by DT_NEEDED or dlopen calls. They need to continue to
be installed into different directories, just like before.
Test: gtests and run tests in the buildbot-build.sh chroot
Test: art/libnativebridge/tests/runtests.sh
Test: atest art_standalone_dex2oat_tests
Bug: 233550842
Change-Id: Idd576f9de34ab63d70e63b8701373767f0bd78ae
| -rw-r--r-- | libdexfile/Android.bp | 27 | ||||
| -rw-r--r-- | libnativebridge/tests/Android.bp | 14 | ||||
| -rw-r--r-- | libnativebridge/tests/NativeBridgeTest.h | 14 | ||||
| -rw-r--r-- | libnativeloader/Android.bp | 13 | ||||
| -rw-r--r-- | test/Android.bp | 37 |
5 files changed, 43 insertions, 62 deletions
diff --git a/libdexfile/Android.bp b/libdexfile/Android.bp index fdc57d0f17..f7afe856f1 100644 --- a/libdexfile/Android.bp +++ b/libdexfile/Android.bp @@ -398,19 +398,6 @@ art_cc_test { "art_libdexfile_external_tests_defaults", ], - // 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 - // all test artifacts into a single `testcases` directory. - compile_multilib: "both", - multilib: { - lib32: { - suffix: "32", - }, - lib64: { - suffix: "64", - }, - }, - test_config_template: ":art-gtests-target-standalone-cts-template", test_suites: ["cts"], // For backed-by API coverage. } @@ -495,20 +482,6 @@ art_cc_test { "art_standalone_test_defaults", "art_libdexfile_support_tests_defaults", ], - - // Support multilib variants (using different suffix per sub-architecture), which is needed on - // build targets with secondary architectures, as the MTS test suite packaging logic flattens - // all test artifacts into a single `testcases` directory. - compile_multilib: "both", - multilib: { - lib32: { - suffix: "32", - }, - lib64: { - suffix: "64", - }, - }, - test_suites: [ "mts-art", ], diff --git a/libnativebridge/tests/Android.bp b/libnativebridge/tests/Android.bp index b787fbabb6..a42f3d9b4c 100644 --- a/libnativebridge/tests/Android.bp +++ b/libnativebridge/tests/Android.bp @@ -172,20 +172,6 @@ cc_test { ], header_libs: ["libbase_headers"], - // 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 all test artifacts into a single - // `testcases` directory. - compile_multilib: "both", - multilib: { - lib32: { - suffix: "32", - }, - lib64: { - suffix: "64", - }, - }, - test_config_template: ":art-gtests-target-standalone-cts-template", test_suites: [ "cts", diff --git a/libnativebridge/tests/NativeBridgeTest.h b/libnativebridge/tests/NativeBridgeTest.h index 62509b8917..6b445d0915 100644 --- a/libnativebridge/tests/NativeBridgeTest.h +++ b/libnativebridge/tests/NativeBridgeTest.h @@ -22,12 +22,18 @@ #include <nativebridge/native_bridge.h> #include <gtest/gtest.h> -constexpr const char* kNativeBridgeLibrary = "libnativebridge-test-case.so"; +#if defined(__LP64__) +#define LIB_SUFFIX "64" +#else +#define LIB_SUFFIX "32" +#endif + +constexpr const char* kNativeBridgeLibrary = "libnativebridge-test-case" LIB_SUFFIX ".so"; constexpr const char* kCodeCache = "./code_cache"; constexpr const char* kCodeCacheStatFail = "./code_cache/temp"; -constexpr const char* kNativeBridgeLibrary2 = "libnativebridge2-test-case.so"; -constexpr const char* kNativeBridgeLibrary3 = "libnativebridge3-test-case.so"; -constexpr const char* kNativeBridgeLibrary6 = "libnativebridge6-test-case.so"; +constexpr const char* kNativeBridgeLibrary2 = "libnativebridge2-test-case" LIB_SUFFIX ".so"; +constexpr const char* kNativeBridgeLibrary3 = "libnativebridge3-test-case" LIB_SUFFIX ".so"; +constexpr const char* kNativeBridgeLibrary6 = "libnativebridge6-test-case" LIB_SUFFIX ".so"; namespace android { diff --git a/libnativeloader/Android.bp b/libnativeloader/Android.bp index e14aea2e4c..f30a3ac057 100644 --- a/libnativeloader/Android.bp +++ b/libnativeloader/Android.bp @@ -164,19 +164,6 @@ art_cc_test { "libnativeloader", ], - // 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 - // all test artifacts into a single `testcases` directory. - compile_multilib: "both", - multilib: { - lib32: { - suffix: "32", - }, - lib64: { - suffix: "64", - }, - }, - // Added to CTS for API coverage of libnativeloader which is backed by the // ART module. test_config_template: ":art-gtests-target-standalone-cts-template", diff --git a/test/Android.bp b/test/Android.bp index c0a363e2e8..db8383cc9e 100644 --- a/test/Android.bp +++ b/test/Android.bp @@ -47,6 +47,21 @@ art_module_cc_defaults { "-Wno-deprecated-dynamic-exception-spec", ], + // Support multilib variants (using different suffix per sub-architecture), + // which is needed on build targets with secondary architectures, as the + // CTS/MTS/etc test suite packaging logic flattens all test artifacts into a + // single `testcases` directory. Also, there is CI testing that expects + // 64-bit multilib test suites to work for 32-bit devices (b/233550842). + compile_multilib: "both", + multilib: { + lib32: { + suffix: "32", + }, + lib64: { + suffix: "64", + }, + }, + target: { darwin: { enabled: false, @@ -104,16 +119,30 @@ art_module_cc_defaults { ], } -// Variant of art_test_defaults that installs the library in a location which -// will be added to the default namespace, and hence also the com_android_art -// namespace. That allows the library to have shared_libs dependencies on all -// ART internal libraries. +// Variant of art_test_defaults for test libraries that installs them in a +// location which will be added to the default namespace, and hence also the +// com_android_art namespace. That allows them to have shared_libs +// dependencies on all ART internal libraries. // // Currently this only works for run tests where run-test-jar sets // LD_LIBRARY_PATH and NATIVELOADER_DEFAULT_NAMESPACE_LIBS. art_cc_defaults { name: "art_test_internal_library_defaults", defaults: ["art_test_defaults"], + + // Undo multilib settings inherited from art_test_common_defaults - we + // cannot add suffixes to shared libraries or else they won't be found at + // runtime. + compile_multilib: "", + multilib: { + lib32: { + suffix: "", + }, + lib64: { + suffix: "", + }, + }, + target: { android_arm: { relative_install_path: "com.android.art/lib", |