summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Stjernholm <mast@google.com>2020-04-29 10:42:19 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2020-04-29 10:42:19 +0000
commit0d0fc0b7747932f11fdf45eb535ed2e4f8bb37fc (patch)
tree3a06e78c617262b47e3546759892e893142b34bd
parentff84e37ac19d8d5c3eb2e244cde3053b28b77ac2 (diff)
parent38d0a7d9dcf4b92d88f06e742b13b1a15cc25b0a (diff)
Merge "Make bionic_platform_headers available only for Bionic targets." am: 38d0a7d9dc
Change-Id: I7d308e1a1545d5b3dbf1b73842738d9d64a5b523
-rw-r--r--libc/Android.bp2
-rw-r--r--tests/Android.bp7
-rw-r--r--tests/mte_test.cpp6
-rw-r--r--tests/utils.h4
4 files changed, 17 insertions, 2 deletions
diff --git a/libc/Android.bp b/libc/Android.bp
index f73ae4a58..b2ba2c332 100644
--- a/libc/Android.bp
+++ b/libc/Android.bp
@@ -1751,6 +1751,7 @@ genrule {
// Headers that only other parts of the platform can include.
cc_library_headers {
name: "bionic_libc_platform_headers",
+ defaults: ["linux_bionic_supported"],
visibility: [
"//art:__subpackages__",
"//bionic:__subpackages__",
@@ -1762,7 +1763,6 @@ cc_library_headers {
"//system/core/libunwindstack:__subpackages__",
"//system/memory/libmemunreachable:__subpackages__",
],
- host_supported: true,
vendor_available: true,
ramdisk_available: true,
recovery_available: true,
diff --git a/tests/Android.bp b/tests/Android.bp
index c75108483..75fdd906f 100644
--- a/tests/Android.bp
+++ b/tests/Android.bp
@@ -22,6 +22,12 @@ cc_defaults {
darwin: {
enabled: false,
},
+ android: {
+ header_libs: ["bionic_libc_platform_headers"],
+ },
+ linux_bionic: {
+ header_libs: ["bionic_libc_platform_headers"],
+ },
},
cflags: [
"-fstack-protector-all",
@@ -38,7 +44,6 @@ cc_defaults {
// For glibc.
"-D__STDC_LIMIT_MACROS",
],
- header_libs: ["bionic_libc_platform_headers"],
// Ensure that the tests exercise shadow call stack support and
// the hint space PAC/BTI instructions.
arch: {
diff --git a/tests/mte_test.cpp b/tests/mte_test.cpp
index 8928805e5..ff8cde6ff 100644
--- a/tests/mte_test.cpp
+++ b/tests/mte_test.cpp
@@ -14,6 +14,10 @@
* limitations under the License.
*/
+#include <sys/cdefs.h>
+
+#if defined(__BIONIC__)
+
#include <gtest/gtest.h>
#include <android-base/macros.h>
@@ -46,3 +50,5 @@ static void test_tag_mismatch() {
TEST(mte_test, ScopedDisableMTE) {
test_tag_mismatch();
}
+
+#endif // __BIONIC__
diff --git a/tests/utils.h b/tests/utils.h
index 5085a7a59..a9b8513ef 100644
--- a/tests/utils.h
+++ b/tests/utils.h
@@ -25,7 +25,11 @@
#include <sys/wait.h>
#include <unistd.h>
+#if defined(__BIONIC__)
#include <bionic/macros.h>
+#else
+#define untag_address(p) p
+#endif
#include <atomic>
#include <string>