GNOME Bugzilla – Bug 660523
Recognize OpenBSD shared library naming
Last modified: 2015-02-07 16:45:03 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?
Review of attachment 197822 [details] [review]: Can you give me a link to a description of this scheme?
This page makes it look like OpenBSD has the same versioning: http://www.openbsd.org/faq/ports/specialtopics.html#SharedLibs
Can you paste some representative output of ls "/usr/lib/*.so*" ?
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 ;-)
Created attachment 197851 [details] [review] Adjust dlopened library name on OpenBSD so we always pick the right one.
I don't think there's any need for special-casing this. I mean, .2 will still work on OpenBSD, no ?
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.
(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`.
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.
Review of attachment 197851 [details] [review]: Ok, if you think it's right for OpenBSD.
Yep, we've been running with this for quite a while now. Thanks.
[Mass-moving gobject-introspection tickets to its own Bugzilla product - see bug 708029. Mass-filter your bugmail for this message: introspection20150207 ]