From: Andrew Bartlett Date: Wed, 26 Aug 2020 03:37:57 +0000 (+1200) Subject: oss-fuzz: standardise on RUNPATH for the static-ish binaries X-Git-Tag: talloc-2.3.2~562 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e60df214998afc145ca482cab184691b3ddc3bb2;p=thirdparty%2Fsamba.git oss-fuzz: standardise on RUNPATH for the static-ish binaries We use ld.bfd for the coverage builds, rather than the faster ld.gold. We run the oss-fuzz autobuild target on Ubuntu 16.04 to more closely mirror the environment provided by the Google oss-fuzz build container. On Ubuntu 16.04, when linking with ld.bfd built binaries get a RPATH, but builds in Ubuntu 18.04 and those using ld.gold get a RUNPATH. Just convert them all to RUNPATH to make the check_build.sh test (run by the oss-fuzz autobuild target) easier. Signed-off-by: Andrew Bartlett Reviewed-by: Douglas Bagnall --- diff --git a/lib/fuzzing/oss-fuzz/build_samba.sh b/lib/fuzzing/oss-fuzz/build_samba.sh index 333e8c38561..b06e03c4903 100755 --- a/lib/fuzzing/oss-fuzz/build_samba.sh +++ b/lib/fuzzing/oss-fuzz/build_samba.sh @@ -88,6 +88,17 @@ do # Copy any system libraries needed by this fuzzer to $OUT/lib ldd $OUT/$bin | cut -f 2 -d '>' | cut -f 1 -d \( | cut -f 2 -d ' ' | xargs -i cp \{\} $OUT/lib/ + # Change any RPATH to RUNPATH. + # + # We use ld.bfd for the coverage builds, rather than the faster ld.gold. + # + # On Ubuntu 16.04, used for the oss-fuzz build, when linking with + # ld.bfd the binaries get a RPATH, but builds in Ubuntu 18.04 + # ld.bfd and those using ld.gold get a RUNPATH. + # + # Just convert them all to RUNPATH to make the check_build.sh test + # easier. + chrpath -c $OUT/$bin # Change RUNPATH so that the copied libraries are found on the # runner chrpath -r '$ORIGIN/lib' $OUT/$bin