[PATCH] D60235: [CMake] Disable libc++ and libc++abi new/delete definitions when built with ASan

2019-05-01 Thread Petr Hosek via Phabricator via cfe-commits
phosek abandoned this revision.
phosek added a comment.

No longer needed, this was done as part of D60926 
.


Repository:
  rC Clang

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

https://reviews.llvm.org/D60235



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D60235: [CMake] Disable libc++ and libc++abi new/delete definitions when built with ASan

2019-04-03 Thread Petr Hosek via Phabricator via cfe-commits
phosek added a subscriber: ldionne.
phosek added a comment.

In D60235#1454152 , @mcgrathr wrote:

> IMHO the library code should use `#if !__has_feature(...)` to avoid the 
> definitions entirely when built with a sanitizer whose runtime provides them.
>  But this is a fine way to achieve that while we wait for those libraries to 
> be fixed for sanitized builds.


I agree, D60176  implements that but @ldionne 
thinks that we should go with the CMake option.


Repository:
  rC Clang

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

https://reviews.llvm.org/D60235



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D60235: [CMake] Disable libc++ and libc++abi new/delete definitions when built with ASan

2019-04-03 Thread Roland McGrath via Phabricator via cfe-commits
mcgrathr accepted this revision.
mcgrathr added a comment.
This revision is now accepted and ready to land.

IMHO the library code should use `#if !__has_feature(...)` to avoid the 
definitions entirely when built with a sanitizer whose runtime provides them.
But this is a fine way to achieve that while we wait for those libraries to be 
fixed for sanitized builds.


Repository:
  rC Clang

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

https://reviews.llvm.org/D60235



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D60235: [CMake] Disable libc++ and libc++abi new/delete definitions when built with ASan

2019-04-03 Thread Petr Hosek via Phabricator via cfe-commits
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