From f171f17a756145251e1f2945b4feb6480d8adf67 Mon Sep 17 00:00:00 2001 From: Nathaniel Brough Date: Mon, 24 Apr 2023 12:22:55 -0700 Subject: [PATCH] Add dynamic libs to oss-fuzz image --- tests/fuzz/oss-fuzz-build.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tests/fuzz/oss-fuzz-build.sh b/tests/fuzz/oss-fuzz-build.sh index 8594658106..c178d1bfaf 100644 --- a/tests/fuzz/oss-fuzz-build.sh +++ b/tests/fuzz/oss-fuzz-build.sh @@ -5,4 +5,13 @@ conan install . --build=missing --update -s build_type=Release -o curaengine:ena cmake --preset release -DWITH_TEST_FUZZ=ON cmake --build --preset release -j$(nproc) -cp build/Release/tests/fuzz/Fuzz* $OUT \ No newline at end of file +cp build/Release/tests/fuzz/Fuzz* $OUT + +mkdir -p $OUT/lib +# Move all dynamic deps into output directory. +find ~/.conan/data -name '*.so*' -exec cp {} $OUT/lib/ \; + +# Rewrite dynamic linker paths to point to output directory +for fuzzer in $OUT/Fuzz*; do + chrpath -r '$ORIGIN/lib' $fuzzer +done