Skip to content

Commit c14a6a6

Browse files
ox-ruby: fix build (#14206)
Avoids the `ruzzy` logic at the base runner since it's not available on the bots. However, we can just put the ruzzy gem as part of the gems in the target fuzzing library. Signed-off-by: David Korczynski <david@adalogics.com>
1 parent 93642ed commit c14a6a6

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

projects/ox-ruby/build.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,15 @@ cd $SRC/ox-ruby
2424
gem build
2525
RUZZY_DEBUG=1 gem install --development --verbose *.gem
2626

27+
# Sync gems folder with ruzzy
28+
rsync -avu /install/ruzzy/* $OUT/fuzz_parse-gem
29+
2730
#for fuzz_target_path in $SRC/harnesses/fuzz_*.rb; do
2831
# ruzzy-build "$fuzz_target_path"
2932
#done
3033

3134
cp $SRC/harnesses/fuzz_parse.rb $OUT/
35+
export GEM_PATH=$OUT/fuzz_parse-gem
3236

3337
echo """#!/usr/bin/env bash
3438
# LLVMFuzzerTestOneInput for fuzzer detection.
@@ -37,6 +41,7 @@ this_dir=\$(dirname \"\$0\")
3741
echo "GEM_HOME FIRST: \$GEM_HOME"
3842
3943
export GEM_HOME=\$this_dir/fuzz_parse-gem
44+
export GEM_PATH=\$this_dir/fuzz_parse-gem
4045
echo "GEM_PATH: \$GEM_PATH"
4146
echo "GEM_HOME: \$GEM_HOME"
4247
echo "Showing gem home:"
@@ -45,8 +50,7 @@ ls -la \$GEM_HOME
4550
echo "Showing this dir:"
4651
ls -la \$this_dir
4752
48-
49-
/usr/local/bin/ruzzy \$this_dir/fuzz_parse.rb \$@""" > $OUT/fuzz_parse
53+
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
5054

5155
chmod +x $OUT/fuzz_parse
5256

0 commit comments

Comments
 (0)