Merge "Remove mips test workarounds." am: 7482e240cf

Change-Id: I649c384f24c0522a350883cce64876d965d810fa
This commit is contained in:
Elliott Hughes 2020-02-13 22:12:29 +00:00
commit d5b1005c4a
30 changed files with 5 additions and 92 deletions

View file

@ -25,8 +25,6 @@ LOCAL_SRC_FILES_arm := prebuilt-elf-files/arm/$(bionic_tests_module)
LOCAL_SRC_FILES_arm64 := prebuilt-elf-files/arm64/$(bionic_tests_module)
LOCAL_SRC_FILES_x86 := prebuilt-elf-files/x86/$(bionic_tests_module)
LOCAL_SRC_FILES_x86_64 := prebuilt-elf-files/x86_64/$(bionic_tests_module)
LOCAL_SRC_FILES_mips := prebuilt-elf-files/mips/$(bionic_tests_module)
LOCAL_SRC_FILES_mips64 := prebuilt-elf-files/mips64/$(bionic_tests_module)
include $(BUILD_PREBUILT)
bionic-loader-test-libs-target: $(LOCAL_MODULE)
.PHONY: bionic-loader-test-libs-target

View file

@ -95,12 +95,6 @@ TEST(dl, lib_does_not_preempt_global_protected) {
static constexpr const char* kAlternatePathToLinker = "/system/bin/x86_64/linker64";
#elif defined (__i386__)
static constexpr const char* kAlternatePathToLinker = "/system/bin/x86/linker";
#elif defined (__mips__)
#if defined(__LP64__)
static constexpr const char* kAlternatePathToLinker = "/system/bin/mips64/linker64";
#else
static constexpr const char* kAlternatePathToLinker = "/system/bin/mips/linker";
#endif
#else
#error "Unknown architecture"
#endif

View file

@ -273,8 +273,6 @@ TEST(dlfcn, dlopen_vdso) {
dlclose(handle);
}
// mips doesn't support ifuncs
#if !defined(__mips__)
TEST(dlfcn, ifunc_variable) {
typedef const char* (*fn_ptr)();
@ -367,7 +365,6 @@ TEST(dlfcn, ifunc_ctor_call_rtld_lazy) {
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
@ -989,12 +986,6 @@ TEST(dlfcn, dlopen_executable_by_absolute_path) {
#define ALTERNATE_PATH_TO_SYSTEM_LIB "/system/lib/x86/"
#elif defined (__x86_64__)
#define ALTERNATE_PATH_TO_SYSTEM_LIB "/system/lib64/x86_64/"
#elif defined (__mips__)
#if defined(__LP64__)
#define ALTERNATE_PATH_TO_SYSTEM_LIB "/system/lib64/mips64/"
#else
#define ALTERNATE_PATH_TO_SYSTEM_LIB "/system/lib/mips/"
#endif
#else
#error "Unknown architecture"
#endif
@ -1047,10 +1038,7 @@ TEST(dlfcn, dladdr_invalid) {
ASSERT_TRUE(dlerror() == nullptr); // dladdr(3) doesn't set dlerror(3).
}
// GNU-style ELF hash tables are incompatible with the MIPS ABI.
// MIPS requires .dynsym to be sorted to match the GOT but GNU-style requires sorting by hash code.
TEST(dlfcn, dlopen_library_with_only_gnu_hash) {
#if !defined(__mips__)
dlerror(); // Clear any pending errors.
void* handle = dlopen("libgnu-hash-table-library.so", RTLD_NOW);
ASSERT_TRUE(handle != nullptr) << dlerror();
@ -1067,9 +1055,6 @@ TEST(dlfcn, dlopen_library_with_only_gnu_hash) {
ASSERT_TRUE(fn == dlinfo.dli_saddr);
ASSERT_STREQ("getRandomNumber", dlinfo.dli_sname);
ASSERT_SUBSTR("libgnu-hash-table-library.so", dlinfo.dli_fname);
#else
GTEST_SKIP() << "mips toolchain does not support '--hash-style=gnu'";
#endif
}
TEST(dlfcn, dlopen_library_with_only_sysv_hash) {

View file

@ -69,10 +69,8 @@ static void sys_stat_h() {
STRUCT_MEMBER(struct stat, struct timespec, st_mtim);
STRUCT_MEMBER(struct stat, struct timespec, st_ctim);
#if defined(__BIONIC__)
#if defined(__aarch64__) || (defined(__mips__) && defined(__LP64__))
#if defined(__aarch64__)
STRUCT_MEMBER(struct stat, int, st_blksize);
#elif defined(__mips__) && !defined(__LP64__)
STRUCT_MEMBER(struct stat, unsigned int, st_blksize);
#elif defined(__x86_64__)
STRUCT_MEMBER(struct stat, long, st_blksize);
#else

View file

@ -117,14 +117,6 @@ cc_test_library {
defaults: ["bionic_testlib_defaults"],
srcs: ["dlext_test_library.cpp"],
ldflags: ["-Wl,--hash-style=gnu"],
arch: {
mips: {
enabled: false,
},
mips64: {
enabled: false,
},
},
}
// -----------------------------------------------------------------------------
@ -1120,15 +1112,6 @@ cc_test_library {
name: "libtest_ifunc",
defaults: ["bionic_testlib_defaults"],
srcs: ["dlopen_testlib_ifunc.cpp"],
arch: {
mips: {
enabled: false,
},
mips64: {
enabled: false,
},
},
}
cc_test_library {
@ -1136,30 +1119,12 @@ cc_test_library {
defaults: ["bionic_testlib_defaults"],
srcs: ["dlopen_testlib_ifunc_variable.cpp"],
shared_libs: ["libtest_ifunc_variable_impl"],
arch: {
mips: {
enabled: false,
},
mips64: {
enabled: false,
},
},
}
cc_test_library {
name: "libtest_ifunc_variable_impl",
defaults: ["bionic_testlib_defaults"],
srcs: ["dlopen_testlib_ifunc_variable_impl.cpp"],
arch: {
mips: {
enabled: false,
},
mips64: {
enabled: false,
},
},
}
// -----------------------------------------------------------------------------

View file

@ -224,10 +224,6 @@ TEST(setjmp, setjmp_fp_registers) {
#define __JB_SIGFLAG 8
#elif defined(__x86_64)
#define __JB_SIGFLAG 8
#elif defined(__mips__) && defined(__LP64__)
#define __JB_SIGFLAG 1
#elif defined(__mips__)
#define __JB_SIGFLAG 2
#endif
TEST(setjmp, setjmp_cookie) {
@ -235,13 +231,7 @@ TEST(setjmp, setjmp_cookie) {
int value = setjmp(jb);
ASSERT_EQ(0, value);
#if defined(__mips__) && !defined(__LP64__)
// round address to 8-byte boundry
uintptr_t jb_aligned = reinterpret_cast<uintptr_t>(jb) & ~7L;
long* sigflag = reinterpret_cast<long*>(jb_aligned) + __JB_SIGFLAG;
#else
long* sigflag = reinterpret_cast<long*>(jb) + __JB_SIGFLAG;
#endif
// Make sure there's actually a cookie.
EXPECT_NE(0, *sigflag & ~1);

View file

@ -282,8 +282,7 @@ static void TestSigAction(int (sigaction_fn)(int, const SigActionT*, SigActionT*
int sig) {
// Both bionic and glibc set SA_RESTORER when talking to the kernel on arm,
// arm64, x86, and x86-64. The version of glibc we're using also doesn't
// define SA_RESTORER, but luckily it's the same value everywhere, and mips
// doesn't use the bit for anything.
// define SA_RESTORER, but luckily it's the same value everywhere.
static const unsigned sa_restorer = 0x4000000;
// See what's currently set for this signal.
@ -598,19 +597,13 @@ TEST(signal, sys_siglist) {
}
TEST(signal, limits) {
// This comes from the kernel.
// These come from the kernel.
ASSERT_EQ(32, __SIGRTMIN);
ASSERT_EQ(64, __SIGRTMAX);
// We reserve a non-zero number at the bottom for ourselves.
ASSERT_GT(SIGRTMIN, __SIGRTMIN);
// MIPS has more signals than everyone else.
#if defined(__mips__)
ASSERT_EQ(128, __SIGRTMAX);
#else
ASSERT_EQ(64, __SIGRTMAX);
#endif
// We don't currently reserve any at the top.
ASSERT_EQ(SIGRTMAX, __SIGRTMAX);
}

View file

@ -69,12 +69,7 @@ TEST(stdatomic, atomic_is_lock_free) {
atomic_char small;
ASSERT_TRUE(atomic_is_lock_free(&small));
atomic_intmax_t big;
// atomic_intmax_t(size = 64) is not lock free on mips32.
#if defined(__mips__) && !defined(__LP64__)
ASSERT_FALSE(atomic_is_lock_free(&big));
#else
ASSERT_TRUE(atomic_is_lock_free(&big));
#endif
}
TEST(stdatomic, atomic_flag) {

View file

@ -21,9 +21,7 @@
TEST(sys_personality, current_persona) {
int persona = personality(0xffffffff) & PER_MASK;
#if defined(__BIONIC__)
// When personality syscall is executed on mips64, for a 32bit process
// sys_32_personality() is called, which converts PER_LINUX32 -> PER_LINUX
#if defined(__LP64__) || (__mips==32 && __mips_isa_rev>2)
#if defined(__LP64__)
ASSERT_EQ(PER_LINUX, persona);
#else
ASSERT_EQ(PER_LINUX32, persona);

View file

@ -257,9 +257,6 @@ static void watchpoint_imprecise_child(Uint128_t& data) {
asm volatile("stm %0, { r0, r1, r2, r3 }" : : "r"(&data));
#elif defined(__aarch64__)
asm volatile("stp x0, x1, %0" : : "m"(data));
#elif defined(__mips__)
// TODO
UNUSED(data);
#endif
}