FS#17259 - [php] stomps over user-set LDFLAGS rather than doing a precise filter of --as-needed

Attached to Project: Arch Linux
Opened by Devin Cofer (Ranguvar) - Monday, 23 November 2009, 22:41 GMT
Last edited by Pierre Schmitz (Pierre) - Tuesday, 24 November 2009, 20:10 GMT
Task Type Feature Request
Category Packages: Extra
Status Closed
Assigned To Pierre Schmitz (Pierre)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

php-5.3.1-3 completely overrides the user's set LDFLAGS.
Apparently this is because the default flag '--as-needed' breaks ldap-sasl compilation.

However, the better solution would be to just filter that flag, so as not to stomp all over the user's other settings.

I believe the following two lines, in order, cover both the default and any other use of --as-needed. They should be used instead of the current 'export LDFLAGS="-Wl,--hash-style=gnu"'.

export LDFLAGS="${LDFLAGS//-Wl,--as-needed}"
export LDFLAGS="${LDFLAGS//,--as-needed}"
This task depends upon

Closed by  Pierre Schmitz (Pierre)
Tuesday, 24 November 2009, 20:10 GMT
Reason for closing:  Implemented
Comment by Pierre Schmitz (Pierre) - Monday, 23 November 2009, 23:02 GMT
The current approach is just a place holder until makepkg support the !ldflags option. Sure, removing the non-working options instead of just overwriting all seems more clean, but I don't see any use case where the latter might cause problems.
Comment by Devin Cofer (Ranguvar) - Tuesday, 24 November 2009, 01:42 GMT
Well, it's rather annoying at least. I set my LDFLAGS manually, and it's a bit annoying when packages try to ignore them.
Even with the default LDFLAGS settings, you're still losing out on some optimization, because it gets rid of --hash-style=gnu.

Even if a !ldflags option shows up, I think there should be a !asneeded option...
--as-needed is by far the most problematic LDFLAG, despite it being the most helpful, and that would make it nicer to avoid problems while still respecting the user's settings.

After all, this is a fairly hardcore distro ;-) I think people choose it so that they're the master of their software.
It's a bit annoying to check every PKGBUILD before ABS build to make sure it isn't making bad decisions about how to compile.

Anyways, no big deal, just seems more logical to only override what is necessary.
Comment by Pierre Schmitz (Pierre) - Tuesday, 24 November 2009, 20:10 GMT
The next built will have the LDFLAGS set as you proposed.

Loading...