[PATCH] D50718: SafeStack: Disable Darwin support

Vlad Tsyrklevich via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 14 09:27:56 PDT 2018


vlad.tsyrklevich created this revision.
vlad.tsyrklevich added reviewers: pcc, eugenis.
Herald added subscribers: Sanitizers, llvm-commits, delcypher, mgorny.

Darwin support does not appear to be used as evidenced by the fact that
the pthread interceptors have never worked and there is no support for
other common threading mechanisms like GCD.


Repository:
  rCRT Compiler Runtime

https://reviews.llvm.org/D50718

Files:
  lib/safestack/CMakeLists.txt
  test/safestack/lit.cfg
  test/safestack/pthread.c


Index: test/safestack/pthread.c
===================================================================
--- test/safestack/pthread.c
+++ test/safestack/pthread.c
@@ -1,8 +1,6 @@
 // RUN: %clang_safestack %s -pthread -o %t
 // RUN: %run %t
 
-// XFAIL: darwin
-
 // Test that pthreads receive their own unsafe stack.
 
 #include <stdlib.h>
Index: test/safestack/lit.cfg
===================================================================
--- test/safestack/lit.cfg
+++ test/safestack/lit.cfg
@@ -18,5 +18,5 @@
 if config.lto_supported:
   config.substitutions.append((r"%clang_lto_safestack ", ' '.join(config.lto_launch + [config.clang] + config.lto_flags + ['-fsanitize=safe-stack '])))
 
-if config.host_os not in ['Linux', 'FreeBSD', 'Darwin', 'NetBSD']:
+if config.host_os not in ['Linux', 'FreeBSD', 'NetBSD']:
    config.unsupported = True
Index: lib/safestack/CMakeLists.txt
===================================================================
--- lib/safestack/CMakeLists.txt
+++ lib/safestack/CMakeLists.txt
@@ -6,29 +6,14 @@
 
 set(SAFESTACK_CFLAGS ${SANITIZER_COMMON_CFLAGS})
 
-if(APPLE)
-  # Build universal binary on APPLE.
+foreach(arch ${SAFESTACK_SUPPORTED_ARCH})
   add_compiler_rt_runtime(clang_rt.safestack
     STATIC
-    OS osx
-    ARCHS ${SAFESTACK_SUPPORTED_ARCH}
+    ARCHS ${arch}
     SOURCES ${SAFESTACK_SOURCES}
-            $<TARGET_OBJECTS:RTInterception.osx>
-            $<TARGET_OBJECTS:RTSanitizerCommon.osx>
-            $<TARGET_OBJECTS:RTSanitizerCommonNoLibc.osx>
+            $<TARGET_OBJECTS:RTInterception.${arch}>
+            $<TARGET_OBJECTS:RTSanitizerCommon.${arch}>
+            $<TARGET_OBJECTS:RTSanitizerCommonNoLibc.${arch}>
     CFLAGS ${SAFESTACK_CFLAGS}
     PARENT_TARGET safestack)
-else()
-  # Otherwise, build separate libraries for each target.
-  foreach(arch ${SAFESTACK_SUPPORTED_ARCH})
-    add_compiler_rt_runtime(clang_rt.safestack
-      STATIC
-      ARCHS ${arch}
-      SOURCES ${SAFESTACK_SOURCES}
-              $<TARGET_OBJECTS:RTInterception.${arch}>
-              $<TARGET_OBJECTS:RTSanitizerCommon.${arch}>
-              $<TARGET_OBJECTS:RTSanitizerCommonNoLibc.${arch}>
-      CFLAGS ${SAFESTACK_CFLAGS}
-      PARENT_TARGET safestack)
-  endforeach()
-endif()
+endforeach()


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D50718.160614.patch
Type: text/x-patch
Size: 2251 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180814/263355e6/attachment.bin>


More information about the llvm-commits mailing list