[llvm-dev] llvm-mc-[dis]assemble-fuzzer status?
Justin Bogner via llvm-dev
llvm-dev at lists.llvm.org
Thu Aug 24 16:10:15 PDT 2017
Kostya Serebryany <kcc at google.com> writes:
> On Thu, Aug 24, 2017 at 2:59 PM, Justin Bogner <mail at justinbogner.com>
> wrote:
>
>> Kostya Serebryany <kcc at google.com> writes:
>> >> I'd like llvm-isel-fuzzer to be added once its committed
>> >
>> > consider it done (once it's there)
>> >
>> >> (which should be as soon as LLVM fuzzers work in release builds
>> >> again). One potential issue is that llvm-isel-fuzzer is more of a
>> >> collection of fuzzers, and it needs some arguments to run (ie, to
>> >> choose the backend).
>> >
>> > I have the same problem with clang-proto-fuzzer, which uses the same
>> > approach with flags as llvm-isel-fuzzer.
>> >
>> > The solution I was thinking about is (drum roll!) to encode the flags in
>> > the binary name, e.g.
>> > "./llvm-isel-fuzzer,-flag1,-flag2" and then read these flags from
>> argv[0]
>> > in LLVMFuzzerInitialize()
>>
>> This is just horrible enough that it might work.
>
> This is not unheard of, right?
> clang++ is a link to clang, but they actually behave in different ways
Changing behaviour based on argv[0] is pretty common, yes. Literally
parsing arguments out of argv[0] is pretty novel ;)
This will probably work for the most part, as long as none of the
arguments we want to deal with have commas or spaces in them. The
biggest downside of this approach is that we have to implement the
splitting ourselves instead of letting the shell do it, and we really
don't want to have to implement something complicated and robust here.
More information about the llvm-dev
mailing list