1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

lib/fuzzing/oss-fuzz: copy required libraries to the build target

This is an alternative to static linking as we do not have static source
libraries for all the things we depend on.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Uri Simchoni <uri@samba.org>
This commit is contained in:
Andrew Bartlett 2019-11-07 14:22:07 +13:00 committed by Douglas Bagnall
parent 4946811eb6
commit cc128c7885

View File

@ -30,4 +30,17 @@ export LD
make -j
cp bin/fuzz_* $OUT/
# Make a directory for the system shared libraries to be copied into
mkdir -p $OUT/lib
# We can't static link to all the system libs with waf, so copy them
# to $OUT/lib and set the rpath to point there. This is similar to how
# firefox handles this.
for x in bin/fuzz_*
do
cp $x $OUT/
bin=`basename $x`
ldd $OUT/$bin | cut -f 2 -d '>' | cut -f 1 -d \( | cut -f 2 -d ' ' | xargs -i cp \{\} $OUT/lib/
chrpath -r '$ORIGIN/lib' $OUT/$bin
done