[PATCH] D20741: [LibFuzzer] Reimplement how the optional user functions are called.

Dan Liew via llvm-commits llvm-commits at lists.llvm.org
Tue May 31 21:36:37 PDT 2016


delcypher added inline comments.

================
Comment at: lib/Fuzzer/FuzzerExtFunctionsDlsym.cpp:15
@@ +14,3 @@
+#include "FuzzerInternal.h"
+#if LIBFUZZER_APPLE
+
----------------
mehdi_amini wrote:
> Again, there is nothing Apple specific here AFAIK, please rename.
The comments above explain why this is the implementation we want to use on Apple platforms. Although this code compiles on Linux it does not work as intended unless an extra flag is passed to the linker by the client when linking against LibFuzzer. If we assume for the moment that we want LibFuzzer to be used with a platform's default linking behavior then this implementation is specific to the behavior of the Darwin linker (and possibly other non GNU linkers). If later it turns out we also need to use this implementation for other platforms (e.g. the *BSDs) then the #ifdef can be appropriately modified in the future.

If I had it my way I wouldn't use #ifdefs and would tell CMake to compile the appropriate file based on the host platform but that option is not available to me.


http://reviews.llvm.org/D20741





More information about the llvm-commits mailing list