[llvm] r227252 - Add a Fuzzer library
pasi.parviainen at iki.fi
Wed Jan 28 15:45:39 PST 2015
On 29.1.2015 0:23, Kostya Serebryany wrote:
> On Wed, Jan 28, 2015 at 1:54 PM, Pasi Parviainen <pasi.parviainen at iki.fi>
>> On 28.1.2015 0:08, Kostya Serebryany wrote:
>>> Author: kcc
>>> Date: Tue Jan 27 16:08:41 2015
>>> New Revision: 227252
>>> URL: http://llvm.org/viewvc/llvm-project?rev=227252&view=rev
>>> Add a Fuzzer library
>>> A simple genetic in-process coverage-guided fuzz testing library.
>>> I've used this fuzzer to test clang-format
>>> (it found 12+ bugs, thanks djasper@ for the fixes!)
>>> and it may also help us test other parts of LLVM.
>>> So why not keep it in the LLVM repository?
>>> I plan to add the cmake build rules later (in a separate patch, if that's
>>> and also add a clang-format-fuzzer target.
>>> See README.txt for details.
>>> Test Plan: Tests will follow separately.
>>> Reviewers: djasper, chandlerc, rnk
>>> Reviewed By: rnk
>>> Subscribers: majnemer, ygribov, dblaikie, llvm-commits
>>> Differential Revision: http://reviews.llvm.org/D7184
>> Putting this library directly under lib/ tree feels a little bit out of
>> place. Perhaps utils/ or even tools/ trees would be more appropriate
>> locations for this library, since most of its value is in testing (on
>> limited environments, see below).
> I don't have any strong opinion here. But none of the reviewers objected.
>> Modified: llvm/trunk/lib/CMakeLists.txt
>>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/
>>> --- llvm/trunk/lib/CMakeLists.txt (original)
>>> +++ llvm/trunk/lib/CMakeLists.txt Tue Jan 27 16:08:41 2015
>>> @@ -17,3 +17,4 @@ add_subdirectory(Target)
>>> Added: llvm/trunk/lib/Fuzzer/CMakeLists.txt
>>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Fuzzer/
>>> --- llvm/trunk/lib/Fuzzer/CMakeLists.txt (added)
>>> +++ llvm/trunk/lib/Fuzzer/CMakeLists.txt Tue Jan 27 16:08:41 2015
>>> @@ -0,0 +1,9 @@
>>> +add_library(LLVMFuzzer STATIC
>>> + EXCLUDE_FROM_ALL # Do not build if you are not building fuzzers.
>>> + FuzzerCrossOver.cpp
>>> + FuzzerIO.cpp
>>> + FuzzerLoop.cpp
>>> + FuzzerMain.cpp
>>> + FuzzerMutate.cpp
>>> + FuzzerUtil.cpp
>>> + )
>> This target should only be added when build environment can satisfy its
>> requirements (sufficient posix interfaces + asan support), otherwise there
>> will be a build target which is known to fail. Fuzzers depending on this
>> library can then simply enable themselves by existence of this target.
> That's what EXCLUDE_FROM_ALL is for, right?
The point was that, though it is excluded from a default target, it's
still available as a target anyway. And when trying to build that
target, it will fail on environments which can not satisfy its
requirements, such as MSVC.
More information about the llvm-commits