Skip to content
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

Merged
merged 8 commits into from
Jul 13, 2017

Conversation

dnoursi
Copy link

@dnoursi dnoursi commented Jul 13, 2017

To build with afl, call:

./build.sh afl

Otherwise, both of these are equivalent:

./build.sh libfuzzer
./build.sh

We now name binaries "(name)_afl" in AFL mode, but maintain the status quo for libfuzzer; this way backward compatibility is maintained.

@dnoursi
Copy link
Author

dnoursi commented Jul 13, 2017

Pushed some new code regarding "target_files()", @morehouse

@morehouse
Copy link
Contributor

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"
Copy link
Contributor

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"
Copy link
Contributor

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

# Licensed under the Apache License, Version 2.0 (the "License");
. $(dirname $0)/../common.sh

. $(dirname $0)/../common.sh $1
Copy link
Contributor

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

@kcc kcc merged commit 2de22dc into google:master Jul 13, 2017
@kcc
Copy link
Contributor

kcc commented Jul 14, 2017

why did you chmod +x common.sh?

@kcc
Copy link
Contributor

kcc commented Jul 14, 2017

and this seems to have broken some becnhamrks, at least re2

@kcc
Copy link
Contributor

kcc commented Jul 14, 2017

Hopefully fixed in 30014fb

@morehouse
Copy link
Contributor

Since merge, OpenSSL 1.0.1f is also failing to build for me.

@kcc
Copy link
Contributor

kcc commented Jul 14, 2017

@morehouse do you have details?
The bot is green. http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fuzzer/builds/6521
Note that this version of openssl has a bug in Makefiles that causes the parallel build to be a bit flaky

@morehouse
Copy link
Contributor

@kcc That's probably what I ran into. Just rebuilt and it worked. Should have looked at the README first.

@kimiwanano kimiwanano mentioned this pull request Dec 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants