From: Mark Wielaard Date: Tue, 26 Nov 2019 07:56:44 +0000 (+0100) Subject: Fix BUILD_STATIC build and enable gcov for debuginfod. X-Git-Tag: elfutils-0.178~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3f81dbd235172709021cc453d256e855d271686e;p=thirdparty%2Felfutils.git Fix BUILD_STATIC build and enable gcov for debuginfod. libdw now always needs -lpthread and -ld even when BUILD_STATIC. BUILD_STATIC is only used when doing a gcov enabled build. Enable gcov coverage also for debuginfod. Signed-off-by: Mark Wielaard --- diff --git a/ChangeLog b/ChangeLog index 9d1c05f44..3d0756bed 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2019-11-26 Mark Wielaard + + * configure.ac: Add CXXFLAGS for gcov. + 2019-10-28 Aaron Merey * debuginfod/: New directory for debuginfod code. diff --git a/configure.ac b/configure.ac index 5deec3368..dc553bb68 100644 --- a/configure.ac +++ b/configure.ac @@ -299,6 +299,7 @@ AC_ARG_ENABLE([gcov], AS_HELP_STRING([--enable-gcov],[build binaries with gcov support]), [use_gcov=$enableval], [use_gcov=no]) if test "$use_gcov" = yes; then CFLAGS="$CFLAGS -fprofile-arcs -ftest-coverage" + CXXFLAGS="$CXXFLAGS -fprofile-arcs -ftest-coverage" LDFLAGS="$LDFLAGS -fprofile-arcs" fi AM_CONDITIONAL(GCOV, test "$use_gcov" = yes) diff --git a/debuginfod/ChangeLog b/debuginfod/ChangeLog index 4df45d83e..8aa29443e 100644 --- a/debuginfod/ChangeLog +++ b/debuginfod/ChangeLog @@ -1,3 +1,8 @@ +2019-11-26 Mark Wielaard + + * Makefile.am (BUILD_STATIC): Add needed libraries for libdw and + libdebuginfod. + 2019-11-25 Frank Ch. Eigler * debuginfod.cxx (groom): Add a sqlite3_db_release_memory() diff --git a/debuginfod/Makefile.am b/debuginfod/Makefile.am index ec0f49f11..52ead30ae 100644 --- a/debuginfod/Makefile.am +++ b/debuginfod/Makefile.am @@ -43,9 +43,9 @@ program_transform_name = s,x,x, if BUILD_STATIC libasm = ../libasm/libasm.a -libdw = ../libdw/libdw.a -lz $(zip_LIBS) $(libelf) $(libebl) -ldl +libdw = ../libdw/libdw.a -lz $(zip_LIBS) $(libelf) $(libebl) -ldl -lpthread libelf = ../libelf/libelf.a -lz -libdebuginfod = ./libdebuginfod.a +libdebuginfod = ./libdebuginfod.a $(libcurl_LIBS) else libasm = ../libasm/libasm.so libdw = ../libdw/libdw.so diff --git a/src/ChangeLog b/src/ChangeLog index 3144c935f..6af977ed0 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2019-11-26 Mark Wielaard + + * Makefile.am (BUILD_STATIC): Add libraries needed for libdw. + 2019-10-26 Mark Wielaard * unstrip.c (collect_symbols): Check symbol strings are diff --git a/src/Makefile.am b/src/Makefile.am index ab72a0e90..e462e7d7a 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -41,7 +41,7 @@ CLEANFILES += make-debug-archive if BUILD_STATIC libasm = ../libasm/libasm.a -libdw = ../libdw/libdw.a -lz $(zip_LIBS) $(libelf) +libdw = ../libdw/libdw.a -lz $(zip_LIBS) $(libelf) -ldl -lpthread libelf = ../libelf/libelf.a -lz else libasm = ../libasm/libasm.so diff --git a/tests/ChangeLog b/tests/ChangeLog index 27bc4ec2a..6e3923f5d 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,3 +1,9 @@ +2019-11-26 Mark Wielaard + + * Makefile.am (BUILD_STATIC): Add libraries needed for libdw. + * coverage.sh: Add debuginfod directory, check whether source + is .c or cxx. + 2019-11-24 Mark Wielaard * run-debuginfod-find.sh: Reduce verbosity. Add new cleanup diff --git a/tests/Makefile.am b/tests/Makefile.am index 83d27a067..eab4ae6f2 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -512,7 +512,7 @@ libasm = -lasm libebl = -lebl else !STANDALONE if BUILD_STATIC -libdw = ../libdw/libdw.a -lz $(zip_LIBS) $(libelf) $(libebl) +libdw = ../libdw/libdw.a -lz $(zip_LIBS) $(libelf) $(libebl) -ldl -lpthread libelf = ../libelf/libelf.a -lz libasm = ../libasm/libasm.a else diff --git a/tests/coverage.sh b/tests/coverage.sh index 5cc353c9c..01d292cc3 100755 --- a/tests/coverage.sh +++ b/tests/coverage.sh @@ -8,14 +8,14 @@ fi cd .. -for d in lib libasm libdw libdwfl libebl libelf backends src; do +for d in lib libasm libdw libdwfl libebl libelf backends src debuginfod; do tmp=$d-data cd $d unused=0 unused_files= for f in *.gcno; do base="$(basename $f .gcno)" - fc="$base.c" + if [ -f "$base.c" ]; then fc="$base.c"; else fc="$base.cxx"; fi gcda="$base.gcda" if [ -f "$gcda" ]; then gcov -n -a "$fc" |