[libc-commits] [PATCH] D119789: [libc] change ASAN condition to generator expression

Michael Jones via Phabricator via libc-commits libc-commits at lists.llvm.org
Tue Feb 15 11:41:25 PST 2022


michaelrj updated this revision to Diff 408986.
michaelrj added a comment.

move the checking to inside the library rules


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D119789/new/

https://reviews.llvm.org/D119789

Files:
  libc/cmake/modules/LLVMLibCLibraryRules.cmake
  libc/src/stdlib/CMakeLists.txt


Index: libc/src/stdlib/CMakeLists.txt
===================================================================
--- libc/src/stdlib/CMakeLists.txt
+++ libc/src/stdlib/CMakeLists.txt
@@ -199,17 +199,16 @@
     message(FATAL_ERROR "Architecture ${LIBC_TARGET_ARCHITECTURE} is not supported by SCUDO. 
       Either disable LLVM_LIBC_INCLUDE_SCUDO or change your target architecture.")
   endif()
-  list(APPEND SCUDO_DEPS RTScudoStandalone.${LIBC_TARGET_ARCHITECTURE} 
-       RTScudoStandaloneCWrappers.${LIBC_TARGET_ARCHITECTURE})
-  if((LIBC_TARGET_ARCHITECTURE IN_LIST ALL_GWP_ASAN_SUPPORTED_ARCH) 
-      AND COMPILER_RT_BUILD_GWP_ASAN)
-    list(APPEND SCUDO_DEPS RTGwpAsan.${LIBC_TARGET_ARCHITECTURE} 
-                            RTGwpAsanBacktraceLibc.${LIBC_TARGET_ARCHITECTURE} 
-                            RTGwpAsanSegvHandler.${LIBC_TARGET_ARCHITECTURE})
-  elseif(COMPILER_RT_BUILD_GWP_ASAN)
-    message(WARNING "Architecture ${LIBC_TARGET_ARCHITECTURE} is not supported by GWP-ASan. Skipping.")
-  endif()
 
+  list(APPEND SCUDO_DEPS RTScudoStandalone.${LIBC_TARGET_ARCHITECTURE}
+      RTScudoStandaloneCWrappers.${LIBC_TARGET_ARCHITECTURE})
+
+  list(APPEND SCUDO_DEPS
+    RTGwpAsan.${LIBC_TARGET_ARCHITECTURE}
+    RTGwpAsanBacktraceLibc.${LIBC_TARGET_ARCHITECTURE}
+    RTGwpAsanSegvHandler.${LIBC_TARGET_ARCHITECTURE}
+    )
+  
   add_entrypoint_external(
     malloc
     DEPENDS
Index: libc/cmake/modules/LLVMLibCLibraryRules.cmake
===================================================================
--- libc/cmake/modules/LLVMLibCLibraryRules.cmake
+++ libc/cmake/modules/LLVMLibCLibraryRules.cmake
@@ -82,7 +82,7 @@
   list(REMOVE_DUPLICATES all_deps)
   set(objects "")
   foreach(dep IN LISTS all_deps)
-    list(APPEND objects $<TARGET_OBJECTS:${dep}>)
+    list(APPEND objects $<$<STREQUAL:$<TARGET_NAME_IF_EXISTS:${dep}>,${dep}>:$<TARGET_OBJECTS:${dep}>>)
   endforeach(dep)
 
   add_library(


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D119789.408986.patch
Type: text/x-patch
Size: 1918 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libc-commits/attachments/20220215/6dff6814/attachment.bin>


More information about the libc-commits mailing list