Index: cmake/Modules/CompilerRTUtils.cmake =================================================================== --- cmake/Modules/CompilerRTUtils.cmake +++ cmake/Modules/CompilerRTUtils.cmake @@ -169,6 +169,8 @@ check_symbol_exists(__powerpc64__ "" __PPC64) check_symbol_exists(__powerpc64le__ "" __PPC64LE) check_symbol_exists(__s390x__ "" __S390X) + check_symbol_exists(__sparc "" __SPARC) + check_symbol_exists(__sparcv9 "" __SPARCV9) check_symbol_exists(__wasm32__ "" __WEBASSEMBLY32) check_symbol_exists(__wasm64__ "" __WEBASSEMBLY64) if(__ARM) @@ -189,6 +191,10 @@ add_default_target_arch(powerpc64le) elseif(__S390X) add_default_target_arch(s390x) + elseif(__SPARCV9) + add_default_target_arch(sparcv9) + elseif(__SPARC) + add_default_target_arch(sparc) elseif(__WEBASSEMBLY32) add_default_target_arch(wasm32) elseif(__WEBASSEMBLY64) Index: cmake/base-config-ix.cmake =================================================================== --- cmake/base-config-ix.cmake +++ cmake/base-config-ix.cmake @@ -163,6 +163,9 @@ endif() elseif("${COMPILER_RT_DEFAULT_TARGET_ARCH}" MATCHES "s390x") test_target_arch(s390x "" "") + elseif("${COMPILER_RT_DEFAULT_TARGET_ARCH}" MATCHES "sparc") + test_target_arch(sparc "" "-m32") + test_target_arch(sparcv9 "" "-m64") elseif("${COMPILER_RT_DEFAULT_TARGET_ARCH}" MATCHES "mipsel|mips64el") # Gcc doesn't accept -m32/-m64 so we do the next best thing and use # -mips32r2/-mips64r2. We don't use -mips1/-mips3 because we want to match Index: cmake/builtin-config-ix.cmake =================================================================== --- cmake/builtin-config-ix.cmake +++ cmake/builtin-config-ix.cmake @@ -30,6 +30,8 @@ set(MIPS32 mips mipsel) set(MIPS64 mips64 mips64el) set(PPC64 powerpc64 powerpc64le) +set(SPARC sparc) +set(SPARCV9 sparcv9) set(WASM32 wasm32) set(WASM64 wasm64) @@ -40,7 +42,7 @@ endif() set(ALL_BUILTIN_SUPPORTED_ARCH ${X86} ${X86_64} ${ARM32} ${ARM64} - ${MIPS32} ${MIPS64} ${PPC64} ${WASM32} ${WASM64}) + ${MIPS32} ${MIPS64} ${PPC64} ${SPARC} ${SPARCV9} ${WASM32} ${WASM64}) include(CompilerRTUtils) include(CompilerRTDarwinUtils) Index: cmake/config-ix.cmake =================================================================== --- cmake/config-ix.cmake +++ cmake/config-ix.cmake @@ -180,6 +180,8 @@ set(MIPS64 mips64 mips64el) set(PPC64 powerpc64 powerpc64le) set(S390X s390x) +set(SPARC sparc) +set(SPARCV9 sparcv9) set(WASM32 wasm32) set(WASM64 wasm64) @@ -190,9 +192,9 @@ endif() set(ALL_SANITIZER_COMMON_SUPPORTED_ARCH ${X86} ${X86_64} ${PPC64} - ${ARM32} ${ARM64} ${MIPS32} ${MIPS64} ${S390X}) + ${ARM32} ${ARM64} ${MIPS32} ${MIPS64} ${S390X} ${SPARC} ${SPARCV9}) set(ALL_ASAN_SUPPORTED_ARCH ${X86} ${X86_64} ${ARM32} ${ARM64} - ${MIPS32} ${MIPS64} ${PPC64} ${S390X}) + ${MIPS32} ${MIPS64} ${PPC64} ${S390X} ${SPARC} ${SPARCV9}) set(ALL_DFSAN_SUPPORTED_ARCH ${X86_64} ${MIPS64} ${ARM64}) set(ALL_FUZZER_SUPPORTED_ARCH x86_64) @@ -203,10 +205,10 @@ endif() set(ALL_MSAN_SUPPORTED_ARCH ${X86_64} ${MIPS64} ${ARM64} ${PPC64}) set(ALL_PROFILE_SUPPORTED_ARCH ${X86} ${X86_64} ${ARM32} ${ARM64} ${PPC64} - ${MIPS32} ${MIPS64} ${S390X}) + ${MIPS32} ${MIPS64} ${S390X} ${SPARC} ${SPARCV9}) set(ALL_TSAN_SUPPORTED_ARCH ${X86_64} ${MIPS64} ${ARM64} ${PPC64}) set(ALL_UBSAN_SUPPORTED_ARCH ${X86} ${X86_64} ${ARM32} ${ARM64} - ${MIPS32} ${MIPS64} ${PPC64} ${S390X}) + ${MIPS32} ${MIPS64} ${PPC64} ${S390X} ${SPARC} ${SPARCV9}) set(ALL_SAFESTACK_SUPPORTED_ARCH ${X86} ${X86_64} ${ARM64} ${MIPS32} ${MIPS64}) set(ALL_CFI_SUPPORTED_ARCH ${X86} ${X86_64} ${ARM32} ${ARM64} ${MIPS64}) set(ALL_ESAN_SUPPORTED_ARCH ${X86_64} ${MIPS64}) Index: lib/asan/tests/CMakeLists.txt =================================================================== --- lib/asan/tests/CMakeLists.txt +++ lib/asan/tests/CMakeLists.txt @@ -238,6 +238,7 @@ darwin_filter_host_archs(ASAN_SUPPORTED_ARCH ASAN_TEST_ARCH) endif() if(OS_NAME MATCHES "SunOS") + list(REMOVE_ITEM ASAN_TEST_ARCH sparc sparcv9) list(REMOVE_ITEM ASAN_TEST_ARCH x86_64) endif() Index: lib/builtins/CMakeLists.txt =================================================================== --- lib/builtins/CMakeLists.txt +++ lib/builtins/CMakeLists.txt @@ -478,6 +478,9 @@ ${GENERIC_SOURCES}) set(powerpc64le_SOURCES ${powerpc64_SOURCES}) +set(sparc_SOURCES ${GENERIC_SOURCES}) +set(sparcv9_SOURCES ${GENERIC_SOURCES}) + set(wasm32_SOURCES ${GENERIC_TF_SOURCES} ${GENERIC_SOURCES}) Index: lib/builtins/fp_lib.h =================================================================== --- lib/builtins/fp_lib.h +++ lib/builtins/fp_lib.h @@ -102,7 +102,7 @@ COMPILER_RT_ABI fp_t __adddf3(fp_t a, fp_t b); #elif defined QUAD_PRECISION -#if __LDBL_MANT_DIG__ == 113 +#if __LDBL_MANT_DIG__ == 113 && defined(__SIZEOF_INT128__) #define CRT_LDBL_128BIT typedef __uint128_t rep_t; typedef __int128_t srep_t; @@ -207,7 +207,7 @@ #undef Word_HiMask #undef Word_LoMask #undef Word_FullMask -#endif // __LDBL_MANT_DIG__ == 113 +#endif // __LDBL_MANT_DIG__ == 113 && __SIZEOF_INT128__ #else #error SINGLE_PRECISION, DOUBLE_PRECISION or QUAD_PRECISION must be defined. #endif Index: test/asan/CMakeLists.txt =================================================================== --- test/asan/CMakeLists.txt +++ test/asan/CMakeLists.txt @@ -18,9 +18,9 @@ endif() macro(get_bits_for_arch arch bits) - if (${arch} MATCHES "i386|arm|mips|mipsel") + if (${arch} MATCHES "i386|arm|mips|mipsel|sparc") set(${bits} 32) - elseif (${arch} MATCHES "x86_64|powerpc64|powerpc64le|aarch64|mips64|mips64el|s390x") + elseif (${arch} MATCHES "x86_64|powerpc64|powerpc64le|aarch64|mips64|mips64el|s390x|sparcv9") set(${bits} 64) else() message(FATAL_ERROR "Unknown target architecture: ${arch}") @@ -41,6 +41,7 @@ darwin_filter_host_archs(ASAN_SUPPORTED_ARCH ASAN_TEST_ARCH) endif() if(OS_NAME MATCHES "SunOS") + list(REMOVE_ITEM ASAN_TEST_ARCH sparc sparcv9) list(REMOVE_ITEM ASAN_TEST_ARCH x86_64) endif() Index: test/ubsan/CMakeLists.txt =================================================================== --- test/ubsan/CMakeLists.txt +++ test/ubsan/CMakeLists.txt @@ -39,6 +39,7 @@ darwin_filter_host_archs(UBSAN_SUPPORTED_ARCH UBSAN_TEST_ARCH) endif() if(OS_NAME MATCHES "SunOS") + list(REMOVE_ITEM UBSAN_TEST_ARCH sparcv9) list(REMOVE_ITEM UBSAN_TEST_ARCH x86_64) endif() Index: test/ubsan_minimal/CMakeLists.txt =================================================================== --- test/ubsan_minimal/CMakeLists.txt +++ test/ubsan_minimal/CMakeLists.txt @@ -5,6 +5,7 @@ darwin_filter_host_archs(UBSAN_SUPPORTED_ARCH UBSAN_TEST_ARCH) endif() if(OS_NAME MATCHES "SunOS") + list(REMOVE_ITEM UBSAN_TEST_ARCH sparcv9) list(REMOVE_ITEM UBSAN_TEST_ARCH x86_64) endif()