[compiler-rt] r256989 - [compiler-rt] On Darwin, link all frameworks with -fapplication-extension

Anna Zaks via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 6 15:15:04 PST 2016


Author: zaks
Date: Wed Jan  6 17:15:04 2016
New Revision: 256989

URL: http://llvm.org/viewvc/llvm-project?rev=256989&view=rev
Log:
[compiler-rt] On Darwin, link all frameworks with -fapplication-extension

The ASan dylib as well as other compiler-rt dylibs work with app extensions,
so we should add -fapplication-extension to the link line when building them.
This will avoid linker warnings when using the dylibs in app extensions.

(APIs unavailable to app extensions are listed here: https://developer.apple.com/library/ios/documentation/General/Conceptual/ExtensibilityPG/ExtensionOverview.html#//apple_ref/doc/uid/TP40014214-CH2-SW6)

Differential Revision: http://reviews.llvm.org/D15550

Modified:
    compiler-rt/trunk/cmake/config-ix.cmake

Modified: compiler-rt/trunk/cmake/config-ix.cmake
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/cmake/config-ix.cmake?rev=256989&r1=256988&r2=256989&view=diff
==============================================================================
--- compiler-rt/trunk/cmake/config-ix.cmake (original)
+++ compiler-rt/trunk/cmake/config-ix.cmake Wed Jan  6 17:15:04 2016
@@ -334,6 +334,11 @@ if(APPLE)
     -lc++
     -lc++abi)
   
+  check_linker_flag("-fapplication-extension" COMPILER_RT_HAS_APP_EXTENSION)
+  if(COMPILER_RT_HAS_APP_EXTENSION)
+    list(APPEND DARWIN_COMMON_LINKFLAGS "-fapplication-extension")
+  endif()
+
   set(DARWIN_osx_CFLAGS
     ${DARWIN_COMMON_CFLAGS}
     -mmacosx-version-min=${SANITIZER_MIN_OSX_VERSION})




More information about the llvm-commits mailing list