[PATCH] [ASan] Add CMake configs for libclang_rt.asan_iossim_dynamic.dylib

Alexey Samsonov samsonov at google.com
Fri Nov 1 11:33:36 PDT 2013



================
Comment at: ../projects/compiler-rt/CMakeLists.txt:47
@@ +46,3 @@
+
+set(SANITIZER_COMMON_SUPPORTED_DARWIN_OS osx)
+if (IOSSIM_SDK_DIR)
----------------
Please move this below, closer to SANITIZER_COMMON_SUPPORTED_ARCH, and maybe even put this under "if(APPLE)" block.

================
Comment at: ../projects/compiler-rt/CMakeLists.txt:209
@@ -192,2 +208,3 @@
+  set(OSX_CFLAGS -mmacosx-version-min=${SANITIZER_MIN_OSX_VERSION})
 endif()
 
----------------
IOSSIM_CFLAGS should be defined here as well for consistency.

================
Comment at: ../projects/compiler-rt/CMakeLists.txt:34
@@ -33,1 +33,3 @@
 
+# Obtain the iOS Simulator SDK path from xcodebuild.
+if(APPLE)
----------------
Please put this block below, closer to the place where you actually use it.

================
Comment at: ../projects/compiler-rt/CMakeLists.txt:208
@@ -189,4 +207,3 @@
   endif()
-  list(APPEND SANITIZER_COMMON_CFLAGS
-    -mmacosx-version-min=${SANITIZER_MIN_OSX_VERSION})
+  set(OSX_CFLAGS -mmacosx-version-min=${SANITIZER_MIN_OSX_VERSION})
 endif()
----------------
Consider having DARWIN_osx_CFLAGS and DARWIN_iossim_CFLAGS...

================
Comment at: ../projects/compiler-rt/cmake/Modules/AddCompilerRT.cmake:34
@@ -33,2 +33,3 @@
   add_library(${libname} OBJECT ${LIB_SOURCES})
-  set_target_compile_flags(${libname} ${LIB_CFLAGS})
+  if (os STREQUAL "osx")
+    set_target_compile_flags(${libname} ${LIB_CFLAGS} ${OSX_CFLAGS})
----------------
... so that you can reference them as ${DARWIN_${os}_CFLAGS}

================
Comment at: ../projects/compiler-rt/cmake/Modules/AddCompilerRT.cmake:107
@@ +106,3 @@
+    set_target_compile_flags(${name} ${LIB_CFLAGS} ${IOSSIM_CFLAGS})
+    set_target_link_flags(${name} ${LIB_LINKFLAGS}
+      -Wl,-ios_simulator_version_min,7.0.0
----------------
Why not have (empty) DARWIN_osx_LINKFLAGS and DARWIN_iossim_LINKFLAGS?

================
Comment at: ../projects/compiler-rt/lib/asan/CMakeLists.txt:102
@@ +101,3 @@
+      DEFS ${ASAN_COMMON_DEFINITIONS}
+      LINKFLAGS ${ASAN_RUNTIME_LDFLAGS} -v
+    )
----------------
Remove debugging -v


http://llvm-reviews.chandlerc.com/D2080



More information about the llvm-commits mailing list