New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix loading of libffi on OpenBSD #37
Conversation
Best use explicit number in case of major library bump as suggested in http://lispcaveats.tumblr.com/post/13259176455/ffi-linking-against-shared-libraries
It should be safe, although for the future we should add support for pkg-config and use that on all *nix systems. |
Read this: http://lispcaveats.tumblr.com/post/13259176455/ffi-linking-against-shared-libraries This might also apply to a recent change for OSX which hardwired a path On Thu, Feb 20, 2014 at 5:21 PM, Luís Oliveira notifications@github.comwrote:
|
You can read OpenBSD developers side of shared libraries from following links: |
OK, so, as I understand it, given a @liamh Is your point is that a future version of libffi might not be compatible with cffi-libffi, thus we should specify the major version? @sionescu using pkg-config seems like a good idea? If you have time/inclination, please open a launchpad wishlist item and expand on the advantages of doing that. @zmyrgel Can you squash your commits and make it clear in the commit message (and/or a comment) that we're working around OpenBSD's decision not to create a |
@luismbo OpenBSD doesn't use symlinks at all for shared libraries. I think its best to put (:openbsd "libffi.so") with comment stating how openbsd linker handles loading it instead of keeping it at the end of :unix list. Btw, how to squash my commits? I'm not that well versed in github use. |
On Fri, Feb 21, 2014 at 11:06 AM, Timo Myyrä notifications@github.com wrote:
Oh. So there isn't a "libffi.so" file? Is it the dynamic linker who's
Agreed.
git rebase -i <hash of the last commit that's not yours> Then, when the interactive editor pops up, leave the pick instruction (See for instance |
OpenBSD doesn't use symlinks for shared libraries. It has a 'smart' linker which loads the latest library if given "libfoo.so" form so use that. Also add header directory under /usr/local to compiler flags so ffi.h is found.
Reading the OpenBSD links, it seems like we can't just specify the major On Fri, Feb 21, 2014 at 6:16 AM, Luís Oliveira notifications@github.comwrote:
|
Actually you can specify libffi.so.0 and it will then find the latest minor for it. Using the versionless library loading would ease maintenance. If the library gets bumped it will most likely work by recompiling the cffi-libffi. Otherwise someone needs to keep an eye on the library and patch the cffi-libffi on each bump. And how many bumps should be listed in the cffi-libffi's list? The OpenBSD's version number might be bumped several times within single release or might keep stable for few releases. |
If we have (:unix (:or "libffi.so.6" "libffi32.so.6" "libffi.so.5" and no :openbsd clause, does this work for OpenBSD? (I'm assuming here that I think it desirable to have as few OS conditionalizations as possible in |
Above works but it would be better to have distict :openbsd line there. |
On Sat, Feb 22, 2014 at 10:41 AM, Timo Myyrä notifications@github.comwrote:
|
Point I was trying to make is that OpenBSD lib version can conflict with the libffi package's version. |
I wasn't aware that the X in libfoo.so.X doesn't match the library's actual major version. That's unfortunate. Well, if we want to be strict about which versions of libffi we can load, then we have to maintain separate version lists for each OS. But if we don't, then using "libffi.so" should work for both Linux and OpenBSD. Usually we have to specify major versions on Linux since only dev packages install the versionless libfoo.so symlink, but we need to grovel libffi's headers anyway. So, @liamh why don't we just simplify all this to a simple |
Because major version numbers are an inherent part of the library Don't overlook the fact that cffi-libffi provides an example for users of On Sat, Feb 22, 2014 at 5:22 PM, Luís Oliveira notifications@github.comwrote:
|
@liamh adding "libffi.so" at the end obliviates the whole point of specifying library versions for the sake of ensuring binary compatibility. I'm sympathetic to your point of setting a good example, but I don't think that'd be a good example. So, either we maintain two different sets of versions for OpenBSD and Linux (and possibly others?) or we just use "libffi.so". I'm currently inclined towards the latter option. |
I'd say best to just add '(:openbsd "libffi.so")' to the list as OpenBSD library versions are different from the more commonly used versioning. Keeping them both in same list might cause issues at some point. To be exact, OpenBSD doesn't use any "development" packages like Linux but a single package. And OpenBSD doesn't use any symlinks in shared libraries. There is no symlink or file named "libffi.so" in there. Thats just shorthand for the linker to load the shared library with highest major.minor version. |
Cherry-picked onto v0.14.0 as cc07246. |
Use short library name 'libffi.so' for OpenBSD. Libffi package might change the version number but the library should work without the full "libffi.so.0.0" suffix.
In addition, add compiler flag to include /usr/local/include to header search path. These are not added by default in OpenBSD. Otherwise libffi fails to find /usr/local/include/ffi.h.