]> granicus.if.org Git - imagemagick/commitdiff
fix oss-fuzz build with libtiff
authorPaul Kehrer <paul.l.kehrer@gmail.com>
Mon, 23 Apr 2018 12:21:11 +0000 (07:21 -0500)
committerDirk Lemstra <dlemstra@users.noreply.github.com>
Mon, 23 Apr 2018 12:56:19 +0000 (14:56 +0200)
Magick++/fuzz/build.sh

index 20b5cc6219898292ca51c1e5e068801cfaf90dec..ef8c6c60333e16b3d6fde9b437a7298d3ad47aa7 100644 (file)
@@ -23,16 +23,22 @@ popd
 
 # Build libjpeg-turbo
 pushd "$SRC/libjpeg-turbo"
-cmake . -DCMAKE_INSTALL_PREFIX=$WORK -DENABLE_STATIC=on -DENABLE_SHARED=off
+CFLAGS="$CFLAGS -fPIC" cmake . -DCMAKE_INSTALL_PREFIX=$WORK -DENABLE_STATIC=on -DENABLE_SHARED=off
 make -j$(nproc)
 make install
 popd
 
 # Build libtiff
+# We build shared and static here to make IM's libtiff detection via autoconf more reliable
+# The fuzzers themselves link solely against the static build though.
 pushd "$SRC/libtiff"
 cmake . -DCMAKE_INSTALL_PREFIX=$WORK
 make -j$(nproc)
 make install
+git clean -fd
+cmake . -DCMAKE_INSTALL_PREFIX=$WORK -DBUILD_SHARED_LIBS=off
+make -j$(nproc)
+make install
 popd
 
 # Build liblcms2