After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 656231 - using --as-needed in LDFLAGS is not respected and it links on unneeded libs
using --as-needed in LDFLAGS is not respected and it links on unneeded libs
Status: RESOLVED NOTGNOME
Product: gnome-settings-daemon
Classification: Core
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gnome-settings-daemon-maint
gnome-settings-daemon-maint
Depends on:
Blocks:
 
 
Reported: 2011-08-09 18:01 UTC by Ionut Biru
Modified: 2012-09-21 13:37 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Ionut Biru 2011-08-09 18:01:51 UTC
same issue reported in bug 656229 and bug 655517.

taking as example /usr/lib/gnome-settings-daemon-3.0/libprint-notifications.so

it links to 37 sonames, the package in total linking on 480 sonames

sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool

applying this workaround reduces the linkage for that specific test to 7 and in total the package now links on 170 sonames.

I personally don't know how many modules from gnome are affected but in my opinion this issue needs to be fixed upstream instead of packaging.

System information:
binutils 2.21.1-1
libtool 2.4
gcc 4.6.1

CFLAGS="-march=i686 -mtune=generic -O2 -pipe"
CXXFLAGS="-march=i686 -mtune=generic -O2 -pipe"
LDFLAGS="-Wl,--hash-style=gnu -Wl,--as-needed"
Comment 1 Matthias Clasen 2011-09-04 18:17:47 UTC
Your numbers seem inflated.

rpm -q --requires gnome-settings-daemon | wc -l
84
Comment 2 Ionut Biru 2011-09-04 18:26:15 UTC
does rpm -q --requires return a specific soname once or multiple?

My count is for each elf from the package, do readelf and get the NEEDED and count them. It doesn't remove duplicates from the list.

The reason I don't remove duplicate is to see which one really link to uneeded shared libraries.
Comment 3 Bastien Nocera 2011-09-06 13:53:57 UTC
What's the point you're trying to make here? Is there a patch coming?

I'm certainly not going to take something which changes the linkage style for all the platforms.
Comment 4 Akhil Laddha 2011-10-21 05:47:20 UTC
Ionut, can you please respond to comment#3 ?
Comment 5 Ionut Biru 2011-10-21 08:20:29 UTC
my point is to not have gnome modules link to unneeded libraries saving everyone time with recompilation.

i do not expect changing the linkage style since is mostly a libtool problem. i intend to contact libtool developers but i'm pretty sure they know about this problem.
Comment 6 Bastien Nocera 2012-09-21 13:37:15 UTC
This is a hack:
sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
and not something we can ship in GNOME. Please deal with the problem downstream, and feel free to file new bugs if you see erroneously linked plugins.