Use compile_multilib: "both" with "32"/"64" suffixes by default for ART
native standalone 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.

This relands https://r.android.com/2119389 with a fix for
https://ci.chromium.org/ui/p/art/builders/ci/host-x86_64-cms/7684/overview
and b/235614072: Only apply the suffixes to standalone tests, to leave
test .so files and test binaries in the testing APEX alone.

Test: gtests and run tests on host and in the buildbot-build.sh chroot
Test: art/libnativebridge/tests/runtests.sh
Test: atest art_standalone_dex2oat_tests
Test: art/build/apex/runtests.sh
Bug: 233550842
Change-Id: I2b7d7327fc846b51ab91159959b2dd4bc2f503ca
diff --git a/libdexfile/Android.bp b/libdexfile/Android.bp
index fdc57d0..f7afe85 100644
--- a/libdexfile/Android.bp
+++ b/libdexfile/Android.bp
@@ -398,19 +398,6 @@
         "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_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 b787fba..a42f3d9 100644
--- a/libnativebridge/tests/Android.bp
+++ b/libnativebridge/tests/Android.bp
@@ -172,20 +172,6 @@
     ],
     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/libnativeloader/Android.bp b/libnativeloader/Android.bp
index e14aea2..f30a3ac 100644
--- a/libnativeloader/Android.bp
+++ b/libnativeloader/Android.bp
@@ -164,19 +164,6 @@
         "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 c0a363e..8bca2c5 100644
--- a/test/Android.bp
+++ b/test/Android.bp
@@ -104,10 +104,10 @@
     ],
 }
 
-// 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.
@@ -170,6 +170,21 @@
     // eventually.
     host_supported: false,
     test_config_template: ":art-gtests-target-standalone-template",
+
+    // 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",
+        },
+    },
 }
 
 // Properties common to `art_gtest_defaults` and `art_standalone_gtest_defaults`.