[PATCH] D28203: Enable weak hooks on darwin
Francis Ricci via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sat Dec 31 10:21:06 PST 2016
fjricci created this revision.
fjricci added reviewers: compnerd, eugenis.
fjricci added a subscriber: llvm-commits.
Herald added subscribers: mgorny, kubabrecka.
By default, darwin requires a definition for weak interface functions at
link time. Adding the '-undefined dynamic_lookup' link flag allows
weak interface functions without definitions, which mirrors behavior on
linux and windows.
https://reviews.llvm.org/D28203
Files:
cmake/config-ix.cmake
lib/sanitizer_common/sanitizer_internal_defs.h
Index: lib/sanitizer_common/sanitizer_internal_defs.h
===================================================================
--- lib/sanitizer_common/sanitizer_internal_defs.h
+++ lib/sanitizer_common/sanitizer_internal_defs.h
@@ -32,7 +32,7 @@
# define SANITIZER_WEAK_ATTRIBUTE __attribute__((weak))
#endif
-#if (SANITIZER_LINUX || SANITIZER_WINDOWS) && !SANITIZER_GO
+#if (SANITIZER_LINUX || SANITIZER_WINDOWS || SANITIZER_MAC) && !SANITIZER_GO
# define SANITIZER_SUPPORTS_WEAK_HOOKS 1
#else
# define SANITIZER_SUPPORTS_WEAK_HOOKS 0
Index: cmake/config-ix.cmake
===================================================================
--- cmake/config-ix.cmake
+++ cmake/config-ix.cmake
@@ -244,7 +244,8 @@
set(DARWIN_COMMON_LINKFLAGS
-stdlib=libc++
-lc++
- -lc++abi)
+ -lc++abi
+ -undefined dynamic_lookup)
check_linker_flag("-fapplication-extension" COMPILER_RT_HAS_APP_EXTENSION)
if(COMPILER_RT_HAS_APP_EXTENSION)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D28203.82775.patch
Type: text/x-patch
Size: 951 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161231/2e9ad19b/attachment.bin>
More information about the llvm-commits
mailing list