Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 188650 - multiple gnome apps link against libGL.so.1
Summary: multiple gnome apps link against libGL.so.1
Status: VERIFIED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] GNOME (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Gentoo X packagers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-08-12 21:39 UTC by Arthur Hagen
Modified: 2007-08-14 21:21 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Arthur Hagen 2007-08-12 21:39:30 UTC
(Possibly libtool related)

After upgrading from gnome 2.16 to 2.18, every single gnome related binary suddenly was linked with almost any possible library on the system.
In particular, this is a problem with libGL.so.1 being polled in when not needed, since libGL.so.1 isn't PIC, and this prevents prelinking (and probably hardened).


Reproducible: Always

Steps to Reproduce:
Example, with a package that does NOT need OpenGL (nor a bunch of the other libraries polled in):

ldd /usr/bin/gconf-editor

Actual Results:  
        linux-gate.so.1 =>  (0xffffe000)
        libgnomeui-2.so.0 => /usr/lib/libgnomeui-2.so.0 (0x4199d000)
        libjpeg.so.62 => /usr/lib/libjpeg.so.62 (0x41b22000)
        libbonoboui-2.so.0 => /usr/lib/libbonoboui-2.so.0 (0x418a3000)
        libgnome-keyring.so.0 => /usr/lib/libgnome-keyring.so.0 (0x416c2000)
        libgnomecanvas-2.so.0 => /usr/lib/libgnomecanvas-2.so.0 (0x41863000)
        libgnome-2.so.0 => /usr/lib/libgnome-2.so.0 (0x41890000)
        libgnomevfs-2.so.0 => /usr/lib/libgnomevfs-2.so.0 (0x41952000)
        libdbus-glib-1.so.2 => /usr/lib/libdbus-glib-1.so.2 (0x4193a000)
        libnsl.so.1 => /lib/libnsl.so.1 (0x41afc000)
        libdbus-1.so.3 => /usr/lib/libdbus-1.so.3 (0x41839000)
        libssl.so.0.9.8 => /usr/lib/libssl.so.0.9.8 (0x41bb0000)
        libcrypto.so.0.9.8 => /usr/lib/libcrypto.so.0.9.8 (0x425fe000)
        libresolv.so.2 => /lib/libresolv.so.2 (0x41c89000)
        libutil.so.1 => /lib/libutil.so.1 (0x41c9e000)
        libesd.so.0 => /usr/lib/libesd.so.0 (0x41672000)
        libasound.so.2 => /usr/lib/libasound.so.2 (0x41e44000)
        libaudiofile.so.0 => /usr/lib/libaudiofile.so.0 (0x41fa8000)
        libpopt.so.0 => /usr/lib/libpopt.so.0 (0x41be5000)
        libart_lgpl_2.so.2 => /usr/lib/libart_lgpl_2.so.2 (0x4202f000)
        libgtk-x11-2.0.so.0 => /usr/lib/libgtk-x11-2.0.so.0 (0x42700000)
        libgdk-x11-2.0.so.0 => /usr/lib/libgdk-x11-2.0.so.0 (0x417b4000)
        libatk-1.0.so.0 => /usr/lib/libatk-1.0.so.0 (0x41ad5000)
        libgdk_pixbuf-2.0.so.0 => /usr/lib/libgdk_pixbuf-2.0.so.0 (0x415c4000)
        libpangocairo-1.0.so.0 => /usr/lib/libpangocairo-1.0.so.0 (0x41340000)
        libpangoft2-1.0.so.0 => /usr/lib/libpangoft2-1.0.so.0 (0x41638000)
        libpango-1.0.so.0 => /usr/lib/libpango-1.0.so.0 (0x41600000)
        libcairo.so.2 => /usr/lib/libcairo.so.2 (0x416fa000)
        libfreetype.so.6 => /usr/lib/libfreetype.so.6 (0x414bf000)
        libfontconfig.so.1 => /usr/lib/libfontconfig.so.1 (0x41568000)
        libxml2.so.2 => /usr/lib/libxml2.so.2 (0x4134d000)
        libglitz-glx.so.1 => /usr/lib/libglitz-glx.so.1 (0x4166a000)
        libglitz.so.1 => /usr/lib/libglitz.so.1 (0x416d0000)
        libGL.so.1 => //usr//lib/opengl/xorg-x11/lib/libGL.so.1 (0x41761000)
        libSM.so.6 => /usr/lib/libSM.so.6 (0x415ae000)
        libICE.so.6 => /usr/lib/libICE.so.6 (0x41594000)
        libXmu.so.6 => /usr/lib/libXmu.so.6 (0x41b97000)
        libXt.so.6 => /usr/lib/libXt.so.6 (0x41b42000)
        libXext.so.6 => /usr/lib/libXext.so.6 (0x412aa000)
        libXi.so.6 => /usr/lib/libXi.so.6 (0x415f6000)
        libpng12.so.0 => /usr/lib/libpng12.so.0 (0x41543000)
        libz.so.1 => /lib/libz.so.1 (0x41297000)
        libXrender.so.1 => /usr/lib/libXrender.so.1 (0x415b9000)
        libX11.so.6 => /usr/lib/libX11.so.6 (0x411a2000)
        libXau.so.6 => /usr/lib/libXau.so.6 (0x41196000)
        libXdmcp.so.6 => /usr/lib/libXdmcp.so.6 (0x4119b000)
        libm.so.6 => /lib/libm.so.6 (0x41167000)
        libbonobo-2.so.0 => /usr/lib/libbonobo-2.so.0 (0x41f4f000)
        libbonobo-activation.so.4 => /usr/lib/libbonobo-activation.so.4 (0x416ad000)
        libORBitCosNaming-2.so.0 => /usr/lib/libORBitCosNaming-2.so.0 (0x4149c000)
        libgconf-2.so.4 => /usr/lib/libgconf-2.so.4 (0x41681000)
        libORBit-2.so.0 => /usr/lib/libORBit-2.so.0 (0x41deb000)
        libgmodule-2.0.so.0 => /usr/lib/libgmodule-2.0.so.0 (0x4133b000)
        libdl.so.2 => /lib/libdl.so.2 (0x41190000)
        libgthread-2.0.so.0 => /usr/lib/libgthread-2.0.so.0 (0x4153d000)
        libpthread.so.0 => /lib/libpthread.so.0 (0x414a6000)
        librt.so.1 => /lib/librt.so.1 (0x41b17000)
        libgobject-2.0.so.0 => /usr/lib/libgobject-2.0.so.0 (0x4146b000)
        libglib-2.0.so.0 => /usr/lib/libglib-2.0.so.0 (0x412ba000)
        libc.so.6 => /lib/libc.so.6 (0x41020000)
        libXfixes.so.3 => /usr/lib/libXfixes.so.3 (0x415e4000)
        libXrandr.so.2 => /usr/lib/libXrandr.so.2 (0x415db000)
        libXcursor.so.1 => /usr/lib/libXcursor.so.1 (0x415eb000)
        libXxf86vm.so.1 => /usr/lib/libXxf86vm.so.1 (0x42212000)
        libdrm.so.2 => /usr/lib/libdrm.so.2 (0x41c76000)
        /lib/ld-linux.so.2 (0x41000000)

Expected Results:  
No linking against libraries not actually used.

Example "emerge --info" from one system:


Portage 2.1.2.11 (default-linux/x86/2007.0/desktop, gcc-3.4.6, glibc-2.5-r4, 2.6
.21-gentoo-r4 i686)
=================================================================
System uname: 2.6.21-gentoo-r4 i686 mobile AMD Athlon(tm) XP2400+
Gentoo Base System release 1.12.9
Timestamp of tree: Sun, 12 Aug 2007 17:00:01 +0000
distcc 2.18.3 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [enabled]
ccache version 2.4 [enabled]
dev-lang/python:     2.4.4-r4
dev-python/pycrypto: 2.0.1-r6
dev-util/ccache:     2.4-r7
sys-apps/sandbox:    1.2.17
sys-devel/autoconf:  2.13, 2.61
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10
sys-devel/binutils:  2.17
sys-devel/gcc-config: 1.3.16
sys-devel/libtool:   1.5.23b
virtual/os-headers:  2.6.21
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-Os -march=athlon-4 -momit-leaf-frame-pointer"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/X11/xkb"
CONFIG_PROTECT_MASK="/etc/env.d /etc/gconf /etc/revdep-rebuild /etc/splash /etc/terminfo"
CXXFLAGS="-Os -march=athlon-4 -momit-leaf-frame-pointer"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--with-bdeps=y"
FEATURES="ccache distcc distlocks fixpackages metadata-transfer noinfo sandbox
sfperms strict userfetch userpriv usersandbox"
GENTOO_MIRRORS="http://gentoo.mirrors.tds.net/gentoo http://gentoo.osuosl.org/ http://gentoo.mirrors.pair.com/"
LDFLAGS="-Wl,-O1"
LINGUAS="en_GB en_US en nb_NO nb no"
MAKEOPTS="-j6"
PKGDIR="/usr/portage/packages"
PORTAGE_COMPRESS=""
PORTAGE_COMPRESS_FLAGS=" "
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --filter=H_**/files/digest-*"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://tree.broomstick.com/gentoo-portage"
USE="3dnow X Xaw3d aac acl acpi alsa audiofile berkdb bitmap-fonts cairo caps cdr cli cracklib crypt cups dbus dri dvd dvdread eds emboss encode esd evo fam flac gd gdbm gif gnome gpm gstreamer gtk gtk2 hal iconv idn ipv6 isdnlog jpeg lcms libnotify logrotate mad matroska mbox midi mikmod mmap mmx motif mp3 mpeg mudflap ncurses nfs nis nls nntp nptl nptlonly offensive ogg opengl openmp oss pam pcre pdf perl pic png posix ppds pppd python qt3support qt4 quicktime readline reflection sdl seamonkey session sndfile spell spl sse ssl svg tcpd threads tiff timidity tk truetype truetype-fonts type1-fonts unicode vorbis win32codecs x86 xattr xcomposite xml xorg xv xvid zlib" ALSA_CARDS="ali5451" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route share shm softvol" ELIBC="glibc" INPUT_DEVICES="keyboard mouse synaptics" KERNEL="linux" LINGUAS="en_GB en_US en nb_NO nb no" USERLAND="GNU" VIDEO_CARDS="radeon"
Unset:  CTARGET, INSTALL_MASK, LANG, LC_ALL, PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY
Comment 1 Gilles Dartiguelongue (RETIRED) gentoo-dev 2007-08-12 21:47:17 UTC
what you are asking is probably LDFLAGS="-Wl,--as-needed" (provided you are using >=binutils-2.17).
Using ldd /usr/bin/gconf-editor|wc -l, I get 78 libraries, this is _normal_ and to be expected given the functionnality of the desktop.
When you look a bit closer: readelf -d /usr/bin/gconf-editor |egrep Lib|wc -l

you get a better idea of what is really linked/used by this program. Here I have this option and I get 11 libraries only.
Comment 2 Arthur Hagen 2007-08-12 22:07:01 UTC
(In reply to comment #1)
> what you are asking is probably LDFLAGS="-Wl,--as-needed" (provided you are
> using >=binutils-2.17).
> Using ldd /usr/bin/gconf-editor|wc -l, I get 78 libraries, this is _normal_ and
> to be expected given the functionnality of the desktop.

Polling in libGL.so.1 is _not_ normal for an application that does not use OpenGL.  This behaviour is new, and breaks prelink.
Comment 3 Arthur Hagen 2007-08-12 22:12:07 UTC
(In reply to comment #1)

> When you look a bit closer: readelf -d /usr/bin/gconf-editor |egrep Lib|wc -l
> 
> you get a better idea of what is really linked/used by this program. Here I
> have this option and I get 11 libraries only.

And here you seem to have hit the problem on the head, because with the new gnome 2.18 here, "readelf -d /usr/bin/gconf-editor | grep NEEDED | wc -l" gives 59 libraries, including the obviously not needed libGL.so.1
That's a far cry from 11


Comment 4 Jakub Moc (RETIRED) gentoo-dev 2007-08-12 22:23:04 UTC
(In reply to comment #3)
> And here you seem to have hit the problem on the head, because with the new
> gnome 2.18 here, "readelf -d /usr/bin/gconf-editor | grep NEEDED | wc -l" gives
> 59 libraries, including the obviously not needed libGL.so.1

That's completely normal if you are NOT using LDFLAGS="-Wl,--as-needed". A.k.a., NOT a bug.
Comment 5 Gilles Dartiguelongue (RETIRED) gentoo-dev 2007-08-12 22:37:22 UTC
I don't have the papers handy, but iirc, the fault is shared among devs (ie. upstream) and the linker (so that's upstream to right ?).

Due to various development woos, developers might include more than what is strictly required to link their librairies and as the linker is dumb, it links the whole stuff together and done.

--as-needed, is a attempt to make the linker smarter in its decision about what to link. It was really not something you would use as a user until recently because some programs fails in various weird ways (at compilation _and/or_ at run time). With a full system compiled with this option you get the result I gave you.

I'm not going to develop any more on this, you can google for documentation/papers, it's quite easy to find.
Comment 6 Arthur Hagen 2007-08-13 00:33:17 UTC
(In reply to comment #4)
> 
> That's completely normal if you are NOT using LDFLAGS="-Wl,--as-needed".
> A.k.a., NOT a bug.

I beg to differ -- if dozens of binaries now break prelink, and they didn't before, it's a bug.

(Also note that the recently officially released optimization guide on www.gentoo.org unequivocally states that one should NOT set LDFLAGS.)
Comment 7 Arthur Hagen 2007-08-13 01:02:24 UTC
(In reply to comment #4)
> (In reply to comment #3)
> > And here you seem to have hit the problem on the head, because with the new
> > gnome 2.18 here, "readelf -d /usr/bin/gconf-editor | grep NEEDED | wc -l" gives
> > 59 libraries, including the obviously not needed libGL.so.1
> 
> That's completely normal if you are NOT using LDFLAGS="-Wl,--as-needed".
> A.k.a., NOT a bug.
> 

Plus, testing this out, and rebuilding with LDFLAGS="-Wl,--as-needed" in /etc/make.conf, it doesn't appear to fix the problem either -- libGL.so.1 is still pulled in by apps that obviously don't use OpenGL.

(edit /etc/make.conf, adding -Wl,--as-needed to LDFLAGS)
emerge --oneshot gnome-base/control-center
prelink -amv
...
Prelinking /usr/bin/gnome-about-me
prelink: /usr/bin/gnome-about-me: Cannot prelink against non-PIC shared library
/usr/lib/opengl/xorg-x11/lib/libGL.so.1
... [dozens of other entries too]
ldd /usr/bin/gnome-about-me | grep libGL
        libGL.so.1 => /usr/lib/opengl/xorg-x11/lib/libGL.so.1 (0x41761000)
readelf -d /usr/bin/gnome-about-me | grep NEEDED
 0x00000001 (NEEDED)                     Shared library: [libglade-2.0.so.0]
 0x00000001 (NEEDED)                     Shared library: [libgnomeui-2.so.0]
 0x00000001 (NEEDED)                     Shared library: [libgtk-x11-2.0.so.0]
 0x00000001 (NEEDED)                     Shared library: [libgdk-x11-2.0.so.0]
 0x00000001 (NEEDED)                     Shared library: [libatk-1.0.so.0]
 0x00000001 (NEEDED)                     Shared library: [libgdk_pixbuf-2.0.so.0]
 0x00000001 (NEEDED)                     Shared library: [libebook-1.2.so.9]
 0x00000001 (NEEDED)                     Shared library: [libgnome-2.so.0]
 0x00000001 (NEEDED)                     Shared library: [libgnomevfs-2.so.0]
 0x00000001 (NEEDED)                     Shared library: [libpthread.so.0]
 0x00000001 (NEEDED)                     Shared library: [libgobject-2.0.so.0]
 0x00000001 (NEEDED)                     Shared library: [libglib-2.0.so.0]
 0x00000001 (NEEDED)                     Shared library: [libc.so.6]

... in other words, even though libGL.so.1 is not a NEEDED library, it still gets linked against, and prelink fails.  And this is new behaviour, with or without --as-needed

In addition to the new prelink problems, I'm worried how this will affect one of my servers, which is accessed mainly through Hummmingbird Exceed X clients, which don't even have OpenGL.  I've seen GL_INIT X failures before when non-GL programs by mistake have been linked with -lGL, and hope this won't reoccur.
Comment 8 Jakub Moc (RETIRED) gentoo-dev 2007-08-13 07:25:48 UTC
(In reply to comment #7)
> (edit /etc/make.conf, adding -Wl,--as-needed to LDFLAGS)
> emerge --oneshot gnome-base/control-center
> prelink -amv

This is not how you reduce the NEEDED stuff via --as-needed. You'd have to recompile entire Gnome plus its reverse dependencies for -Wl,--as-needed to have the desired effect, not a single app.
Comment 9 Gilles Dartiguelongue (RETIRED) gentoo-dev 2007-08-13 08:07:13 UTC
can you check how many gnome programs have libGL in their NEEDED section ?
If all have this, it is very probable the "problem" is in a lower level library. I'm currently thinking of cairo that could pull libGL because of glitz use flag.

One way you could find out which library pulls in libGL is also to inspect every single .la file on your system. But it's going to take a while.
Comment 10 Arthur Hagen 2007-08-14 01:01:57 UTC
(In reply to comment #9)
> can you check how many gnome programs have libGL in their NEEDED section ?
> If all have this, it is very probable the "problem" is in a lower level
> library. I'm currently thinking of cairo that could pull libGL because of glitz
> use flag.
> 
> One way you could find out which library pulls in libGL is also to inspect
> every single .la file on your system. But it's going to take a while.

I'm rebuilding world (with -Wl,--as-needed) which is also going to take a while, and will do grep once that has finished...
Comment 11 Arthur Hagen 2007-08-14 01:25:37 UTC
Changing summary back -- this is NOT a problem with a single app.
After adding "-Wl,--as-needed" to LDFLAGS and rebuilding world twice, the situation didn't improve, but became *WORSE*, with the following apps now linking in libGL.so:

/usr/bin/AbiWord-2.4
/usr/bin/airsnort
/usr/bin/alc
/usr/bin/amule
/usr/bin/amulegui
/usr/bin/baobab
/usr/bin/blackjack
/usr/bin/bluefish
/usr/bin/bonobo-browser
/usr/bin/boot-admin
/usr/bin/bug-buddy
/usr/bin/cddb-slave2-properties
/usr/bin/celestia
/usr/bin/distccmon-gui
/usr/bin/eog
/usr/bin/epiphany
/usr/bin/evince
/usr/bin/evince-thumbnailer
/usr/bin/evolution-2.10
/usr/bin/file-roller
/usr/bin/gcalctool
/usr/bin/gconf-editor
/usr/bin/gdmXnestchooser
/usr/bin/gdmdynamic
/usr/bin/gdmflexiserver
/usr/bin/gdmphotosetup
/usr/bin/gedit
/usr/bin/gimp-2.2
/usr/bin/gimp-remote-2.2
/usr/bin/gkbd-indicator-plugins-capplet
/usr/bin/gksu
/usr/bin/gksu-properties
/usr/bin/glines
/usr/bin/glmovie
/usr/bin/glxgears
/usr/bin/glxinfo
/usr/bin/gnect
/usr/bin/gnibbles
/usr/bin/gnobots2
/usr/bin/gnome-about
/usr/bin/gnome-about-me
/usr/bin/gnome-accessibility-keyboard-properties
/usr/bin/gnome-alsamixer
/usr/bin/gnome-at-properties
/usr/bin/gnome-audio-profiles-properties
/usr/bin/gnome-background-properties
/usr/bin/gnome-brightness-applet
/usr/bin/gnome-cd
/usr/bin/gnome-control-center
/usr/bin/gnome-cups-add
/usr/bin/gnome-cups-icon
/usr/bin/gnome-cups-manager
/usr/bin/gnome-default-applications-properties
/usr/bin/gnome-desktop-item-edit
/usr/bin/gnome-dictionary
/usr/bin/gnome-display-properties
/usr/bin/gnome-font-properties
/usr/bin/gnome-font-viewer
/usr/bin/gnome-inhibit-applet
/usr/bin/gnome-keybinding-properties
/usr/bin/gnome-keyboard-properties
/usr/bin/gnome-keyring-manager
/usr/bin/gnome-mount
/usr/bin/gnome-mouse-properties
/usr/bin/gnome-nettool
/usr/bin/gnome-network-preferences
/usr/bin/gnome-panel
/usr/bin/gnome-power-manager
/usr/bin/gnome-power-preferences
/usr/bin/gnome-power-statistics
/usr/bin/gnome-screensaver
/usr/bin/gnome-screensaver-preferences
/usr/bin/gnome-screenshot
/usr/bin/gnome-search-tool
/usr/bin/gnome-session
/usr/bin/gnome-session-properties
/usr/bin/gnome-session-remove
/usr/bin/gnome-session-save
/usr/bin/gnome-sound-properties
/usr/bin/gnome-sound-recorder
/usr/bin/gnome-system-log
/usr/bin/gnome-system-monitor
/usr/bin/gnome-terminal
/usr/bin/gnome-theme-manager
/usr/bin/gnome-theme-thumbnailer
/usr/bin/gnome-typing-monitor
/usr/bin/gnome-ui-properties
/usr/bin/gnome-volume-control
/usr/bin/gnome-volume-manager
/usr/bin/gnome-volume-properties
/usr/bin/gnome-window-properties
/usr/bin/gnometris
/usr/bin/gnomine
/usr/bin/gnotravex
/usr/bin/gnotski
/usr/bin/gnubiff
/usr/bin/gpccard
/usr/bin/gstreamer-properties
/usr/bin/gsynaptics
/usr/bin/gsynaptics-init
/usr/bin/gtali
/usr/bin/gtk-demo
/usr/bin/gtk-query-immodules-2.0
/usr/bin/gtk-window-decorator
/usr/bin/gucharmap
/usr/bin/iagno
/usr/bin/libquicktime_config
/usr/bin/lqtplay
/usr/bin/mahjongg
/usr/bin/metacity
/usr/bin/metacity-message
/usr/bin/metacity-theme-viewer
/usr/bin/metacity-window-demo
/usr/bin/nautilus
/usr/bin/nautilus-cd-burner
/usr/bin/nautilus-connect-server
/usr/bin/nautilus-file-management-properties
/usr/bin/notify-send
/usr/bin/panel-test-applets
/usr/bin/pango-view
/usr/bin/qtdemo
/usr/bin/rhythmbox
/usr/bin/rsvg-convert
/usr/bin/rsvg-view
/usr/bin/same-gnome
/usr/bin/services-admin
/usr/bin/shares-admin
/usr/bin/sound-juicer
/usr/bin/test-moniker
/usr/bin/themus-theme-applier
/usr/bin/time-admin
/usr/bin/timidity
/usr/bin/totem
/usr/bin/totem-video-indexer
/usr/bin/totem-video-thumbnailer
/usr/bin/users-admin
/usr/bin/vino-preferences
/usr/bin/vino-session
/usr/bin/vte
/usr/bin/vumeter
/usr/bin/wxcas
/usr/bin/yelp
/usr/bin/zenity
/usr/games/bin/civclient
/usr/lib/bonobo-2.0/samples/bonobo-sample-controls-2
/usr/lib/gimp/2.0/plug-ins/*
/usr/lib/mozilla-firefox/TestGtkEmbed
/usr/lib/mozilla-firefox/elf-dynstr-gc
/usr/lib/mozilla-firefox/firefox-bin
/usr/lib/seamonkey/TestGtkEmbed
/usr/lib/seamonkey/seamonkey-bin
/usr/lib/vte/interpret
/usr/lib/vte/iso8859mode
/usr/lib/vte/nativeecho
/usr/lib/vte/slowcat
/usr/lib/vte/utf8echo
/usr/lib/vte/utf8mode
/usr/lib/vte/vterdb
/usr/sbin/gdm-binary
/usr/sbin/gdmsetup

Most of these do not use OpenGL, and did NOT link with -lGL before the gnome 2.18 upgrade, and now they do (those that are not gnome native appear to link with gnome libraries if present and/or if gnome use flag is set).  (glxgear/glxinfo did link with -lGL before this, but was easily enough excluded with a PRELINK_PATH_MASK.  The list is now too long for PRELINK_PATH_MASK.
Comment 12 Arthur Hagen 2007-08-14 01:50:01 UTC
After rebuilding with -Wl,--as-needed, the following libraries now are linked against libGL.so.1:

find /usr/lib -type f -name '*.so.*' \
| awk '{print "ldd "$1" | grep >/dev/null libGL && echo "$1}' \
| sh 2>/dev/null
/usr/lib/evolution/2.10/libeutil.so.0.0.0
/usr/lib/evolution/2.10/libeconduit.so.0.0.0
/usr/lib/evolution/2.10/libevolution-a11y.so.0.0.0
/usr/lib/evolution/2.10/libevolution-calendar-a11y.so.0.0.0
/usr/lib/evolution/2.10/libevolution-widgets-a11y.so.0.0.0
/usr/lib/evolution/2.10/libevolution-addressbook-a11y.so.0.0.0
/usr/lib/evolution/2.10/libetimezonedialog.so.0.0.0
/usr/lib/evolution/2.10/libetable.so.0.0.0
/usr/lib/evolution/2.10/libetext.so.0.0.0
/usr/lib/evolution/2.10/libemiscwidgets.so.0.0.0
/usr/lib/evolution/2.10/libefilterbar.so.0.0.0
/usr/lib/evolution/2.10/libmenus.so.0.0.0
/usr/lib/evolution/2.10/libeshell.so.0.0.0
/usr/lib/evolution/2.10/libfilter.so.0.0.0
/usr/lib/evolution/2.10/libessmime.so.0.0.0
/usr/lib/evolution/2.10/libevolution-smime.so.0.0.0
/usr/lib/evolution/2.10/libeabutil.so.0.0.0
/usr/lib/evolution/2.10/libevolution-addressbook-importers.so.0.0.0
/usr/lib/evolution/2.10/libecontacteditor.so.0.0.0
/usr/lib/evolution/2.10/libecontactlisteditor.so.0.0.0
/usr/lib/evolution/2.10/libevolution-calendar-importers.so.0.0.0
/usr/lib/evolution/2.10/libevolution-mail-importers.so.0.0.0
/usr/lib/qt4/libQtOpenGL.so.4.3.0
/usr/lib/libGLw.so.1.0.0
/usr/lib/librsvg-2.so.2.16.1
/usr/lib/libgdkglext-x11-1.0.so.0.0.0
/usr/lib/libgweather.so.0.0.0
/usr/lib/libgnomekbd.so.1.0.0
/usr/lib/libgnomeprintui-2-2.so.0.1.0
/usr/lib/libgksu2.so.0.0.1
/usr/lib/libcddb-slave2.so.0.0.0
/usr/lib/libGLU.so.1.3.060502
/usr/lib/libnautilus-burn.so.4.0.0
/usr/lib/libvte.so.9.2.10
/usr/lib/libcairo.so.2.11.5
/usr/lib/libgutenprintui2.so.1.0.0
/usr/lib/libgailutil.so.18.0.1
/usr/lib/libgtkgl-2.0.so.1.0.0
/usr/lib/libgucharmap.so.6.0.1
/usr/lib/libgtkhtml-2.so.0.0.0
/usr/lib/libwnck-1.so.18.2.9
/usr/lib/libbonoboui-2.so.0.0.0
/usr/lib/libgtkglext-x11-1.0.so.0.0.0
/usr/lib/libgtksourceview-1.0.so.0.0.0
/usr/lib/libgnomeui-2.so.0.1800.1
/usr/lib/libpoppler-glib.so.1.0.0
/usr/lib/libeel-2.so.2.18.0
/usr/lib/libglade-2.0.so.0.0.7
/usr/lib/libmetacity-private.so.0.0.0
/usr/lib/libgnome-media-profiles.so.0.0.0
/usr/lib/libglitz-glx.so.1.0.0
/usr/lib/libgtkhtml-3.14.so.19.0.0
/usr/lib/libgnomecanvas-2.so.0.1400.0
/usr/lib/libgnomecupsui-1.0.so.1.0.0
/usr/lib/libgtkhtml-3.8.so.15.3.9
/usr/lib/libsexy.so.2.0.3
/usr/lib/libnotify.so.1.1.2
/usr/lib/libgtkspell.so.0.0.0
/usr/lib/libgnomekbdui.so.1.0.0
/usr/lib/libgnome-desktop-2.so.2.3.6
/usr/lib/libedataserverui-1.2.so.8.0.1
/usr/lib/libwx_gtk2_qa-2.6.so.0.3.1
/usr/lib/libwx_gtk2_fl-2.6.so.0.3.1
/usr/lib/libwx_gtk2_gl-2.6.so.0.3.1
/usr/lib/libwx_gtk2_core-2.6.so.0.3.1
/usr/lib/libwx_gtk2_adv-2.6.so.0.3.1
/usr/lib/libwx_gtk2_media-2.6.so.0.3.1
/usr/lib/libwx_gtk2_html-2.6.so.0.3.1
/usr/lib/libwx_gtk2_xrc-2.6.so.0.3.1
/usr/lib/libpanel-applet-2.so.0.2.19
/usr/lib/libgimpui-2.0.so.0.200.17
/usr/lib/libgdict-1.0.so.5.0.12
/usr/lib/libgimpwidgets-2.0.so.0.200.17
/usr/lib/libtotem-plparser.so.1.5.7
/usr/lib/libgnome-window-settings.so.1.0.0
/usr/lib/libwx_gtk2_gizmos-2.6.so.0.3.1
/usr/lib/libwx_gtk2_animate-2.6.so.0.3.1
/usr/lib/libcairomm-1.0.so.1.0.0
/usr/lib/libglademm-2.4.so.1.0.5
/usr/lib/libgnomecanvasmm-2.6.so.1.0.5
/usr/lib/libwx_gtk2u_core-2.6.so.0.3.1
/usr/lib/libwx_gtk2u_gl-2.6.so.0.3.1
/usr/lib/libwx_gtk2u_adv-2.6.so.0.3.1
/usr/lib/libwx_gtk2_mmedia-2.6.so.0.3.1
/usr/lib/libwx_gtk2_plot-2.6.so.0.3.1
/usr/lib/libwx_gtk2_deprecated-2.6.so.0.3.1
/usr/lib/libnautilus-extension.so.1.1.0
/usr/lib/libwx_gtk2_gizmos_xrc-2.6.so.0.3.1
/usr/lib/libwx_gtk2_ogl-2.6.so.0.3.1
/usr/lib/libwx_gtk2_stc-2.6.so.0.3.1
/usr/lib/libwx_gtk2_svg-2.6.so.0.3.1
/usr/lib/libwx_gtk2u_xrc-2.6.so.0.3.1
/usr/lib/libwx_gtk2u_media-2.6.so.0.3.1
/usr/lib/libgdk-x11-2.0.so.0.1000.13
/usr/lib/libwx_gtk2u_html-2.6.so.0.3.1
/usr/lib/libpangomm-1.4.so.1.0.30
/usr/lib/libwx_gtk2u_qa-2.6.so.0.3.1
/usr/lib/libwx_gtk2u_fl-2.6.so.0.3.1
/usr/lib/libwx_gtk2u_gizmos-2.6.so.0.3.1
/usr/lib/libgdkmm-2.4.so.1.0.30
/usr/lib/libwx_gtk2u_gizmos_xrc-2.6.so.0.3.1
/usr/lib/libwx_gtk2u_mmedia-2.6.so.0.3.1
/usr/lib/libwx_gtk2u_ogl-2.6.so.0.3.1
/usr/lib/libgtk-x11-2.0.so.0.1000.13
/usr/lib/libwx_gtk2u_plot-2.6.so.0.3.1
/usr/lib/libwx_gtk2u_stc-2.6.so.0.3.1
/usr/lib/libwx_gtk2u_svg-2.6.so.0.3.1
/usr/lib/libwx_gtk2u_deprecated-2.6.so.0.3.1
/usr/lib/libwx_gtk2u_animate-2.6.so.0.3.1
/usr/lib/librhythmbox-core.so.0.0.0
/usr/lib/libgtkmm-2.4.so.1.0.30
/usr/lib/libpangocairo-1.0.so.0.1600.4
/usr/lib/libemeraldengine.so.0.0.0

The list of those with it listed as NEEDED is much shorter:

find /usr/lib -type f -name '*.so.*' \
| awk '{print "readelf -d "$1" | grep >/dev/null libGL && echo "$1}' \
| sh 2>/dev/null
/usr/lib/opengl/xorg-x11/lib/libGL.so.1.2
/usr/lib/qt4/libQtOpenGL.so.4.3.0
/usr/lib/libGLw.so.1.0.0
/usr/lib/libgdkglext-x11-1.0.so.0.0.0
/usr/lib/libgksu2.so.0.0.1
/usr/lib/libGLU.so.1.3.060502
/usr/lib/libvte.so.9.2.10
/usr/lib/libgtkgl-2.0.so.1.0.0
/usr/lib/libgtkhtml-2.so.0.0.0
/usr/lib/libgtkglext-x11-1.0.so.0.0.0
/usr/lib/libglitz-glx.so.1.0.0
/usr/lib/libwx_gtk2_gl-2.6.so.0.3.1
/usr/lib/libwx_gtk2u_gl-2.6.so.0.3.1
/usr/lib/librhythmbox-core.so.0.0.0

Comment 13 Gilles Dartiguelongue (RETIRED) gentoo-dev 2007-08-14 10:43:26 UTC
It has nothing to do with gnome, not directly.

You seem to have glitz and opengl support activated,
which means that cairo is linked against libGL
but mesa has textrels
which means this is non PIC code
which means it's not prelinkable.

Net result, gnome is not prelinkable anymore.
Cairo is one of those libs that sneaked everywhere in, between 2.16 and 2.18, there is nothing you can do about prelink unless you disable at least glitz (and maybe opengl) for this package.
Comment 14 Jakub Moc (RETIRED) gentoo-dev 2007-08-14 10:51:28 UTC
(In reply to comment #11)
> (glxgear/glxinfo did link with -lGL before this, but was easily enough excluded
> with a PRELINK_PATH_MASK.  The list is now too long for PRELINK_PATH_MASK.

Your prelink stuff is not a Gnome problem, as such doesn't belong to this bug. mesa contains textrels, therefore non-pic code and cannot be prelinked, which is a known upstream issue. See Bug 164868, Bug 187955, https://bugs.freedesktop.org/show_bug.cgi?id=7459

(In reply to comment #12)
> The list of those with it listed as NEEDED is much shorter:

Which is perfectly fine and expected result. On a side note, if you hate opengl, you should disable USE=opengl, and you should disable USE=glitz for cairo as well.
Comment 15 Arthur Hagen 2007-08-14 16:58:03 UTC
(In reply to comment #14)
> 
> (In reply to comment #12)
> > The list of those with it listed as NEEDED is much shorter:
> 
> Which is perfectly fine and expected result.

I've come to realise that the use of -Wl,--as-needed is purely cosmetic in this perspective.  The libraries are still linked against, but only some of them will have the NEEDED flag set.  No thanks to Gilles Dartiguelongue for introducing this red herring, which had NOTHING whatsoever to do with the problem.  From your comment #8, you also seemed to believe that linking all parent /libraries/ with -Wl,--as-needed, this would make the apps link in fewer libraries, which caused me to re-emerge the whole machine, wasting a full day.

Again, folks, -Wl,--as-needed has /NOTHING/ to do with this problem.  Don't mention it.  Don't mention "readelf -d".  It's the libraries that are linked in and which you can see with ldd that is the problem.

> On a side note, if you hate
> opengl, you should disable USE=opengl, and you should disable USE=glitz for
> cairo as well.

I love OpenGL.  For /locally/ run applications.  As it is now, I can no longer run e.g. abiword over remote X (note to zealous subject changers:  "e.g." means it's an EXAMPLE -- please don't immediately change the subject to "abiword does not work over remote X" -- there's plenty of other apps having problems too).  Since I could before, I call that /BROKEN/.

Comment 16 Gilles Dartiguelongue (RETIRED) gentoo-dev 2007-08-14 17:29:14 UTC
(In reply to comment #15)
> I've come to realise that the use of -Wl,--as-needed is purely cosmetic in this
> perspective.  The libraries are still linked against, but only some of them
> will have the NEEDED flag set.  No thanks to Gilles Dartiguelongue for
> introducing this red herring, which had NOTHING whatsoever to do with the
> problem.  From your comment #8, you also seemed to believe that linking all
> parent /libraries/ with -Wl,--as-needed, this would make the apps link in fewer
> libraries, which caused me to re-emerge the whole machine, wasting a full day.
> 
> Again, folks, -Wl,--as-needed has /NOTHING/ to do with this problem.  Don't
> mention it.  Don't mention "readelf -d".  It's the libraries that are linked in
> and which you can see with ldd that is the problem.

I wouldn't mention the man then:
readelf - Displays information about ELF files.
-d --dynamic Displays the contents of the file's dynamic section, if it has one.

(shared librairies are to be found in this section)

ldd - print shared library dependencies

there, it prints the whole __dependencies__ needed by your application, not what is actually linked _in_. Your problem is low in the stack (libGL linked in cairo) and without --as-needed, it will be linked in _every_ _single_ gnome application. So no, --as-needed is not a cosmetic feature, far from it, but I agree this is not absolutely necessary in this case.

Now if you don't want to try the fix mentionned (disabling glitz), I'm just gonna call it a day and mark this bug as CANTFIX or UPSTREAM as this is what it is.

See bug mentionned by jakub.
Comment 17 Arthur Hagen 2007-08-14 17:55:56 UTC
(In reply to comment #16)
> Now if you don't want to try the fix mentionned (disabling glitz),

Forgive me for being sceptical and wanting to avoid another red herring chase, because (a) glitz was used also with 2.16, where there were no problems, and (b) because I can run compiz/beryl just fine on a Fedora system with 2.18, and still use prelink and remote X without pain.  Just like I could with gentoo and 2.16, in fact.

> I'm just gonna call it a day and mark this bug as CANTFIX or UPSTREAM as
> this is what it is.

If you're the maintainer, what will you do to pursue this upstreams if you believe that's where the problem is?

> See bug mentionned by jakub.

It's more of a problem than just prelink.  It means I can't take a binary of an
non-GL gnome app from system A (which has openGL) and run it on system B (which
doesn't).
Comment 18 Gilles Dartiguelongue (RETIRED) gentoo-dev 2007-08-14 18:31:08 UTC
fedora, redhat and ubuntu (probably debian as well) are all using --as-needed as of now.
Comment 19 Doug Goldstein (RETIRED) gentoo-dev 2007-08-14 19:24:35 UTC
any reason why this bug has not been closed with "RESOLVED->INVALID" with a comment of "learn how ldd works".
Comment 20 Arthur Hagen 2007-08-14 19:31:10 UTC
(In reply to comment #18)
> fedora, redhat and ubuntu (probably debian as well) are all using --as-needed
> as of now.
> 

READ MY LIPS:  Using --as-needed does *NOT* solve the problem.
As you can read from the above, I added "-Wl,--as-needed" to LDFLAGS and did "emerge -e world; emerge -e world", and the end result was that the binaries STILL required libGL.so.1

Comment 21 Arthur Hagen 2007-08-14 19:32:50 UTC
(In reply to comment #19)
> any reason why this bug has not been closed with "RESOLVED->INVALID" with a
> comment of "learn how ldd works".
> 

Because ldd here is just a tool, not the bug.  Read the descriptions of what actually is the problem.
Comment 22 Arthur Hagen 2007-08-14 19:48:38 UTC
(For what it's worth, a workaround is to exclude the opengl use flag from cairo, and rebuild the system.  glitz can be left, and has no effect on the problem.)
Comment 23 Jakub Moc (RETIRED) gentoo-dev 2007-08-14 20:21:57 UTC
Please stop bugging us if you fail to understand how the linking works. 
Comment 24 Gilles Dartiguelongue (RETIRED) gentoo-dev 2007-08-14 20:25:59 UTC
gnome apps (most of them) depends on gtk,
gtk requires cairo,
use opengl && use glitz -> cairo uses libglitz-glx.so.1
which in turn requires libGL.so.1

Indeed --as-needed is not necessary to solve your problem but it quickly helped us to spot the problem was not gnome's. Now if you really want to solve it the proper way, fix mesa.

Reassigning to x11 herd and good luck.
Comment 25 Doug Goldstein (RETIRED) gentoo-dev 2007-08-14 20:29:30 UTC
(In reply to comment #21)
> (In reply to comment #19)
> > any reason why this bug has not been closed with "RESOLVED->INVALID" with a
> > comment of "learn how ldd works".
> > 
> 
> Because ldd here is just a tool, not the bug.  Read the descriptions of what
> actually is the problem.
> 

You're truly making a fool of youself. Please stop this nonsense. Learn how linking and shared libraries work before posting to this bug again.
Comment 26 Arthur Hagen 2007-08-14 20:58:42 UTC
(In reply to comment #25)
> (In reply to comment #21)
> > (In reply to comment #19)
> > > any reason why this bug has not been closed with "RESOLVED->INVALID" with a
> > > comment of "learn how ldd works".
> > 
> > Because ldd here is just a tool, not the bug.  Read the descriptions of what
> > actually is the problem.
> > 
> 
> You're truly making a fool of youself. Please stop this nonsense. Learn how
> linking and shared libraries work before posting to this bug again.

The problem exists no matter what my our your level of understanding of linking or shared libraries is.  Whether my understanding of linking makes it impossible for you to understand what the problem is is a different matter.  If so, I request that you politely try to query for the information that would lead you to understand the problem, and not resort to names calling.

To summarise:

- With gnome 2.16, binaries do not depend on libGL.so.1, and will both prelink and can be quickpkgd from one system to another without problems.

- With gnome 2.18, all binaries linked against libcairo will depend on libGL.so.1 if "opengl" is set as a use flag for cairo, and the binaries will not prelink, nor run on a different system without opengl, no matter whether the apps themselves use opengl or not.  (Also run /extremely/ slowly against X servers that don't support OpenGL, but that could be the implementation design of those servers, and incidental.)

Tried:  (Suggested by Gilles and Jakub)  Recompiling the entire chain twice with "-Wl,--as-needed" does NOT alleviate the problem.
Tried:  (Suggested by Gilles) Removing glitz from cairo does not alleviate the problem.
Tried:  (Not suggested)  Removing opengl from cairo and recompiling the entire chain DOES alleviate the problem (but beryl no longer works, which it did with 2.16)
Not tried:  (Suggested by Doug Goldstein):  Shutting up.

Truly, I want to understand exactly /why/ this worked under 2.16 and not 2.18, and how I can get 2.18 to work as 2.16 did, with both opengl apps locally, non-gl apps remotely and prelink without an exclusion list so long that it breaks the maximum line length when running env-update(!).  If you can't contribute to that, and only can contribute insults, I suggest that you call in the relations people.

Comment 27 Jakub Moc (RETIRED) gentoo-dev 2007-08-14 21:21:59 UTC
(In reply to comment #26)
I'd suggest that you read http://www.linux.org/docs/ldp/howto/Program-Library-HOWTO/shared-libraries.html, then you can move to http://people.redhat.com/drepper/dsohowto.pdf (section 3.9), followed by --as-needed section of `info ld`

As for your totally off-topic prelink issue, go use mesa-7.0.1, thanks. Bugzilla is not a discussion forum nor a place to explain how linking and shared libs work on Linux. This bug is closed, so kindly avoid more noise here. TIA.