summaryrefslogtreecommitdiff
path: root/test/ubsan_minimal/lit.common.cfg
diff options
context:
space:
mode:
authorDavid Carlier <devnexen@gmail.com>2018-06-25 21:10:25 +0000
committerDavid Carlier <devnexen@gmail.com>2018-06-25 21:10:25 +0000
commit2a1852a7218178ecdbd2cfd28970cb65941cea82 (patch)
treeeac0d2af0f6d581dfcf8e7abf40ec97aa1896d0f /test/ubsan_minimal/lit.common.cfg
parentaf2672bd91fdbc81bca9b2f8f0e8aa6f93a0efd1 (diff)
[UBsan] Enable ubsan minimal unit tests on OpenBSD
OpenBSD needs lld linker for sanitisers. Disabling lint checking as some symbols cannot be defined and block the proper unit tests launch. Reviewers: lebedev.ri, vitalybuka Reviewed By: vitalybuka Differential Revision: https://reviews.llvm.org/D48528 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@335524 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/ubsan_minimal/lit.common.cfg')
-rw-r--r--test/ubsan_minimal/lit.common.cfg8
1 files changed, 7 insertions, 1 deletions
diff --git a/test/ubsan_minimal/lit.common.cfg b/test/ubsan_minimal/lit.common.cfg
index e8b42bb82..7630b617f 100644
--- a/test/ubsan_minimal/lit.common.cfg
+++ b/test/ubsan_minimal/lit.common.cfg
@@ -22,6 +22,12 @@ target_cflags = [get_required_attr(config, "target_cflags")]
clang_ubsan_cflags = ["-fsanitize-minimal-runtime"] + target_cflags
clang_ubsan_cxxflags = config.cxx_mode_flags + clang_ubsan_cflags
+# OpenBSD needs lld linker to function
+# TODO update the frontend driver
+if config.host_os == 'OpenBSD':
+ clang_ubsan_cflags.append("-fuse-ld=lld")
+ clang_ubsan_cxxflags.append("-fuse-ld=lld")
+
# Define %clang and %clangxx substitutions to use in test RUN lines.
config.substitutions.append( ("%clang ", build_invocation(clang_ubsan_cflags)) )
config.substitutions.append( ("%clangxx ", build_invocation(clang_ubsan_cxxflags)) )
@@ -30,7 +36,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', 'Darwin']: # TODO: Windows
+if config.host_os not in ['Linux', 'FreeBSD', 'NetBSD', 'Darwin', 'OpenBSD']: # TODO: Windows
config.unsupported = True
# Don't target x86_64h if the test machine can't execute x86_64h binaries.