Commit 24606aea authored by Yedidya Feldblum's avatar Yedidya Feldblum Committed by Facebook Github Bot

Rename FOLLY_ASAN_ENABLED to FOLLY_LIBRARY_SANITIZE_ADDRESS

Summary: [Folly] Rename `FOLLY_ASAN_ENABLED` to `FOLLY_LIBRARY_SANITIZE_ADDRESS`.

Reviewed By: simpkins

Differential Revision: D10414837

fbshipit-source-id: b7ca2a36dd7f91ccab2f8051f78c75909f378d16
parent 348f8727
......@@ -75,7 +75,7 @@
#cmakedefine FOLLY_HAVE_LIBZSTD 1
#cmakedefine FOLLY_HAVE_LIBBZ2 1
#cmakedefine FOLLY_ASAN_ENABLED 1
#cmakedefine FOLLY_LIBRARY_SANITIZE_ADDRESS 1
#cmakedefine FOLLY_SUPPORT_SHARED_LIBRARY 1
#cmakedefine FOLLY_HAVE_SENDMMSG 1
......
......@@ -157,13 +157,13 @@ if(NOT FOLLY_CPP_ATOMIC_BUILTIN)
endif()
option(
FOLLY_ASAN_ENABLED
FOLLY_LIBRARY_SANITIZE_ADDRESS
"Build folly with Address Sanitizer enabled."
OFF
)
if (FOLLY_ASAN_ENABLED)
if (FOLLY_LIBRARY_SANITIZE_ADDRESS)
if ("${CMAKE_CXX_COMPILER_ID}" MATCHES GNU)
set(FOLLY_ASAN_ENABLED ON)
set(FOLLY_LIBRARY_SANITIZE_ADDRESS ON)
set(FOLLY_ASAN_FLAGS -fsanitize=address,undefined)
list(APPEND FOLLY_CXX_FLAGS ${FOLLY_ASAN_FLAGS})
# All of the functions in folly/detail/Sse.cpp are intended to be compiled
......@@ -175,7 +175,7 @@ if (FOLLY_ASAN_ENABLED)
PROPERTIES COMPILE_FLAGS -fno-sanitize=address,undefined
)
elseif ("${CMAKE_CXX_COMPILER_ID}" MATCHES Clang)
set(FOLLY_ASAN_ENABLED ON)
set(FOLLY_LIBRARY_SANITIZE_ADDRESS ON)
set(
FOLLY_ASAN_FLAGS
-fno-common
......
......@@ -68,8 +68,8 @@
* itself was compiled without ASAN but a downstream project that uses folly is
* compiling with ASAN enabled.
*
* Use FOLLY_ASAN_ENABLED (defined in folly-config.h) to check if folly itself
* was compiled with ASAN enabled.
* Use FOLLY_LIBRARY_SANITIZE_ADDRESS (defined in folly-config.h) to check if
* folly itself was compiled with ASAN enabled.
*/
#if FOLLY_HAS_FEATURE(address_sanitizer) || __SANITIZE_ADDRESS__
#define FOLLY_SANITIZE_ADDRESS 1
......
......@@ -122,7 +122,7 @@ namespace folly {
* folly/Portability.h, the value of kIsSanitizeAddress may be different
* from whether or not the current compilation unit is being compiled with ASAN.
*/
#if FOLLY_ASAN_ENABLED
#if FOLLY_LIBRARY_SANITIZE_ADDRESS
constexpr bool kIsSanitizeAddress = true;
#else
constexpr bool kIsSanitizeAddress = false;
......
......@@ -36,7 +36,7 @@ EmptyTagVectorType kEmptyTagVector = {};
//// Debug and ASAN stuff
#if defined(FOLLY_TLS) && (!defined(NDEBUG) || FOLLY_ASAN_ENABLED)
#if defined(FOLLY_TLS) && (!defined(NDEBUG) || FOLLY_LIBRARY_SANITIZE_ADDRESS)
#define FOLLY_F14_DETAIL_TLS_SIZE_T FOLLY_TLS std::size_t
#else
#define FOLLY_F14_DETAIL_TLS_SIZE_T std::atomic<std::size_t>
......
......@@ -54,7 +54,7 @@
#include <folly/container/detail/F14IntrinsicsAvailability.h>
#include <folly/container/detail/F14Mask.h>
#if FOLLY_ASAN_ENABLED && defined(FOLLY_TLS)
#if FOLLY_LIBRARY_SANITIZE_ADDRESS && defined(FOLLY_TLS)
#define FOLLY_F14_TLS_IF_ASAN FOLLY_TLS
#else
#define FOLLY_F14_TLS_IF_ASAN
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment