Index: cmake/config-ix.cmake =================================================================== --- cmake/config-ix.cmake +++ cmake/config-ix.cmake @@ -546,7 +546,7 @@ endif() if (COMPILER_RT_HAS_SANITIZER_COMMON AND UBSAN_SUPPORTED_ARCH AND - OS_NAME MATCHES "Linux|FreeBSD|NetBSD|Android") + OS_NAME MATCHES "Linux|FreeBSD|NetBSD|Android|Darwin") set(COMPILER_RT_HAS_UBSAN_MINIMAL TRUE) else() set(COMPILER_RT_HAS_UBSAN_MINIMAL FALSE) Index: lib/ubsan_minimal/CMakeLists.txt =================================================================== --- lib/ubsan_minimal/CMakeLists.txt +++ lib/ubsan_minimal/CMakeLists.txt @@ -16,6 +16,7 @@ # Common parts of UBSan runtime. add_compiler_rt_object_libraries(RTUbsan_minimal + OS ${SANITIZER_COMMON_SUPPORTED_OS} ARCHS ${UBSAN_COMMON_SUPPORTED_ARCH} SOURCES ${UBSAN_MINIMAL_SOURCES} CFLAGS ${UBSAN_CFLAGS}) @@ -26,6 +27,7 @@ # Standalone UBSan runtimes. add_compiler_rt_runtime(clang_rt.ubsan_minimal STATIC + OS ${SANITIZER_COMMON_SUPPORTED_OS} ARCHS ${UBSAN_SUPPORTED_ARCH} OBJECT_LIBS RTUbsan_minimal CFLAGS ${UBSAN_CFLAGS} @@ -33,13 +35,14 @@ add_compiler_rt_runtime(clang_rt.ubsan_minimal SHARED + OS ${SANITIZER_COMMON_SUPPORTED_OS} ARCHS ${UBSAN_SUPPORTED_ARCH} OBJECT_LIBS RTUbsan_minimal CFLAGS ${UBSAN_CFLAGS} LINK_LIBS ${UBSAN_DYNAMIC_LIBS} PARENT_TARGET ubsan-minimal) - if (UNIX) + if (UNIX AND NOT APPLE) set(ARCHS_FOR_SYMBOLS ${UBSAN_SUPPORTED_ARCH}) list(REMOVE_ITEM ARCHS_FOR_SYMBOLS i386 i686) add_sanitizer_rt_symbols(clang_rt.ubsan_minimal Index: test/ubsan_minimal/lit.common.cfg =================================================================== --- test/ubsan_minimal/lit.common.cfg +++ test/ubsan_minimal/lit.common.cfg @@ -30,7 +30,7 @@ config.suffixes = ['.c', '.cc', '.cpp'] # Check that the host supports UndefinedBehaviorSanitizerMinimal tests -if config.host_os not in ['Linux', 'FreeBSD', 'NetBSD']: # TODO: Darwin, Windows +if config.host_os not in ['Linux', 'FreeBSD', 'NetBSD', 'Darwin']: # TODO: Windows config.unsupported = True config.available_features.add('arch=' + config.target_arch)