]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
oss-fuzz: standardise on RUNPATH for the static-ish binaries
authorAndrew Bartlett <abartlet@samba.org>
Wed, 26 Aug 2020 03:37:57 +0000 (15:37 +1200)
committerAndrew Bartlett <abartlet@samba.org>
Fri, 11 Sep 2020 03:43:40 +0000 (03:43 +0000)
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>
lib/fuzzing/oss-fuzz/build_samba.sh

index 333e8c385610e1e4a9b40ced14fd0be6de2244f2..b06e03c4903fbafb4796e0b4f853c4ccf90e6f47 100755 (executable)
@@ -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