phosek created this revision.
phosek added a reviewer: mcgrathr.
Herald added subscribers: cfe-commits, dexonsmith, mehdi_amini, mgorny.
Herald added a reviewer: EricWF.
Herald added a project: clang.

ASan provides its own operator new/delete to intercept all allocations
and deallocations. Currently, they rely on overriding weak symbols that
are already provided by libc++abi and libc++, but that solution is
fragile and breaks in certain scenarios, e.g. when libc++abi is
statically linked into a shared libc++.

Rather we should avoid providing new/delete operators when built with
ASan altogether and rely on new/delete operators provided by the
sanitizer runtime.


Repository:
  rC Clang

https://reviews.llvm.org/D60235

Files:
  clang/cmake/caches/Fuchsia-stage2.cmake


Index: clang/cmake/caches/Fuchsia-stage2.cmake
===================================================================
--- clang/cmake/caches/Fuchsia-stage2.cmake
+++ clang/cmake/caches/Fuchsia-stage2.cmake
@@ -142,6 +142,9 @@
     
set(RUNTIMES_${target}-fuchsia_LIBCXX_STATICALLY_LINK_ABI_IN_SHARED_LIBRARY OFF 
CACHE BOOL "")
     set(RUNTIMES_${target}-fuchsia_LIBCXX_ABI_VERSION 2 CACHE STRING "")
 
+    
set(RUNTIMES_${target}-fuchsia-asan_LIBCXXABI_ENABLE_NEW_DELETE_DEFINITIONS OFF 
CACHE BOOL "")
+    set(RUNTIMES_${target}-fuchsia-asan_LIBCXX_ENABLE_NEW_DELETE_DEFINITIONS 
OFF CACHE BOOL "")
+
     # Use .build-id link.
     list(APPEND RUNTIME_BUILD_ID_LINK "${target}-fuchsia")
   endforeach()


Index: clang/cmake/caches/Fuchsia-stage2.cmake
===================================================================
--- clang/cmake/caches/Fuchsia-stage2.cmake
+++ clang/cmake/caches/Fuchsia-stage2.cmake
@@ -142,6 +142,9 @@
     set(RUNTIMES_${target}-fuchsia_LIBCXX_STATICALLY_LINK_ABI_IN_SHARED_LIBRARY OFF CACHE BOOL "")
     set(RUNTIMES_${target}-fuchsia_LIBCXX_ABI_VERSION 2 CACHE STRING "")
 
+    set(RUNTIMES_${target}-fuchsia-asan_LIBCXXABI_ENABLE_NEW_DELETE_DEFINITIONS OFF CACHE BOOL "")
+    set(RUNTIMES_${target}-fuchsia-asan_LIBCXX_ENABLE_NEW_DELETE_DEFINITIONS OFF CACHE BOOL "")
+
     # Use .build-id link.
     list(APPEND RUNTIME_BUILD_ID_LINK "${target}-fuchsia")
   endforeach()
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to