-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Make Centipede a default engine #9427
Changes from all commits
be42b22
e2a15d8
87b26c4
3b3c1da
3e7af92
1b4b623
715471f
447e163
9c536a4
334aff6
d43e235
e633dfc
38d53f2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,9 +27,15 @@ cp "$BIN_DIR/libcentipede_runner.pic.a" "$LIB_FUZZING_ENGINE" | |
|
||
export DFTRACING_FLAGS='-fsanitize-coverage=trace-loads' | ||
export CENTIPEDE_FLAGS=`cat "$SRC/centipede/clang-flags.txt" | tr '\n' ' '` | ||
export LIBRARIES_FLAGS="-Wno-unused-command-line-argument -ldl -lrt -lpthread $SRC/centipede/weak.o" | ||
export LIBRARIES_FLAGS="-lc++ -Wno-unused-command-line-argument" | ||
|
||
export CFLAGS="$CFLAGS $DFTRACING_FLAGS $CENTIPEDE_FLAGS $LIBRARIES_FLAGS" | ||
export CXXFLAGS="$CXXFLAGS $DFTRACING_FLAGS $CENTIPEDE_FLAGS $LIBRARIES_FLAGS" | ||
# For Meson. | ||
export LDFLAGS='/src/centipede/weak.o' | ||
|
||
# For Centipede's ld | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. end with period. |
||
export CENTIPEDE_BIN="$SRC/centipede/bin" | ||
export PATH="$CENTIPEDE_BIN":$PATH | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Put ending quote on the end of this line. |
||
|
||
echo 'done.' |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,6 +32,15 @@ bazel --bazelrc=/tmp/centipede.bazelrc build -c opt :all | |
# The weak symbols provides fake implementations for intermediate binaries. | ||
$CXX "$SRC/centipede/weak_sancov_stubs.cc" -c -o "$SRC/centipede/weak.o" | ||
|
||
# Centipede's ld, which always appends weak.o as a parameter. | ||
export CENTIPEDE_BIN="$SRC/centipede/bin" | ||
mkdir -p $CENTIPEDE_BIN | ||
cat << EOF > ${CENTIPEDE_BIN}/ld | ||
#!/bin/bash | ||
/usr/bin/ld \$@ -ldl -lrt -lpthread -lc++ /src/centipede/weak.o | ||
EOF | ||
chmod 777 ${CENTIPEDE_BIN}/ld | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are we setting this to be the linker somewhere? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah got it. Do you mind giving me an hour to test #9300? I have a hunch most of the major fixes have been pushed and I think this PR has some unecessary complexity. I suspect this LD wrapper isn't necessary There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sure, I am working on google/fuzzbench#1632 now. |
||
|
||
echo 'Removing extra stuff leftover to avoid bloating image.' | ||
|
||
rm -rf /clang-*.tgz /clang | ||
|
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.
I'm still not clear why centipede is so unique that we need to support LDFLAGS after six years of not needing it.
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.
Which projects does this help? Most meson projects seem broken still.
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.
Yeah, I will test removing it here.
I've added
weak.o
told
wrapper, not sure if that works formeson
.