llvm-project/clang/lib/Driver
Dokyung Song 831ae45e3d Recommit "[libFuzzer] Link libFuzzer's own interceptors when other compiler runtimes are not linked."
Summary: libFuzzer intercepts certain library functions such as memcmp/strcmp by defining weak hooks. Weak hooks, however, are called only when other runtimes such as ASan is linked. This patch defines libFuzzer's own interceptors, which is linked into the libFuzzer executable when other runtimes are not linked, i.e., when -fsanitize=fuzzer is given, but not others.

The patch once landed but was reverted in 8ef9e2bf35 due to an assertion failure caused by calling an intercepted function, strncmp, while initializing the interceptors in fuzzerInit(). This issue is now fixed by calling libFuzzer's own implementation of library functions (i.e., internal_*) when the fuzzer has not been initialized yet, instead of recursively calling fuzzerInit() again.

Reviewers: kcc, morehouse, hctim

Subscribers: #sanitizers, krytarowski, mgorny, cfe-commits

Tags: #clang, #sanitizers

Differential Revision: https://reviews.llvm.org/D83494
2020-07-23 15:59:07 +00:00
..
ToolChains Recommit "[libFuzzer] Link libFuzzer's own interceptors when other compiler runtimes are not linked." 2020-07-23 15:59:07 +00:00
Action.cpp Add Statically Linked Libraries 2020-06-22 19:48:49 +00:00
CMakeLists.txt [VE] Rename VE toolchain source files 2020-07-02 18:45:16 +09:00
Compilation.cpp [CUDA][HIP] Add -Xarch_device and -Xarch_host options 2020-03-24 10:13:05 -04:00
DarwinSDKInfo.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
Distro.cpp Add support of the next Ubuntu (Ubuntu 20.10 - Groovy Gorilla) 2020-05-19 08:30:25 +02:00
Driver.cpp [Driver] --print-search-dirs: print -B options and COMPILER_PATH 2020-07-18 21:01:41 -07:00
DriverOptions.cpp [Driver] Use shared singleton instance of DriverOptTable 2019-09-04 14:26:28 +00:00
InputInfo.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
Job.cpp Clang Driver: refactor support for writing response files to be 2020-06-29 18:27:02 -04:00
Multilib.cpp Make llvm::StringRef to std::string conversions explicit. 2020-01-28 23:25:25 +01:00
OptionUtils.cpp [NFC] Move OptionUtils from Basic to Driver 2019-12-23 08:11:23 -05:00
Phases.cpp [clang][ifs] Clang Interface Stubs ToolChain plumbing. 2019-10-08 15:23:14 +00:00
SanitizerArgs.cpp Recommit "[libFuzzer] Link libFuzzer's own interceptors when other compiler runtimes are not linked." 2020-07-23 15:59:07 +00:00
Tool.cpp Clang Driver: refactor support for writing response files to be 2020-06-29 18:27:02 -04:00
ToolChain.cpp [Driver] Add --ld-path= and deprecate -fuse-ld=/abs/path and -fuse-ld=rel/path 2020-07-20 09:34:39 -07:00
Types.cpp accept 'clang++ -c a.pch -o a.o' to create PCH's object file 2020-07-22 10:21:23 +02:00
XRayArgs.cpp [Driver] Delete CC1 -fxray-function-index and clean up some tests 2020-06-17 13:00:22 -07:00