[PATCH] Fix build with --enable-gcov with newer gcc.

Cornelia Huck cohuck at de.ibm.com
Tue Aug 23 06:31:32 PDT 2005


Since gcc 3.4.4, 4.0.1 and 4.1.0, some gcov symbols have been declared
hidden, resulting in a link error when trying to link hald-probe-*. The
problem is that libhal.so hasn't been linked with libgcov.

 configure.in       |    2 ++
 libhal/Makefile.am |    7 ++++++-
 2 files changed, 8 insertions(+), 1 deletion(-)

Index: configure.in
===================================================================
RCS file: /cvs/hal/hal/configure.in,v
retrieving revision 1.98
diff -u -r1.98 configure.in
--- configure.in	23 Aug 2005 07:06:17 -0000	1.98
+++ configure.in	23 Aug 2005 13:15:22 -0000
@@ -216,6 +216,8 @@
   fi
 fi
 
+AM_CONDITIONAL(GCOV, test x$enable_gcov = xyes)
+
 dbus_module="dbus-1 >= 0.33"
 pkg_modules="glib-2.0 >= 2.6.0, gobject-2.0 >= 2.6.0, dbus-glib-1 >= 0.33, $dbus_module"
 PKG_CHECK_MODULES(PACKAGE, [$pkg_modules])
Index: libhal/Makefile.am
===================================================================
RCS file: /cvs/hal/hal/libhal/Makefile.am,v
retrieving revision 1.3
diff -u -r1.3 Makefile.am
--- libhal/Makefile.am	31 Jan 2005 20:06:41 -0000	1.3
+++ libhal/Makefile.am	23 Aug 2005 13:15:22 -0000
@@ -16,7 +16,12 @@
 	libhal.c                  libhal.h
 
 
-libhal_la_LIBADD = @DBUS_LIBS@ 
+if GCOV
+LIBGCOV = -lgcov
+else
+LIBGCOV = 
+endif
+libhal_la_LIBADD = @DBUS_LIBS@ $(LIBGCOV)
 
 libhal_la_LDFLAGS = -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)
 


More information about the hal mailing list