]> git.puffer.fish Git - mirror/frr.git/commitdiff
build: use `--coverage` for gcov 9102/head
authorDavid Lamparter <equinox@opensourcerouting.org>
Wed, 21 Jul 2021 09:23:23 +0000 (11:23 +0200)
committerDavid Lamparter <equinox@opensourcerouting.org>
Wed, 21 Jul 2021 15:12:02 +0000 (17:12 +0200)
libtool does not understand `-coverage` with a single dash.  Official
gcc docs also say `--coverage` rather than `-coverage`.  (clang lists
both.)

Also, for correct linking, libtool needs `--coverage` in LDFLAGS as
opposed to `-lgcov` (with the latter you get library ordering/deps
issues)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
configure.ac

index ecab39a30f66e732c42bb0a9189fdf391a814da4..c86f47d07305b668005f6b6f06e9a0fe275c3323 100644 (file)
@@ -264,11 +264,11 @@ AC_C_FLAG([-std=gnu11], [CC="$ac_cc"], [CC="$CC -std=gnu11"])
 dnl if the user has specified any CFLAGS, override our settings
 if test "$enable_gcov" = "yes"; then
    if test "$orig_cflags" = ""; then
-      AC_C_FLAG([-coverage])
+      AC_C_FLAG([--coverage])
       AC_C_FLAG([-O0])
    fi
 
-   AC_LDFLAGS="${AC_LDFLAGS} -lgcov"
+   AC_LDFLAGS="${AC_LDFLAGS} --coverage"
 fi
 
 if test "$enable_clang_coverage" = "yes"; then