]> git.puffer.fish Git - mirror/frr.git/commitdiff
build: use `--coverage` for gcov 9158/head
authorDavid Lamparter <equinox@opensourcerouting.org>
Wed, 21 Jul 2021 09:23:23 +0000 (11:23 +0200)
committermergify-bot <noreply@mergify.io>
Fri, 23 Jul 2021 09:32:52 +0000 (09:32 +0000)
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>
(cherry picked from commit 81aff2127f35da2ec667bc60989cac7df7a8ef48)

configure.ac

index eae63aa84b27348a037fd47b44c1a560117dae0e..9f9518f6d2b23acc007dcf610453cdaf471ee468 100644 (file)
@@ -273,11 +273,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