[PATCH] D50059: [CMake] Fix bug in `add_weak_symbols()` function.

Dan Liew via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 13 06:00:39 PDT 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rL339559: [CMake] Fix bug in `add_weak_symbols()` function. (authored by delcypher, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D50059?vs=158235&id=160337#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D50059

Files:
  compiler-rt/trunk/cmake/Modules/SanitizerUtils.cmake


Index: compiler-rt/trunk/cmake/Modules/SanitizerUtils.cmake
===================================================================
--- compiler-rt/trunk/cmake/Modules/SanitizerUtils.cmake
+++ compiler-rt/trunk/cmake/Modules/SanitizerUtils.cmake
@@ -51,7 +51,15 @@
 # This function is only used on Darwin, where undefined symbols must be specified
 # in the linker invocation.
 function(add_weak_symbols libname link_flags)
-  file(STRINGS "${COMPILER_RT_SOURCE_DIR}/lib/${libname}/weak_symbols.txt" WEAK_SYMBOLS)
+  set(weak_symbols_file "${COMPILER_RT_SOURCE_DIR}/lib/${libname}/weak_symbols.txt")
+  file(STRINGS  "${weak_symbols_file}" WEAK_SYMBOLS)
+  # Add this file as a configure-time dependency so that changes to this
+  # file trigger a re-configure. This is necessary so that `${link_flags}`
+  # is changed when appropriate.
+  set_property(
+    DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
+    APPEND
+    PROPERTY CMAKE_CONFIGURE_DEPENDS "${weak_symbols_file}")
   set(local_link_flags ${${link_flags}})
   foreach(SYMBOL ${WEAK_SYMBOLS})
     set(local_link_flags ${local_link_flags} -Wl,-U,${SYMBOL})


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D50059.160337.patch
Type: text/x-patch
Size: 1111 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180813/7eabce1b/attachment.bin>


More information about the llvm-commits mailing list