• Adam Simpkins's avatar
    Add a FOLLY_ASAN_ENABLED macro · af21e4d6
    Adam Simpkins authored
    Summary:
    Add a new macro to track if folly was compiled with ASAN enabled.  This
    is in addition to the existing FOLLY_SANITIZE_ADDRESS macro, which
    reports if the current .cpp file is being compiled with ASAN enabled.
    
    In particular, these macros differ in open source builds if folly was
    compiled without ASAN enabled, but some of its headers are being
    included from downstream libraries that are being built with ASAN
    enabled.
    
    Previously several headers would define structures differently based on
    `FOLLY_SANITIZE_ADDRESS`, which meant that different .cpp files would see
    different definitions of these structures.  `FOLLY_ASAN_ENABLED` is generally
    the correct macro to use for situations like this.
    
    This diff fixes F14Table.h to use FOLLY_ASAN_ENABLED, but several other
    headers probably should also be updated in the future.
    
    I did not change the behavior of FOLLY_SANITIZE_ADDRESS, since it appears to
    be used by several projects outside of folly, and they expect it to report if
    their code is being compiled with ASAN enabled.
    
    At the moment the open source build does not support compiling with ASAN,
    so FOLLY_ASAN_ENABLED is always disabled in open source builds.
    
    Reviewed By: nbronson
    
    Differential Revision: D10401271
    
    fbshipit-source-id: 7e028737b42eecae93f06538dcf76dd64bd32e6a
    af21e4d6
FollyConfigChecks.cmake 6.65 KB