From: Sebastien Marie Subject: Re: lang/sbcl - building and installing libsbcl.so ? To: Dima Pasechnik , Theo Buehler , George Koehler , ports@openbsd.org Date: Fri, 26 Apr 2024 07:04:22 +0200 Dima Pasechnik writes: > On Fri, Apr 26, 2024 at 12:11:31AM +0200, Kirill A. Korinsky wrote: >> On Thu, 25 Apr 2024 23:28:27 +0200, >> Dima Pasechnik wrote: >> > >> > +SHARED_LIBS += sbcl 0.0 >> >> I suggest to match library version with sbcl version to avoid nightmare, as >> far as I recall upstream doesn't care about ABI stability between releases, >> and, for example, .fasl should be recompiled each new release. > > One can't just take X.Y.Z as a version for .so, as they must have the > form X.Y, not X.Y.Z. With this in mind, as well as due to the fact that > the upstream hasn't versioned libsbcl.so at all, starting from 0.0 > might be OK, no? (These would be OpenBSD-specific versions, anyway). I am unsure about X.Y vs X.Y.Z, but shared-libs on OpenBSD has X.Y and the numbering is controlled by porters. So if SHARED_LIBS is used, it must be 0.0 at start. Please note that the ABI control isn't just about what upstream is doing on their side: if changes are done on OpenBSD, the ABI might change too (remember the time_t size change ? it was a local change in OpenBSD which affected ABI on all ports using time_t in signatures) Regarding the update path for the port, we have tools for helping checking ABI changes (and it is also possible to just major bump at each release too). >> >> > @info info/sbcl.info >> > +@so lib/libsbcl.so.0.0 >> >> Without symlink libsbcl.so -> libsbcl.so.0.0 linking agains that library >> will be quite tricky. > > Not really. OpenBSD linker is clever enough to know that -lsbcl > corresponds to the newest libsbcl.so.x.y. I agree. >> >> Minor remarks: >> - minus sign as the first character inside the patch should be ok, but may >> be considered quite suspicious. > That was in already present patches. it isn't a problem. >> - you also need to increase reviosion with that changes. yes, it should be done (but I intent to wait for 2.4.4 in few days to integrate your changes) >> - I suggest to add diff.noprefix=true to port's git config to avoid prefix > > if your port tree is under git, you can save my diff to my_patch and do > > git apply my_patch :-) > `patch -p1` is also a possibility. Only one thing isn't properly addressed: the SONAME of the library is still `libsbcl.so`. This information is used by the linker at compile time when the library is used. $ readelf -d libsbcl.so | grep SONAME Having SOFLAGS defined to -Wl,-soname,libsbcl.so.${LIBsbcl_VERSION} should be enough (I have done that in src/runtime/Config.generic-openbsd, but I did the things a bit differently). Thanks. -- Sebastien Marie