Open
Description
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, 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.