summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVedant Kumar <vsk@apple.com>2017-09-11 21:37:53 +0000
committerVedant Kumar <vsk@apple.com>2017-09-11 21:37:53 +0000
commit7669679e8238b0867ca96aaf465f0a590389e94d (patch)
treea4f4608bb48ffa799e57f353f2d7d4285c92ae13
parentf56f77f5c829ba6b50fc0747016df532fa98cb9f (diff)
downloadbcm5719-llvm-7669679e8238b0867ca96aaf465f0a590389e94d.tar.gz
bcm5719-llvm-7669679e8238b0867ca96aaf465f0a590389e94d.zip
[ubsan-minimal] Enable on Darwin
Testing: check-ubsan-minimal Differential Revision: https://reviews.llvm.org/D37646 llvm-svn: 312959
-rw-r--r--compiler-rt/cmake/config-ix.cmake2
-rw-r--r--compiler-rt/lib/ubsan_minimal/CMakeLists.txt5
-rw-r--r--compiler-rt/test/ubsan_minimal/lit.common.cfg2
3 files changed, 6 insertions, 3 deletions
diff --git a/compiler-rt/cmake/config-ix.cmake b/compiler-rt/cmake/config-ix.cmake
index d688abccb27..5820946dfbe 100644
--- a/compiler-rt/cmake/config-ix.cmake
+++ b/compiler-rt/cmake/config-ix.cmake
@@ -546,7 +546,7 @@ else()
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)
diff --git a/compiler-rt/lib/ubsan_minimal/CMakeLists.txt b/compiler-rt/lib/ubsan_minimal/CMakeLists.txt
index adc5d184d16..e26fc34ce19 100644
--- a/compiler-rt/lib/ubsan_minimal/CMakeLists.txt
+++ b/compiler-rt/lib/ubsan_minimal/CMakeLists.txt
@@ -16,6 +16,7 @@ add_compiler_rt_component(ubsan-minimal)
# 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 @@ if(COMPILER_RT_HAS_UBSAN_MINIMAL)
# 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 @@ if(COMPILER_RT_HAS_UBSAN_MINIMAL)
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
diff --git a/compiler-rt/test/ubsan_minimal/lit.common.cfg b/compiler-rt/test/ubsan_minimal/lit.common.cfg
index 45db6a6f637..6f239ede6b9 100644
--- a/compiler-rt/test/ubsan_minimal/lit.common.cfg
+++ b/compiler-rt/test/ubsan_minimal/lit.common.cfg
@@ -30,7 +30,7 @@ config.substitutions.append( ("%clangxx ", build_invocation(clang_ubsan_cxxflags
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)
OpenPOWER on IntegriCloud