Makefile patch to make gcov work on Postgres contrib modules

From: Gregory Stark <stark(at)enterprisedb(dot)com>
To: PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org>
Subject: Makefile patch to make gcov work on Postgres contrib modules
Date: 2007-04-11 02:29:13
Message-ID: 87d52biqyu.fsf@stark.xeocode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


I was trying to use gcov on Postgres and ran into a problem where some contrib
modules were missing the key libcov symbols and failed to load. Korry very
helpfully tracked down the missing bit: the broken modules were ones built
using "gcc -shared" according to the rule in Makefile.linux which doesn't have
-lcov.

Actually better than adding -lcov, I think this rule really ought to have
CFLAGS in it in case there are other CFLAGS that are necessary at link time.

Index: src/makefiles/Makefile.linux
===================================================================
RCS file: /home/stark/src/REPOSITORY/pgsql/src/makefiles/Makefile.linux,v
retrieving revision 1.22
diff -c -r1.22 Makefile.linux
*** src/makefiles/Makefile.linux 9 Dec 2005 21:19:36 -0000 1.22
--- src/makefiles/Makefile.linux 11 Apr 2007 00:34:43 -0000
***************
*** 11,16 ****
endif

%.so: %.o
! $(CC) -shared -o $@ $<

sqlmansect = 7
--- 11,16 ----
endif

%.so: %.o
! $(CC) $(CFLAGS) -shared -o $@ $<

sqlmansect = 7

--
Gregory Stark
EnterpriseDB http://www.enterprisedb.com

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2007-04-11 05:03:50 Re: [mux@FreeBSD.org: Re: Anyone interested in improving postgresql scaling?]
Previous Message Kris Kennaway 2007-04-11 02:09:37 Re: [mux@FreeBSD.org: Re: Anyone interested in improving postgresql scaling?]