diff options
author | Andrew Bartlett <abartlet@samba.org> | 2020-08-26 15:37:57 +1200 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2020-09-11 03:43:40 +0000 |
commit | e60df214998afc145ca482cab184691b3ddc3bb2 (patch) | |
tree | 63f651bb90c79e05855eee3ad5c8755d090fc0a6 /lib/fuzzing | |
parent | 53a368c58d006e50309127dd1e1c5adde47368bb (diff) | |
download | samba-e60df214998afc145ca482cab184691b3ddc3bb2.tar.gz |
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 <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Diffstat (limited to 'lib/fuzzing')
-rwxr-xr-x | lib/fuzzing/oss-fuzz/build_samba.sh | 11 |
1 files changed, 11 insertions, 0 deletions
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 |