Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bugzilla DB migration completed. Please report issues to Infra team via email via infra@gentoo.org or IRC
Bug 274836 - dev-db/postgresql-{base,server}-8.4.4 ignores LDFLAGS
Summary: dev-db/postgresql-{base,server}-8.4.4 ignores LDFLAGS
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All All
: High normal (vote)
Assignee: PgSQL Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 285475
  Show dependency tree
 
Reported: 2009-06-20 16:22 UTC by Arfrever Frehtes Taifersar Arahesis (RETIRED)
Modified: 2011-03-21 04:15 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Ebuild Patch for LDFLAGS (postgresql-server-8.4.4-r1.ebuild.patch,589 bytes, patch)
2010-11-17 20:33 UTC, Aaron W. Swenson
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Arfrever Frehtes Taifersar Arahesis (RETIRED) gentoo-dev 2009-06-20 16:22:22 UTC
dev-db/postgresql-base-8.3.7 ignores LDFLAGS.

 * QA Notice: Files built without respecting LDFLAGS have been detected
 *  Please include the following list of files in your report:
 * /usr/lib64/postgresql-8.3/lib64/libecpg_compat.so.3.0
 * /usr/lib64/postgresql-8.3/lib64/libpq.so.5.1
 * /usr/lib64/postgresql-8.3/lib64/libpgtypes.so.3.0
 * /usr/lib64/postgresql-8.3/lib64/libecpg.so.6.0
Comment 1 Arfrever Frehtes Taifersar Arahesis (RETIRED) gentoo-dev 2009-09-10 18:22:03 UTC
dev-db/postgresql-base-8.4.1 also ignores LDFLAGS:

 * QA Notice: Files built without respecting LDFLAGS have been detected
 *  Please include the following list of files in your report:
 * /usr/lib64/postgresql-8.4/lib64/libpq.so.5.2
 * /usr/lib64/postgresql-8.4/lib64/libpgtypes.so.3.1
 * /usr/lib64/postgresql-8.4/lib64/libecpg.so.6.1
 * /usr/lib64/postgresql-8.4/lib64/libecpg_compat.so.3.1
Comment 2 Patrick Lauer gentoo-dev 2009-11-22 12:13:19 UTC
configure: using LDFLAGS=  -Wl,--as-needed

configure --help says:
  LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
              nonstandard directory <lib dir> 

From the configure.in:
# If compiler will take -Wl,--as-needed (or various platform-specific
# spellings thereof) then add that to LDFLAGS.

