Re: code coverage patch

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: pgsql-hackers(at)postgresql(dot)org
Cc: Michelle Caisse <Michelle(dot)Caisse(at)sun(dot)com>
Subject: Re: code coverage patch
Date: 2008-08-28 11:23:24
Message-ID: 200808281423.24923.peter_e@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Michelle Caisse wrote:
> Also, two tests fail with the following diff when the build is
> configured with --enable-coverage.
> RETURNS trigger
> AS
> '/home/michelle/trunkClean/pgsql/src/test/regress/../../../contrib/spi/refi
>nt.so' LANGUAGE C;
> + ERROR: could not load library
> "/home/michelle/trunkClean/pgsql/src/test/regress/../../../contrib/spi/refi
>nt.so":
> /home/michelle/trunkClean/pgsql/src/test/regress/../../../contrib/spi/refin
>t.so: undefined symbol: __gcov_merge_add

The reason for that problem is that the shared object needs to be linked
with -fprofile-arcs -ftest-coverage. (One of these causes -lgcov to be
linked, which includes the missing symbol.) This is not done because the
shared object link rules don't use CFLAGS.

I think for most platforms it would actually be more correct to use CFLAGS in
linking. There may be the odd exception, but usually CFLAGS contains some
assortment of -O, -g, -W, and maybe -f options, which should do more good
than harm when linking.

Any concerns about selectively adding CFLAGS to shared library linking rules?

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Abhijit Menon-Sen 2008-08-28 11:34:37 Re: September Commit Fest coming soon!
Previous Message Hitoshi Harada 2008-08-28 11:09:21 Re: September Commit Fest coming soon!