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 660523 - Recognize OpenBSD shared library naming
Recognize OpenBSD shared library naming
Status: RESOLVED FIXED
Product: gobject-introspection
Classification: Platform
Component: general
unspecified
Other OpenBSD
: Normal normal
: ---
Assigned To: gobject-introspection Maintainer(s)
gobject-introspection Maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2011-09-29 21:08 UTC by Jasper Lievisse Adriaanse
Modified: 2015-02-07 16:45 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Recognize OpenBSD shared library naming (984 bytes, patch)
2011-09-29 21:08 UTC, Jasper Lievisse Adriaanse
reviewed Details | Review
Adjust dlopened library name on OpenBSD so we always pick the right one. (1.03 KB, patch)
2011-09-30 07:03 UTC, Jasper Lievisse Adriaanse
accepted-commit_now Details | Review

Description Jasper Lievisse Adriaanse 2011-09-29 21:08:01 UTC
Created attachment 197822 [details] [review]
Recognize OpenBSD shared library naming

OpenBSD's library naming scheme differs from Linux or the other operating systems listed in configure.ac. As such, would it be OK to push the attached patch?
Comment 1 Colin Walters 2011-09-29 21:15:00 UTC
Review of attachment 197822 [details] [review]:

Can you give me a link to a description of this scheme?
Comment 2 Colin Walters 2011-09-29 21:16:22 UTC
This page makes it look like OpenBSD has the same versioning:
http://www.openbsd.org/faq/ports/specialtopics.html#SharedLibs
Comment 3 Colin Walters 2011-09-29 21:16:48 UTC
Can you paste some representative output of ls "/usr/lib/*.so*" ?
Comment 4 Jasper Lievisse Adriaanse 2011-09-30 07:02:35 UTC
Sorry for the misunderstanding. After re-inspecting my diff I realized I mislead myself. Attached is a better diff, as on OpenBSD ld will load the shared object with the highest version number. Thus it's not needed to hardcode the '2' in CAIRO_SHARED_LIBRARY on OpenBSD.

I hope this explanation and diff do a better job than the previous one ;-)
Comment 5 Jasper Lievisse Adriaanse 2011-09-30 07:03:07 UTC
Created attachment 197851 [details] [review]
Adjust dlopened library name on OpenBSD so we always pick the right one.
Comment 6 Matthias Clasen 2011-09-30 12:08:17 UTC
I don't think there's any need for special-casing this. 
I mean, .2 will still work on OpenBSD, no ?
Comment 7 Jasper Lievisse Adriaanse 2011-09-30 12:58:11 UTC
No, because that would be hardcoding the '.2' and that page you found earlier points out that we'd like to control shared object versioning ourselves. This is due to the fact upstream doesn't always know when to bump or not to bump, heck, we've seen library versions go backwards :-)

So, for OpenBSD it either has to be libcairo.so, or libcairo.so.X.Y. Since the latter would be hard to maintain and keep in sync, I propose to use the short form and let the dynamic loader do the work of figuring out the correct values for X and Y.

I hope this makes it a bit more clear after the initial confusion.
Comment 8 Colin Walters 2011-09-30 13:06:08 UTC
(In reply to comment #7)

> So, for OpenBSD it either has to be libcairo.so, or libcairo.so.X.Y. Since the
> latter would be hard to maintain and keep in sync, I propose to use the short
> form and let the dynamic loader do the work of figuring out the correct values
> for X and Y.

OpenBSD has no "devel/runtime" split then, i.e. when you install cairo you get both the headers and the shared library?  We don't (yet) have this notion in GNOME but we will, and anyways in this situation the "devel" bit has the unversioned libcairo.so symlink, and the "runtime" bit has the libcairo.so.X.Y.

The point is that the typelib should point to the versioned one, because it corresponds to that version.

So if you don't want to hardcode .2, the right fix is probably to follow the symlink with `readlink libcairo.so`.
Comment 9 Jasper Lievisse Adriaanse 2011-09-30 13:19:56 UTC
On OpenBSD there are no such thing as symlinks in /usr/{local/}lib/. Telling ld.so to load 'libcairo.so' will result in ld.so to figure out that we want the highest version available, which right now results in ld.so loading libcairo.so.11.1.
Comment 10 Colin Walters 2011-09-30 18:04:33 UTC
Review of attachment 197851 [details] [review]:

Ok, if you think it's right for OpenBSD.
Comment 11 Jasper Lievisse Adriaanse 2011-09-30 18:09:58 UTC
Yep, we've been running with this for quite a while now. Thanks.
Comment 12 André Klapper 2015-02-07 16:45:03 UTC
[Mass-moving gobject-introspection tickets to its own Bugzilla product - see bug 708029. Mass-filter your bugmail for this message: introspection20150207 ]