Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions projects/ox-ruby/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,15 @@ cd $SRC/ox-ruby
gem build
RUZZY_DEBUG=1 gem install --development --verbose *.gem

# Sync gems folder with ruzzy
rsync -avu /install/ruzzy/* $OUT/fuzz_parse-gem

#for fuzz_target_path in $SRC/harnesses/fuzz_*.rb; do
# ruzzy-build "$fuzz_target_path"
#done

cp $SRC/harnesses/fuzz_parse.rb $OUT/
export GEM_PATH=$OUT/fuzz_parse-gem

echo """#!/usr/bin/env bash
# LLVMFuzzerTestOneInput for fuzzer detection.
Expand All @@ -37,6 +41,7 @@ this_dir=\$(dirname \"\$0\")
echo "GEM_HOME FIRST: \$GEM_HOME"

export GEM_HOME=\$this_dir/fuzz_parse-gem
export GEM_PATH=\$this_dir/fuzz_parse-gem
echo "GEM_PATH: \$GEM_PATH"
echo "GEM_HOME: \$GEM_HOME"
echo "Showing gem home:"
Expand All @@ -45,8 +50,7 @@ ls -la \$GEM_HOME
echo "Showing this dir:"
ls -la \$this_dir


/usr/local/bin/ruzzy \$this_dir/fuzz_parse.rb \$@""" > $OUT/fuzz_parse
ASAN_OPTIONS="allocator_may_return_null=1:detect_leaks=0:use_sigaltstack=0" LD_PRELOAD=\$(ruby -e 'require \"ruzzy\"; print Ruzzy::ASAN_PATH') ruby \$this_dir/fuzz_parse.rb \$@""" > $OUT/fuzz_parse

chmod +x $OUT/fuzz_parse

Expand Down
Loading