Do not test ifunc on mips
This commit fixes mips build
Bug: http://b/28009632
Change-Id: I5c657b31947791aea4cc02a2fc4ede6d0ecde851
diff --git a/tests/dlfcn_test.cpp b/tests/dlfcn_test.cpp
index 1123163..19f9978 100644
--- a/tests/dlfcn_test.cpp
+++ b/tests/dlfcn_test.cpp
@@ -211,6 +211,8 @@
dlclose(handle);
}
+// mips doesn't support ifuncs
+#if !defined(__mips__)
TEST(dlfcn, ifunc) {
typedef const char* (*fn_ptr)();
@@ -254,6 +256,7 @@
ASSERT_STREQ("true", is_ctor_called());
dlclose(handle);
}
+#endif
TEST(dlfcn, dlopen_check_relocation_dt_needed_order) {
// This is the structure of the test library and
diff --git a/tests/libs/Android.mk b/tests/libs/Android.mk
index a903732..82bfc05 100644
--- a/tests/libs/Android.mk
+++ b/tests/libs/Android.mk
@@ -348,12 +348,19 @@
# TODO(dimitry): clang does not support ifunc attribute
libtest_ifunc_clang_host := false
-libtest_ifunc_clang_target := false
module := libtest_ifunc
build_target := SHARED_LIBRARY
-include $(LOCAL_PATH)/Android.build.testlib.mk
+build_type := host
+include $(TEST_PATH)/Android.build.mk
+
+ifeq ($(TARGET_ARCH),$(filter $(TARGET_ARCH),arm arm64 x86 x86_64))
+ build_type := target
+ libtest_ifunc_clang_target := false
+ include $(TEST_PATH)/Android.build.mk
+endif
+
# -----------------------------------------------------------------------------
# Library used by atexit tests