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