[compiler-rt] r310646 - Enable SafeStack on NetBSD

Kamil Rytarowski via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 10 11:40:09 PDT 2017


Author: kamil
Date: Thu Aug 10 11:40:09 2017
New Revision: 310646

URL: http://llvm.org/viewvc/llvm-project?rev=310646&view=rev
Log:
Enable SafeStack on NetBSD

Summary:
make check-safestack:

-- Testing: 8 tests, 8 threads --
Testing: 0 .. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80.. 90..
Testing Time: 0.44s
  Expected Passes    : 7
  Unsupported Tests  : 1

Sponsored by <The NetBSD Foundation>

Reviewers: joerg, vitalybuka, kcc, fjricci, filcab

Reviewed By: vitalybuka

Subscribers: mgorny, llvm-commits, #sanitizers

Tags: #sanitizers

Differential Revision: https://reviews.llvm.org/D36542

Modified:
    compiler-rt/trunk/cmake/config-ix.cmake
    compiler-rt/trunk/lib/safestack/safestack.cc
    compiler-rt/trunk/test/safestack/lit.cfg

Modified: compiler-rt/trunk/cmake/config-ix.cmake
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/cmake/config-ix.cmake?rev=310646&r1=310645&r2=310646&view=diff
==============================================================================
--- compiler-rt/trunk/cmake/config-ix.cmake (original)
+++ compiler-rt/trunk/cmake/config-ix.cmake Thu Aug 10 11:40:09 2017
@@ -541,7 +541,7 @@ else()
 endif()
 
 if (COMPILER_RT_HAS_SANITIZER_COMMON AND SAFESTACK_SUPPORTED_ARCH AND
-    OS_NAME MATCHES "Darwin|Linux|FreeBSD")
+    OS_NAME MATCHES "Darwin|Linux|FreeBSD|NetBSD")
   set(COMPILER_RT_HAS_SAFESTACK TRUE)
 else()
   set(COMPILER_RT_HAS_SAFESTACK FALSE)

Modified: compiler-rt/trunk/lib/safestack/safestack.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/safestack/safestack.cc?rev=310646&r1=310645&r2=310646&view=diff
==============================================================================
--- compiler-rt/trunk/lib/safestack/safestack.cc (original)
+++ compiler-rt/trunk/lib/safestack/safestack.cc Thu Aug 10 11:40:09 2017
@@ -21,7 +21,9 @@
 #include <unistd.h>
 #include <sys/resource.h>
 #include <sys/types.h>
+#if !defined(__NetBSD__)
 #include <sys/user.h>
+#endif
 
 #include "interception/interception.h"
 #include "sanitizer_common/sanitizer_common.h"

Modified: compiler-rt/trunk/test/safestack/lit.cfg
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/safestack/lit.cfg?rev=310646&r1=310645&r2=310646&view=diff
==============================================================================
--- compiler-rt/trunk/test/safestack/lit.cfg (original)
+++ compiler-rt/trunk/test/safestack/lit.cfg Thu Aug 10 11:40:09 2017
@@ -18,8 +18,7 @@ config.substitutions.append( ("%clang_sa
 if config.lto_supported:
   config.substitutions.append((r"%clang_lto_safestack ", ' '.join(config.lto_launch + [config.clang] + config.lto_flags + ['-fsanitize=safe-stack '])))
 
-# SafeStack tests are currently supported on Linux, FreeBSD and Darwin only.
-if config.host_os not in ['Linux', 'FreeBSD', 'Darwin']:
+if config.host_os not in ['Linux', 'FreeBSD', 'Darwin', 'NetBSD']:
    config.unsupported = True
 
 # Allow tests to use REQUIRES=stable-runtime.  For use when you cannot use XFAIL




More information about the llvm-commits mailing list