[PATCH] D15626: Add iOS/watchOS/tvOS support for ASan (compiler-rt part)

Alexey Samsonov via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 17 13:09:27 PST 2015


samsonov added inline comments.

================
Comment at: cmake/config-ix.cmake:199
@@ +198,3 @@
+
+    execute_process(
+      COMMAND xcodebuild -version -sdk iphoneos Path
----------------
This doesn't seem right: this whole code path is not executed on Apple platforms.

================
Comment at: cmake/config-ix.cmake:308
@@ -299,2 +307,3 @@
 
-  option(COMPILER_RT_ENABLE_IOS "Enable building for iOS - Experimental" Off)
+  option(COMPILER_RT_ENABLE_IOS "Enable building for iOS - Experimental" On)
+  option(COMPILER_RT_ENABLE_TVOS "Enable building for AppleTVOS - Experimental" On)
----------------
Are you sure you're ready to enable it by default? Maybe remove "experimental" then?

================
Comment at: cmake/config-ix.cmake:452
@@ +451,3 @@
+
+    if(COMPILER_RT_ENABLE_TVOS)
+      if(DARWIN_tvossim_SYSROOT)
----------------
I would really like to see this generalized somehow.

================
Comment at: lib/asan/asan_internal.h:36
@@ -35,1 +35,3 @@
 
+#ifndef ASAN_LOW_MEMORY
+#if SANITIZER_IOS
----------------
Let's define ASAN_LOW_MEMORY in a single place

  #ifndef ASAN_LOW_MEMORY
  #if SANITIZER_OS
  #  define ASAN_LOW_MEMORY 1
  #elseif SANITIZER_WORDSIZE == 32
  #  define ASAN_LOW_MEMORY 1
  ...


================
Comment at: lib/asan/asan_mapping.h:150
@@ +149,3 @@
+#  if SANITIZER_IOS
+#    if SANITIZER_IOSSIM
+#      define SHADOW_OFFSET kIosSimShadowOffset64
----------------
See how we deal with SANITIZER_IOS/SANITIZER_IOSSIM above - maybe do the same?

================
Comment at: lib/sanitizer_common/sanitizer_mac.cc:361
@@ -354,1 +360,3 @@
 bool IsDeadlySignal(int signum) {
+#if (SANITIZER_WATCHOS || SANITIZER_TVOS) && !SANITIZER_IOSSIM
+  // Handling fatal signals on watchOS and tvOS devices is disallowed.
----------------
This is wrong - of course SIGSEGV is deadly, we just don't need to handle it.

================
Comment at: lib/sanitizer_common/sanitizer_platform.h:46
@@ +45,3 @@
+#  else
+#   define SANITIZER_TVOS 0
+#  endif
----------------
You need to make sure SANITIZER_TVOS is *always* defined to 0 or 1. Same with SANITIZER_WATCHOS.


http://reviews.llvm.org/D15626





More information about the llvm-commits mailing list