[PATCH] D44017: OpenBSD UBsan support, cmake part
Phabricator via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sat Mar 3 03:51:17 PST 2018
This revision was automatically updated to reflect the committed changes.
Closed by commit rL326646: OpenBSD UBsan support, cmake part (authored by kamil, committed by ).
Herald added a subscriber: delcypher.
Changed prior to commit:
https://reviews.llvm.org/D44017?vs=136757&id=136904#toc
Repository:
rL LLVM
https://reviews.llvm.org/D44017
Files:
compiler-rt/trunk/cmake/base-config-ix.cmake
compiler-rt/trunk/cmake/config-ix.cmake
Index: compiler-rt/trunk/cmake/config-ix.cmake
===================================================================
--- compiler-rt/trunk/cmake/config-ix.cmake
+++ compiler-rt/trunk/cmake/config-ix.cmake
@@ -488,7 +488,7 @@
list_replace(COMPILER_RT_SANITIZERS_TO_BUILD all "${ALL_SANITIZERS}")
if (SANITIZER_COMMON_SUPPORTED_ARCH AND NOT LLVM_USE_SANITIZER AND
- (OS_NAME MATCHES "Android|Darwin|Linux|FreeBSD|NetBSD|Fuchsia|SunOS" OR
+ (OS_NAME MATCHES "Android|Darwin|Linux|FreeBSD|NetBSD|OpenBSD|Fuchsia|SunOS" OR
(OS_NAME MATCHES "Windows" AND (NOT MINGW AND NOT CYGWIN))))
set(COMPILER_RT_HAS_SANITIZER_COMMON TRUE)
else()
@@ -501,7 +501,8 @@
set(COMPILER_RT_HAS_INTERCEPTION FALSE)
endif()
-if (COMPILER_RT_HAS_SANITIZER_COMMON AND ASAN_SUPPORTED_ARCH)
+if (COMPILER_RT_HAS_SANITIZER_COMMON AND ASAN_SUPPORTED_ARCH AND
+ NOT OS_NAME MATCHES "OpenBSD")
set(COMPILER_RT_HAS_ASAN TRUE)
else()
set(COMPILER_RT_HAS_ASAN FALSE)
@@ -558,14 +559,14 @@
endif()
if (COMPILER_RT_HAS_SANITIZER_COMMON AND UBSAN_SUPPORTED_ARCH AND
- OS_NAME MATCHES "Darwin|Linux|FreeBSD|NetBSD|Windows|Android|Fuchsia|SunOS")
+ OS_NAME MATCHES "Darwin|Linux|FreeBSD|NetBSD|OpenBSD|Windows|Android|Fuchsia|SunOS")
set(COMPILER_RT_HAS_UBSAN TRUE)
else()
set(COMPILER_RT_HAS_UBSAN FALSE)
endif()
if (COMPILER_RT_HAS_SANITIZER_COMMON AND UBSAN_SUPPORTED_ARCH AND
- OS_NAME MATCHES "Linux|FreeBSD|NetBSD|Android|Darwin")
+ OS_NAME MATCHES "Linux|FreeBSD|NetBSD|OpenBSD|Android|Darwin")
set(COMPILER_RT_HAS_UBSAN_MINIMAL TRUE)
else()
set(COMPILER_RT_HAS_UBSAN_MINIMAL FALSE)
Index: compiler-rt/trunk/cmake/base-config-ix.cmake
===================================================================
--- compiler-rt/trunk/cmake/base-config-ix.cmake
+++ compiler-rt/trunk/cmake/base-config-ix.cmake
@@ -139,8 +139,16 @@
add_default_target_arch(${COMPILER_RT_DEFAULT_TARGET_ARCH})
elseif("${COMPILER_RT_DEFAULT_TARGET_ARCH}" MATCHES "i[2-6]86|x86|amd64")
if(NOT MSVC)
- test_target_arch(x86_64 "" "-m64")
- test_target_arch(i386 __i386__ "-m32")
+ if(CMAKE_SYSTEM_NAME MATCHES "OpenBSD")
+ if (CMAKE_SIZEOF_VOID_P EQUAL 4)
+ test_target_arch(i386 __i386__ "-m32")
+ else()
+ test_target_arch(x86_64 "" "-m64")
+ endif()
+ else()
+ test_target_arch(x86_64 "" "-m64")
+ test_target_arch(i386 __i386__ "-m32")
+ endif()
else()
if (CMAKE_SIZEOF_VOID_P EQUAL 4)
test_target_arch(i386 "" "")
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D44017.136904.patch
Type: text/x-patch
Size: 2566 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180303/428cbf1b/attachment.bin>
More information about the llvm-commits
mailing list