[PATCH] D11073: Architectures for darwin need to be conditionalized based on the operating system.

Chris Bieneman beanz at apple.com
Thu Jul 9 11:15:59 PDT 2015


beanz created this revision.
beanz added reviewers: zaks.anna, bogner, kubabrecka, samsonov.
beanz added a subscriber: llvm-commits.

At the moment this isn't a really great way to handle this, but using the SANITIZER_COMMON_DARWIN_${os}_ARCHES which is per-os, is a good start.

http://reviews.llvm.org/D11073

Files:
  cmake/Modules/AddCompilerRT.cmake
  lib/asan/CMakeLists.txt
  lib/ubsan/CMakeLists.txt

Index: lib/ubsan/CMakeLists.txt
===================================================================
--- lib/ubsan/CMakeLists.txt
+++ lib/ubsan/CMakeLists.txt
@@ -51,7 +51,7 @@
       CFLAGS ${UBSAN_STANDALONE_CFLAGS})
     foreach(os ${SANITIZER_COMMON_SUPPORTED_OS})
       add_compiler_rt_darwin_dynamic_runtime(clang_rt.ubsan_${os}_dynamic ${os}
-        ARCHS ${UBSAN_SUPPORTED_ARCH}
+        ARCHS ${SANITIZER_COMMON_DARWIN_${os}_ARCHES}
         SOURCES $<TARGET_OBJECTS:RTUbsan.${os}>
                 $<TARGET_OBJECTS:RTUbsan_standalone.${os}>
                 $<TARGET_OBJECTS:RTSanitizerCommon.${os}>)
Index: lib/asan/CMakeLists.txt
===================================================================
--- lib/asan/CMakeLists.txt
+++ lib/asan/CMakeLists.txt
@@ -113,7 +113,7 @@
 if(APPLE)
   foreach (os ${SANITIZER_COMMON_SUPPORTED_OS})
     add_compiler_rt_darwin_dynamic_runtime(clang_rt.asan_${os}_dynamic ${os}
-      ARCHS ${ASAN_SUPPORTED_ARCH}
+      ARCHS ${SANITIZER_COMMON_DARWIN_${os}_ARCHES}
       SOURCES $<TARGET_OBJECTS:RTAsan.${os}>
               $<TARGET_OBJECTS:RTInterception.${os}>
               $<TARGET_OBJECTS:RTSanitizerCommon.${os}>
Index: cmake/Modules/AddCompilerRT.cmake
===================================================================
--- cmake/Modules/AddCompilerRT.cmake
+++ cmake/Modules/AddCompilerRT.cmake
@@ -19,6 +19,8 @@
       set(libname "${name}.${os}")
       set(libnames ${libnames} ${libname})
       set(extra_cflags_${libname} ${DARWIN_${os}_CFLAGS})
+      set(extra_linkflags_${libname} ${DARWIN_${os}_LINKFLAGS})
+      set(LIB_ARCHS_${libname} ${SANITIZER_COMMON_DARWIN_${os}_ARCHES})
     endforeach()
   else()
     foreach(arch ${LIB_ARCHS})
@@ -39,7 +41,9 @@
     set_property(TARGET ${libname} APPEND PROPERTY
       COMPILE_DEFINITIONS ${LIB_DEFS})
     if(APPLE)
-      set_target_properties(${libname} PROPERTIES OSX_ARCHITECTURES "${LIB_ARCHS}")
+      set_target_properties(${libname} PROPERTIES
+        OSX_ARCHITECTURES "${LIB_ARCHS_${libname}}"
+        LINK_FLAGS "${extra_linkflags_${libname}}")
     endif()
   endforeach()
 endfunction()


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D11073.29361.patch
Type: text/x-patch
Size: 2122 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150709/eb3ab0b2/attachment.bin>


More information about the llvm-commits mailing list