-
Notifications
You must be signed in to change notification settings - Fork 279
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AFL capability added to common.sh, corresponding changes to build.sh for LCMS and re2 #14
Conversation
Pushed some new code regarding "target_files()", @morehouse |
I like this better than the previous version -- seems cleaner to call functions defined in common.sh than to require common.sh to be included at a specific point in the code. Interested in what @kcc thinks of this. |
common.sh
Outdated
$CC -c -w $AFL_SRC/llvm_mode/afl-llvm-rt.o.c | ||
$CXX -g -fsanitize-coverage=trace-pc-guard $TARGET_FILE $TARGET_INCLUDE -c | ||
|
||
UNIQUE_BUILD="$AFL_DRIVER afl-llvm-rt.o.o ${TARGET_NAME}.o $UNIQUE_BUILD" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
again, you are using TARGET_NAME defined in build.sh. Please don't.
More generally, avoid circular deps between .sh files -- it gets too messy too soon.
both build_afl and build_libfuzzer should produce libFuzzingEngine.a or some such, then build.sh should link against it.
common.sh
Outdated
build_libfuzzer() { | ||
$LIBFUZZER_SRC/build.sh | ||
#mv libFuzzer.a $LIB_FUZZING_ENGINE # more consistent style, breaks backwards compatibility | ||
LIB_FUZZING_ENGINE="libFuzzer.a" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe don't do this, instead change all the build.sh files to use $LIB_FUZZING_ENGINE
lcms-2017-03-21/build.sh
Outdated
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
. $(dirname $0)/../common.sh | ||
|
||
. $(dirname $0)/../common.sh $1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove $1
instead, use env var, e.g. FUZZING_ENGINE
Default (empty) means libFuzzer
why did you chmod +x common.sh? |
and this seems to have broken some becnhamrks, at least re2 |
Hopefully fixed in 30014fb |
Since merge, OpenSSL 1.0.1f is also failing to build for me. |
@morehouse do you have details? |
@kcc That's probably what I ran into. Just rebuilt and it worked. Should have looked at the README first. |
To build with afl, call:
./build.sh afl
Otherwise, both of these are equivalent:
We now name binaries "(name)_afl" in AFL mode, but maintain the status quo for libfuzzer; this way backward compatibility is maintained.