Issue 71211
Summary Replace the use of C++ standard library in libFuzzer
Labels compiler-rt:fuzzer
Assignees
Reporter petrhosek
    libFuzzer implementation uses C++ standard library but that introduces a number of issues:

* When libFuzzer is built against libc++, but the application uses libstdc++, we cannot use the two together.
* When libc++ itself is instrumented (for example with ASan), we cannot use it for libFuzzer.
* When the application is implemented in C, we may want to avoid a dependency on the C++ library.

The current solution is to use a private version of libc++, which was introduced in [D37631](https://reviews.llvm.org/D37631), but this introduces additional complexity and overhead to the build (since we need to build libc++ twice).

We should consider replacing the use of C++ standard library altogether and instead use custom implementation of the necessary containers and other utilities.

libFuzzer primarily uses `std::string`, `std::vector`, `std::unordered_map` and `std::set`. Rather than reimplementing these ourselves, we should be able to use stripped down and simplified implementations from LLVM ADT, which is strategy which was also [adopted for sanitizers](https://github.com/llvm/llvm-project/blob/dd639eb15aacfc865409915516f52385c4381923/compiler-rt/lib/sanitizer_common/sanitizer_dense_map.h).
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to