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 784954 - Private library pkg-config files should set RPATH
Private library pkg-config files should set RPATH
Status: RESOLVED OBSOLETE
Product: mutter
Classification: Core
Component: general
git master
Other Linux
: Normal normal
: ---
Assigned To: mutter-maint
mutter-maint
Depends on:
Blocks:
 
 
Reported: 2017-07-14 14:54 UTC by Dan Nicholson
Modified: 2021-07-05 13:46 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Pass RPATH info in private library pkg-config files (3.47 KB, patch)
2017-07-14 15:00 UTC, Dan Nicholson
none Details | Review

Description Dan Nicholson 2017-07-14 14:54:27 UTC
Mutter distributes forked clutter and cogl libraries, but they're installed to a non-standard ${libdir}/mutter directory. Because of this, consumers of mutter (e.g., gnome-shell) need to know to set an RPATH to this directory or the libraries won't be found at runtime.

Mutter should handle this in it's .pc files so that consumers don't need to know to do that.
Comment 1 Dan Nicholson 2017-07-14 15:00:35 UTC
Created attachment 355603 [details] [review]
Pass RPATH info in private library pkg-config files

The private mutter libraries (e.g., libmutter-clutter) are installed to
a non-standard path but expected to be used as public API. Because of
this, consumers of mutter (e.g., gnome-shell) need to know to set an
RPATH to this directory or the libraries won't be found at runtime.

Pass the -R${libdir} option in the Libs settings in the pkg-config files
for the private libraries. This allows consumers to get the needed RPATH
info without special casing mutter. Using -R is more portable than the
binutils ld's -rpath option.
Comment 2 Dan Nicholson 2017-07-14 15:02:53 UTC
BTW, I tested this with a gnome-shell build. It was able to build correctly even after I removed all the special rpath handling it does for mutter.
Comment 3 Florian Müllner 2017-07-14 15:29:34 UTC
(In reply to Dan Nicholson from comment #1)
> Using -R is more portable than the binutils ld's -rpath option.

-R isn't a linker flag, is it? So I suspect that this will break when not using libtool.


(In reply to Dan Nicholson from comment #2)
> BTW, I tested this with a gnome-shell build. It was able to build correctly
> even after I removed all the special rpath handling it does for mutter.

It would be good to test with wip/fmuellner/meson as well.
Comment 4 Dan Nicholson 2017-07-14 16:06:00 UTC
It is a linker flag. From ld(1):

  For compatibility with other ELF linkers, if the -R option is
  followed by a directory name, rather than a file name, it is
  treated as the -rpath option.

However, if you pass it straight to gcc, it doesn't like it. So, I guess you do need a -Wl prefixed option there. I can just change it to -Wl,-rpath even though that's not really portable.

I guess the most correct thing would be to figure it out in configure and then substitute it. I don't know.

BTW, why does mutter install the libraries to a private directory when all the libraries are namespaced with mutter prefixes and there's a public pkg-config file?

> It would be good to test with wip/fmuellner/meson as well.

OK. I'll try when I get a chance.
Comment 5 GNOME Infrastructure Team 2021-07-05 13:46:03 UTC
GNOME is going to shut down bugzilla.gnome.org in favor of gitlab.gnome.org.
As part of that, we are mass-closing older open tickets in bugzilla.gnome.org
which have not seen updates for a longer time (resources are unfortunately
quite limited so not every ticket can get handled).

If you can still reproduce the situation described in this ticket in a recent
and supported software version, then please follow
  https://wiki.gnome.org/GettingInTouch/BugReportingGuidelines
and create a new ticket at
  https://gitlab.gnome.org/GNOME/mutter/-/issues/

Thank you for your understanding and your help.