Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 350346

Summary: Avoid useless linking
Product: [Eclipse Project] Platform Reporter: أحمد المحمودي <aelmahmoudy>
Component: SWTAssignee: Platform-SWT-Inbox <platform-swt-inbox>
Status: CLOSED NOT_ECLIPSE QA Contact:
Severity: normal    
Priority: P3 CC: akurtakov, eclipse.felipe, gheorghe, remy.suen, Silenio_Quarti
Version: 3.6.2   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
Use -Wl,--as-needed when linking SWT libraries none

Description أحمد المحمودي CLA 2011-06-25 05:24:24 EDT
Build Identifier: 

When building swt-gtk on Debian, I get warnings about uselessly linked libraries:

dpkg-shlibdeps: warning: dependency on libm.so.6 could be avoided if "debian/libswt-glx-gtk-3.7-jni/usr/lib/jni/libswt-glx-gtk-3735.so" were not uselessly linked against it (they use none of its symbols).
dpkg-shlibdeps: warning: dependency on libGLU.so.1 could be avoided if "debian/libswt-glx-gtk-3.7-jni/usr/lib/jni/libswt-glx-gtk-3735.so" were not uselessly linked against it (they use none of its symbols).
dh_installdeb -plibswt-webkit-gtk-3.7-jni 
dh_perl -plibswt-webkit-gtk-3.7-jni 
dh_shlibdeps -plibswt-webkit-gtk-3.7-jni    
dpkg-shlibdeps: warning: dependency on libglib-2.0.so.0 could be avoided if "debian/libswt-webkit-gtk-3.7-jni/usr/lib/jni/libswt-webkit-gtk-3735.so" were not uselessly linked against it (they use none of its symbols).
dpkg-shlibdeps: warning: dependency on libfontconfig.so.1 could be avoided if "debian/libswt-webkit-gtk-3.7-jni/usr/lib/jni/libswt-webkit-gtk-3735.so" were not uselessly linked against it (they use none of its symbols).
dpkg-shlibdeps: warning: dependency on libm.so.6 could be avoided if "debian/libswt-webkit-gtk-3.7-jni/usr/lib/jni/libswt-webkit-gtk-3735.so" were not uselessly linked against it (they use none of its symbols).
dpkg-shlibdeps: warning: dependency on libatk-1.0.so.0 could be avoided if "debian/libswt-webkit-gtk-3.7-jni/usr/lib/jni/libswt-webkit-gtk-3735.so" were not uselessly linked against it (they use none of its symbols).
dpkg-shlibdeps: warning: dependency on librt.so.1 could be avoided if "debian/libswt-webkit-gtk-3.7-jni/usr/lib/jni/libswt-webkit-gtk-3735.so" were not uselessly linked against it (they use none of its symbols).
dpkg-shlibdeps: warning: dependency on libpthread.so.0 could be avoided if "debian/libswt-webkit-gtk-3.7-jni/usr/lib/jni/libswt-webkit-gtk-3735.so" were not uselessly linked against it (they use none of its symbols).
dpkg-shlibdeps: warning: dependency on libgio-2.0.so.0 could be avoided if "debian/libswt-webkit-gtk-3.7-jni/usr/lib/jni/libswt-webkit-gtk-3735.so" were not uselessly linked against it (they use none of its symbols).
dpkg-shlibdeps: warning: dependency on libgdk_pixbuf-2.0.so.0 could be avoided if "debian/libswt-webkit-gtk-3.7-jni/usr/lib/jni/libswt-webkit-gtk-3735.so" were not uselessly linked against it (they use none of its symbols).
dpkg-shlibdeps: warning: dependency on libcairo.so.2 could be avoided if "debian/libswt-webkit-gtk-3.7-jni/usr/lib/jni/libswt-webkit-gtk-3735.so" were not uselessly linked against it (they use none of its symbols).
dpkg-shlibdeps: warning: dependency on libpango-1.0.so.0 could be avoided if "debian/libswt-webkit-gtk-3.7-jni/usr/lib/jni/libswt-webkit-gtk-3735.so" were not uselessly linked against it (they use none of its symbols).
dpkg-shlibdeps: warning: dependency on libgmodule-2.0.so.0 could be avoided if "debian/libswt-webkit-gtk-3.7-jni/usr/lib/jni/libswt-webkit-gtk-3735.so" were not uselessly linked against it (they use none of its symbols).
dpkg-shlibdeps: warning: dependency on libgthread-2.0.so.0 could be avoided if "debian/libswt-webkit-gtk-3.7-jni/usr/lib/jni/libswt-webkit-gtk-3735.so" were not uselessly linked against it (they use none of its symbols).
dpkg-shlibdeps: warning: dependency on libgtk-x11-2.0.so.0 could be avoided if "debian/libswt-webkit-gtk-3.7-jni/usr/lib/jni/libswt-webkit-gtk-3735.so" were not uselessly linked against it (they use none of its symbols).
dpkg-shlibdeps: warning: dependency on libpangocairo-1.0.so.0 could be avoided if "debian/libswt-webkit-gtk-3.7-jni/usr/lib/jni/libswt-webkit-gtk-3735.so" were not uselessly linked against it (they use none of its symbols).
dpkg-shlibdeps: warning: dependency on libfreetype.so.6 could be avoided if "debian/libswt-webkit-gtk-3.7-jni/usr/lib/jni/libswt-webkit-gtk-3735.so" were not uselessly linked against it (they use none of its symbols).
dpkg-shlibdeps: warning: dependency on libgdk-x11-2.0.so.0 could be avoided if "debian/libswt-webkit-gtk-3.7-jni/usr/lib/jni/libswt-webkit-gtk-3735.so" were not uselessly linked against it (they use none of its symbols).
dpkg-shlibdeps: warning: dependency on libpangoft2-1.0.so.0 could be avoided if "debian/libswt-webkit-gtk-3.7-jni/usr/lib/jni/libswt-webkit-gtk-3735.so" were not uselessly linked against it (they use none of its symbols).

By passing -Wl,--as-needed before link libraries, those warnings were suppressed.


Reproducible: Always
Comment 1 أحمد المحمودي CLA 2011-06-25 05:25:38 EDT
Created attachment 198596 [details]
Use -Wl,--as-needed when linking SWT libraries
Comment 2 Alexander Kurtakov CLA 2013-12-20 04:34:04 EST
This report is related to debian build and should be reported in debian bug tracker. There is nothing we can do for the debian build. Closing.