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

Alexander Potapenko glider at google.com
Fri Nov 1 10:42:46 PDT 2013


  PTAL


================
Comment at: ../projects/compiler-rt/cmake/Modules/AddCompilerRT.cmake:5
@@ -4,1 +4,3 @@
 
+execute_process(
+  COMMAND xcodebuild -version -sdk iphonesimulator Path
----------------
Alexey Samsonov wrote:
> Move this to CMakeLists.txt at compiler-rt root for now.
Done

================
Comment at: ../projects/compiler-rt/cmake/Modules/AddCompilerRT.cmake:56
@@ +55,3 @@
+#                                           DEFS <compile definitions>)
+macro(add_compiler_rt_iossim_object_library name)
+  parse_arguments(LIB "ARCH;SOURCES;CFLAGS;DEFS" "" ${ARGN})
----------------
Alexey Samsonov wrote:
> This looks too much like add_compiler_rt_osx_object_library. I think they should be merged and "osx"/"iossim" should be a macro parameter.
Done

================
Comment at: ../projects/compiler-rt/lib/asan/CMakeLists.txt:105
@@ +104,3 @@
+            $<TARGET_OBJECTS:RTLSanCommon.iossim>
+    CFLAGS ${ASAN_CFLAGS} -mios-simulator-version-min=7.0
+    DEFS ${ASAN_COMMON_DEFINITIONS}
----------------
Alexey Samsonov wrote:
> -mios-simulator-version-min=7.0 should be added automatically by IOSSIM_CFLAGS instead.
Done

================
Comment at: ../projects/compiler-rt/lib/asan/CMakeLists.txt:65
@@ -64,1 +64,3 @@
     DEFS ${ASAN_COMMON_DEFINITIONS})
+  add_compiler_rt_iossim_object_library(RTAsan
+    ARCH ${ASAN_SUPPORTED_ARCH}
----------------
Alexey Samsonov wrote:
> here and below - I want a loop for each supported platform like we have on Linux
Done

================
Comment at: ../projects/compiler-rt/cmake/Modules/AddCompilerRT.cmake:154
@@ +153,3 @@
+  set_target_link_flags(${name} ${LIB_LINKFLAGS}
+    -Wl,-ios_simulator_version_min,7.0.0
+    -Wl,-syslibroot,${iossim_sdk_path}
----------------
Alexey Samsonov wrote:
> I guess you need IOSSIM_LINKFLAGS or some such
Done, kind of

================
Comment at: ../projects/compiler-rt/cmake/Modules/AddCompilerRT.cmake:149
@@ +148,3 @@
+#                                     LINKFLAGS <link flags>)
+macro(add_compiler_rt_iossim_dynamic_runtime name)
+  parse_arguments(LIB "ARCH;SOURCES;CFLAGS;DEFS;LINKFLAGS" "" ${ARGN})
----------------
Alexey Samsonov wrote:
> This should also be merged with add_compiler_rt_osx_dynamic_runtime.
Done

================
Comment at: ../projects/compiler-rt/cmake/Modules/AddCompilerRT.cmake:67
@@ +66,3 @@
+macro(add_compiler_rt_object_library_iossim name arch)
+  add_custom_target(${name})
+endmacro()
----------------
Alexey Samsonov wrote:
> No, this macro should only be called if iossim is supported, otherwise we should diagnose error.
We should silently skip building the iossim runtime instead of diagnosing errors. Some OSX machines do not need it.

================
Comment at: ../projects/compiler-rt/cmake/Modules/AddCompilerRT.cmake:60
@@ +59,3 @@
+  add_library(${libname} OBJECT ${LIB_SOURCES})
+  set_target_compile_flags(${libname} ${LIB_CFLAGS_IOSSIM})
+  set_target_properties(${libname} PROPERTIES OSX_ARCHITECTURES "${LIB_ARCH}")
----------------
Alexey Samsonov wrote:
> I guess you need both LIB_CFLAGS and iossim cflags. The naming LIB_CFLAGS_IOSSIM is confusing - IOSSIM_CFLAGS is maybe better - they are common for all the libraries.
Fixed.


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



More information about the llvm-commits mailing list