From 541f9ee5ab66b41a2a8d9c54183b095ad99f3769 Mon Sep 17 00:00:00 2001 From: Uri Simchoni Date: Sat, 4 Sep 2021 10:11:58 +0300 Subject: fuzzing/oss-fuzz: fix RPATH comments for post-Ubuntu-16.04 era Remove what appears to be a copy+paste error in one place, and explain that RPATH/RUNPATH is set by the linker, not by chrpath utility. Signed-off-by: Uri Simchoni Reviewed-by: Andrew Bartlett --- lib/fuzzing/oss-fuzz/check_build.sh | 3 +-- lib/fuzzing/oss-fuzz/do_build.sh | 14 +++++--------- 2 files changed, 6 insertions(+), 11 deletions(-) (limited to 'lib/fuzzing') diff --git a/lib/fuzzing/oss-fuzz/check_build.sh b/lib/fuzzing/oss-fuzz/check_build.sh index 501c2c813fc..98b83a81bbf 100755 --- a/lib/fuzzing/oss-fuzz/check_build.sh +++ b/lib/fuzzing/oss-fuzz/check_build.sh @@ -25,8 +25,7 @@ do # Confirm that the chrpath was reset to lib/ in the same directory # as the binary. RPATH (not RUNPATH) is critical, otherwise # libraries used by libraries won't be found on the oss-fuzz - # target host, but is only possible with clang or ld.bfd on Ubuntu - # 16.04 (this script is only run on that). + # target host. chrpath -l $bin | grep 'RPATH=$ORIGIN/lib' # Confirm that we link to at least some libraries in this diff --git a/lib/fuzzing/oss-fuzz/do_build.sh b/lib/fuzzing/oss-fuzz/do_build.sh index 4c6796d2350..3cd4c12546b 100755 --- a/lib/fuzzing/oss-fuzz/do_build.sh +++ b/lib/fuzzing/oss-fuzz/do_build.sh @@ -254,16 +254,12 @@ do cp $x $OUT/ bin=`basename $x` - # Changing RPATH (not RUNPATH, but we can't tell here which was - # set) is critical, otherwise libraries used by libraries won't be - # found on the oss-fuzz target host. Sadly this is only possible - # with clang or ld.bfd on Ubuntu 16.04 (this script is only run on - # that). + # This means the copied libraries are found on the runner. # - # chrpath --convert only allows RPATH to be changed to RUNPATH, - # not the other way around, and we really don't want RUNPATH. - # - # This means the copied libraries are found on the runner + # The binaries should we built with RPATH, not RUNPATH, to allow + # libraries used by libraries to be found. This command retains the + # RPATH/RUNPATH header and only changes the path. We later verify this + # in the check_build.sh script. chrpath -r '$ORIGIN/lib' $OUT/$bin # Truncate the original binary to save space -- cgit v1.2.1