fuzzing: Add -lm to LDFLAGS if the coverage sanitizer is used
authorTobias Brunner <tobias@strongswan.org>
Tue, 2 Oct 2018 08:58:40 +0000 (10:58 +0200)
committerTobias Brunner <tobias@strongswan.org>
Tue, 2 Oct 2018 08:58:40 +0000 (10:58 +0200)
libFuzzer apparently uses math functions (e.g. ceilf) for that sanitizer.

configure.ac

index 673393f..1ef4373 100644 (file)
@@ -1292,6 +1292,9 @@ if test x$fuzzing = xtrue; then
        else
                # required for libFuzzer
                FUZZING_LDFLAGS="-stdlib=libc++ -lstdc++"
+               if test "$SANITIZER" = "coverage"; then
+                       FUZZING_LDFLAGS="$FUZZING_LDFLAGS -lm"
+               fi
                AC_SUBST(FUZZING_LDFLAGS)
        fi
 fi