So it does respect LDFLAGS, but adds --as-needed by default. What's the best way to proceed with that?
Comment 3 Arfrever Frehtes Taifersar Arahesis (RETIRED) gentoo-dev 2009-11-22 13:36:46 UTC
(In reply to comment #2)
> So it does respect LDFLAGS, but adds --as-needed by default.

The code in Portage checks if --hash-style=gnu is respected.
Comment 4 Kerin Millar 2010-03-23 02:25:17 UTC
> So it does respect LDFLAGS, but adds --as-needed by default. What's the best
> way to proceed with that?

I changed both invocations of emake in src_unpack() to be as follows:

emake LDFLAGS="${LDFLAGS}" LDFLAGS_SL="${LDFLAGS}" || die "emake failed"

After building, I checked the flags:

# pg_config --ldflags
-Wl,-O1,--hash-style=gnu

# pg_config --ldflags_sl
-Wl,-O1,--hash-style=gnu

Problem solved, it would appear. I suppose that means we needn't import toolchain-funcs either.

Also, by default, it augments CFLAGS - and also requires CFLAGS_SL to affect shared libraries - in a similar fashion. But that would be another bug.
Comment 5 Kerin Millar 2010-03-23 02:27:23 UTC
I should also add that the above reported flags are exactly as I've defined them in make.conf ;)
Comment 6 Aaron W. Swenson gentoo-dev 2010-03-23 04:17:18 UTC
* QA Notice: Files built without respecting LDFLAGS have been detected
 *  Please include the following list of files in your report:         
 * /usr/lib/postgresql-8.4/lib/autoinc.so                              
 * /usr/lib/postgresql-8.4/lib/citext.so                               
 * /usr/lib/postgresql-8.4/lib/earthdistance.so                        
 * /usr/lib/postgresql-8.4/lib/insert_username.so                      
 * /usr/lib/postgresql-8.4/lib/isn.so                                  
 * /usr/lib/postgresql-8.4/lib/lo.so                                   
 * /usr/lib/postgresql-8.4/lib/moddatetime.so                          
 * /usr/lib/postgresql-8.4/lib/refint.so                               
 * /usr/lib/postgresql-8.4/lib/tablefunc.so                            
 * /usr/lib/postgresql-8.4/lib/timetravel.so                           
 * /usr/lib/postgresql-8.4/lib/tsearch2.so

That list is a third of the length than what I was getting before editing the emake line as K. Millar wrote it. (On a side note, the emake line(s) in src_compile(), not src_unpack().)

I'm not sure there is much more we can do without a patch or a good reason why PostgreSQL tacks on --as-needed during the compile.
Comment 7 Aaron W. Swenson gentoo-dev 2010-03-23 05:10:21 UTC
I should note that -base did NOT give any QA notices. It was -server that spewed out the above.
Comment 8 Aaron W. Swenson gentoo-dev 2010-05-02 15:58:36 UTC
I've done a bit more digging on this, and it looks like the modules excluded from LDFLAGS(_SL) are experimental functions, or they are already included in the server and those modules are there for backwards compatibility.
Comment 9 Patrick Lauer gentoo-dev 2010-06-02 17:23:27 UTC
+  02 Jun 2010; Patrick Lauer <patrick@gentoo.org>
+  +postgresql-base-7.4.29-r1.ebuild, +postgresql-base-8.0.25-r1.ebuild,
+  +postgresql-base-8.1.21-r1.ebuild, +postgresql-base-8.2.17-r1.ebuild,
+  +postgresql-base-8.3.11-r1.ebuild,
+  +files/postgresql-base-8.4-9.0-heimdal_strlcpy.patch,
+  +postgresql-base-8.4.4-r1.ebuild, +postgresql-base-9.0_beta1-r1.ebuild:
+  Fixes for #313765, #251046, #294462, #300793, #274836, #296714, #238817,
+  #278228, #263096, #246397, #285953. Thanks to Aaron Swenson for collecting
+  the fixes and testing.
Comment 10 Arfrever Frehtes Taifersar Arahesis (RETIRED) gentoo-dev 2010-06-03 21:30:05 UTC
dev-db/postgresql-server also needs to be fixed.
Comment 11 Aaron W. Swenson gentoo-dev 2010-06-03 23:26:17 UTC
(In reply to comment #10)
> dev-db/postgresql-server also needs to be fixed.
> 

So we should link in modules that are experimental and/or integrated into the server already?
Comment 12 Aaron W. Swenson gentoo-dev 2010-07-12 15:14:08 UTC
Upstream has resolved this bug in 9.0_beta3. They did not back port the patch. I'll get another collection of ebuilds ready, though, that will implement the fix.
Comment 13 Kerin Millar 2010-07-14 20:20:05 UTC
Good to know! Note however that there's no need to upload a swathe of ebuilds; just an applicable (backported) patch will be sufficient.
Comment 14 Johan Bergström 2010-08-23 19:09:24 UTC
Aaron: Did you find the time to backport the fix? 
Comment 15 Aaron W. Swenson gentoo-dev 2010-08-25 03:11:41 UTC
(In reply to comment #14)
> Aaron: Did you find the time to backport the fix? 
> 

Yes I did. I've passed it along to Patrick. I've bombarded him with a lot of things when he got back from his vacation. It shouldn't be too long now.
Comment 16 Aaron W. Swenson gentoo-dev 2010-11-17 20:33:55 UTC
Created attachment 254685 [details, diff]
Ebuild Patch for LDFLAGS

The attached patch resolves the LDFLAGS issue for 8.4.4. However, a similar patch to 8.{1,2,3} does not. I haven't been able to figure out why. (I could have sworn it did, but I guess not, or something has changed, or something is wrong with my system.)

The sed statement for the older branches needs to be this instead:
    sed -e "s/\(\$(CC) \)\(.*\)/\1\$(CFLAGS) \$(LDFLAGS) \$(LDFLAGS_SL) \2/" \
        -i src/makefiles/Makefile.linux
Comment 17 Aaron W. Swenson gentoo-dev 2011-03-21 04:15:00 UTC
The summary is fixed. As for the other ebuilds, see bug 347005.
  21 Mar 2011; Aaron W. Swenson <titanofold@gentoo.org>
  +postgresql-server-8.2.20-r1.ebuild, +postgresql-server-8.3.14-r1.ebuild,
  +postgresql-server-8.4.7-r1.ebuild, +postgresql-server-9.0.3-r1.ebuild:
  Fixes bugs 274836, 302384, 323683, 325709, 347005, 347223, 353687 and
  353750.