llvm-project/libcxx
Ben Wagner fb1582f6c5 [libc++] Disable coverage with sanitize-coverage=0
When building libcxx, libcxxabi, and libunwind the build environment may
specify any number of sanitizers. For some build feature tests these
sanitizers must be disabled to prevent spurious linking errors. With
-fsanitize= this is straight forward with -fno-sanitize=all. With
-fsanitize-coverage= there is no -fno-sanitize-coverage=all, but there
is the equivalent undocumented but tested -fsanitize-coverage=0.

The current build rules fail to disable 'trace-pc-guard'. By disabling
all sanitize-coverage flags, including 'trace-pc-guard', possible
spurious linker errors are prevented. In particular, this allows libcxx,
libcxxabi, and libunwind to be built with HonggFuzz.

CMAKE_REQUIRED_FLAGS is extra compile flags when running CMake build
configuration steps (like check_cxx_compiler_flag). It does not affect
the compile flags for the actual build of the project (unless of course
these flags change whether or not a given source compiles and links or
not). So libcxx, libcxxabi, and libunwind will still be built with any
specified sanitize-coverage as before. The build configuration steps
(which are mostly checking to see if certain compiler flags are
available) will not try to compile and link "int main() { return 0;}"
(or other specified source) with sanitize-coverage (which can fail to
link at this stage in building, since the final compile flags required
are yet to be determined).

The change to LIBFUZZER_CFLAGS was done to keep it consistent with the
obvious intention of disabling all sanitize-coverage. This appears to
be intentional, preventing the fuzzer driver itself from showing up in
any coverage calculations.

Reviewed By: #libunwind, #libc, #libc_abi, ldionne, phosek

Differential Revision: https://reviews.llvm.org/D116050
2022-01-07 17:53:21 -08:00
..
benchmarks Re-Reland "[benchmarks] Move libcxx's fork of google/benchmark and llvm/utils'" 2021-12-07 17:10:41 -08:00
cmake [libc++] Disable coverage with sanitize-coverage=0 2022-01-07 17:53:21 -08:00
docs [libc++] Implement P1072R10 (std::basic_string::resize_and_overwrite) 2022-01-07 00:09:16 +01:00
include [libc++] Add missing templated version of `std::lerp`. 2022-01-07 09:55:33 -05:00
lib Microsoft's floating-point to_chars powered by Ryu and Ryu Printf 2021-12-12 16:34:50 +01:00
src [libcxx] Use Fuchsia-native CPRNG for std::random_device 2022-01-04 10:24:18 -08:00
test [libc++] Add missing templated version of `std::lerp`. 2022-01-07 09:55:33 -05:00
utils [libc++] Implement P1072R10 (std::basic_string::resize_and_overwrite) 2022-01-07 00:09:16 +01:00
.clang-format [libc++] Update clang-format to C++20. 2021-10-30 12:50:57 +02:00
.clang-tidy [libc++][NFC] Disable clang-tidy checks 2021-12-06 01:51:23 +01:00
.gitignore [libcxx] Fix .gitignore to not exclude test directories 2020-03-25 17:52:23 -07:00
CMakeLists.txt [CMake] Use `LLVM_COMMON_CMAKE_UTILS` in runtimes just for clarity 2022-01-03 20:55:44 +00:00
CREDITS.TXT Microsoft's floating-point to_chars powered by Ryu and Ryu Printf 2021-12-12 16:34:50 +01:00
LICENSE.TXT
TODO.TXT [libc++] Disallow volatile types in std::allocator 2021-09-22 11:47:38 -04:00
appveyor-reqs-install.cmd
appveyor.yml