[PATCH] [ASan] Add CMake configs for libclang_rt.asan_iossim_dynamic.dylib
Alexander Potapenko
glider at google.com
Thu Nov 7 02:13:08 PST 2013
Landed r194199, thanks for the review.
================
Comment at: ../projects/compiler-rt/CMakeLists.txt:34
@@ -33,1 +33,3 @@
+# Obtain the iOS Simulator SDK path from xcodebuild.
+# ${IOSSIM_SDK_DIR} is used in AddCompilerRT and can't be moved below it.
----------------
Alexey Samsonov wrote:
> Can't it? AddCompilerRT.cmake just defines some macro, and the actual substitution should happen when we actually call these macro from lib/asan/CMakeLists.txt (or whatever). IOSSIM_SDK_DIR will already be defined at that point.
Looks like you're right, fixed.
================
Comment at: ../projects/compiler-rt/lib/asan/CMakeLists.txt:102
@@ +101,3 @@
+ DEFS ${ASAN_COMMON_DEFINITIONS}
+ LINKFLAGS ${ASAN_RUNTIME_LDFLAGS}
+ )
----------------
Alexey Samsonov wrote:
> Nit: don't put ) on the next line (for consistency)
Done
================
Comment at: ../projects/compiler-rt/lib/asan/CMakeLists.txt:86
@@ -90,4 +85,3 @@
# provided by the instrumented modules.
- LINKFLAGS "-framework Foundation"
- "-undefined dynamic_lookup")
- list(APPEND ASAN_RUNTIME_LIBRARIES clang_rt.asan_osx_dynamic)
+ if (os STREQUAL "osx")
+ set(ASAN_RUNTIME_LDFLAGS
----------------
Alexey Samsonov wrote:
> Nit: I'd prefer
> set(ASAN_RUNTIME_LDFLAGS
> "-undefined dynamic_lookup")
> if (os STREQUAL "osx")
> list(APPEND ASAN_RUNTIME_LDFLAGS "-framework Foundation")
> endif()
Done
================
Comment at: ../projects/compiler-rt/cmake/Modules/AddCompilerRT.cmake:99
@@ +98,3 @@
+ if (os STREQUAL "osx")
+ set_target_compile_flags(${name} ${LIB_CFLAGS} ${OSX_CFLAGS})
+ set_target_link_flags(${name} ${LIB_LINKFLAGS})
----------------
Alexey Samsonov wrote:
> OSX_CFLAGS -> DARWIN_${os}_CFLAGS (same for IOSSIM_CFLAGS below).
Done
================
Comment at: ../projects/compiler-rt/cmake/Modules/AddCompilerRT.cmake:103
@@ +102,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
----------------
Alexey Samsonov wrote:
> So... why not have (empty) DARWIN_osx_LINKFLAGS and non-empty DARWIN_iossim_LINKFLAGS?
Done
http://llvm-reviews.chandlerc.com/D2080
More information about the llvm-commits
mailing list