summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorRainer Orth <ro@gcc.gnu.org>2019-07-12 08:30:17 +0000
committerRainer Orth <ro@gcc.gnu.org>2019-07-12 08:30:17 +0000
commit8f4dd24187bc77ca8c59ba6c7b50cd82fea5e373 (patch)
treefe5f5ac569f5953ed67cb6b63abb3291924a56c7 /test
parentcb14528ef6324f54a937359cbd96d303fbf1d199 (diff)
downloadcompiler-rt-8f4dd24187bc77ca8c59ba6c7b50cd82fea5e373.tar.gz
Enable compiler-rt on SPARC
This patch enables compiler-rt on SPARC targets. Most of the changes are straightforward: - Add 32 and 64-bit sparc to compiler-rt - lib/builtins/fp_lib.h needed to check if the int128_t and uint128_t types exist (which they don't on sparc) There's one issue of note: many asan tests fail to compile on Solaris/SPARC: fatal error: error in backend: Function "_ZN7testing8internal16BoolFromGTestEnvEPKcb": over-aligned dynamic alloca not supported. Therefore, while asan is still built, both asan and ubsan-with-asan testing is disabled. The goal is to check if asan keeps compiling on Solaris/SPARC. This serves asan in gcc, which doesn't have the problem above and works just fine. With this patch, sparcv9-sun-solaris2.11 test results are pretty good: Failing Tests (9): Builtins-sparc-sunos :: divtc3_test.c Builtins-sparcv9-sunos :: compiler_rt_logbl_test.c Builtins-sparcv9-sunos :: divtc3_test.c [...] UBSan-Standalone-sparc :: TestCases/TypeCheck/misaligned.cpp UBSan-Standalone-sparcv9 :: TestCases/TypeCheck/misaligned.cpp The builtin failures are due to Bugs 42493 and 42496. The tree contained a few additonal patches either currently in review or about to be submitted. Tested on sparcv9-sun-solaris2.11. Differential Revision: https://reviews.llvm.org/D40943 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@365880 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/asan/CMakeLists.txt5
-rw-r--r--test/ubsan/CMakeLists.txt7
2 files changed, 7 insertions, 5 deletions
diff --git a/test/asan/CMakeLists.txt b/test/asan/CMakeLists.txt
index c5ae2870b..1892c8818 100644
--- a/test/asan/CMakeLists.txt
+++ b/test/asan/CMakeLists.txt
@@ -18,9 +18,9 @@ if (SHADOW_MAPPING_UNRELIABLE)
endif()
macro(get_bits_for_arch arch bits)
- if (${arch} MATCHES "x86_64|powerpc64|powerpc64le|aarch64|arm64|mips64|mips64el|s390x")
+ if (${arch} MATCHES "x86_64|powerpc64|powerpc64le|aarch64|arm64|mips64|mips64el|s390x|sparcv9")
set(${bits} 64)
- elseif (${arch} MATCHES "i386|arm|mips|mipsel")
+ elseif (${arch} MATCHES "i386|arm|mips|mipsel|sparc")
set(${bits} 32)
else()
message(FATAL_ERROR "Unknown target architecture: ${arch}")
@@ -40,6 +40,7 @@ set(ASAN_TEST_ARCH ${ASAN_SUPPORTED_ARCH})
if(APPLE)
darwin_filter_host_archs(ASAN_SUPPORTED_ARCH ASAN_TEST_ARCH)
endif()
+list(REMOVE_ITEM ASAN_TEST_ARCH sparc sparcv9)
if(OS_NAME MATCHES "SunOS")
list(REMOVE_ITEM ASAN_TEST_ARCH x86_64)
endif()
diff --git a/test/ubsan/CMakeLists.txt b/test/ubsan/CMakeLists.txt
index 542ca5533..ee7032a91 100644
--- a/test/ubsan/CMakeLists.txt
+++ b/test/ubsan/CMakeLists.txt
@@ -46,10 +46,11 @@ foreach(arch ${UBSAN_TEST_ARCH})
if(COMPILER_RT_HAS_ASAN AND ";${ASAN_SUPPORTED_ARCH};" MATCHES ";${arch};")
# TODO(wwchrome): Re-enable ubsan for asan win 64-bit when ready.
- # Disable ubsan with AddressSanitizer tests for Windows 64-bit and
- # 64-bit Solaris/x86.
+ # Disable ubsan with AddressSanitizer tests for Windows 64-bit,
+ # 64-bit Solaris/x86, and SPARC.
if((NOT (OS_NAME MATCHES "Windows" AND CMAKE_SIZEOF_VOID_P EQUAL 8)) AND
- (NOT (OS_NAME MATCHES "SunOS" AND ${arch} MATCHES x86_64)))
+ (NOT (OS_NAME MATCHES "SunOS" AND ${arch} MATCHES x86_64)) AND
+ (NOT ${arch} MATCHES sparc))
add_ubsan_testsuites("AddressSanitizer" asan ${arch})
endif()
endif()