On 2022/11/04 11:33:43 +0000, Stuart Henderson <s...@spacehopper.org> wrote: > On 2022/11/04 11:38, Omar Polo wrote: > > While looking at one update recently i've seen one upstream disabling > > the soname on OpenBSD because of specialtopics.html; they just > > wanted to be nice I guess, but this reminded me of this section of > > the faqs. Is it still the case to advise people to actively drop > > the soname? > > We stopped doing that for base libraries in 2017 and src/usr.bin/libtool > in 2018. > > > -<h3>Avoid DT_SONAME hardcoding</h3> > > +<h3>Check DT_SONAME</h3> > > If it's important, the check should be automated somewhere, perhaps in > check-lib-depends. (I don't think this is a thing which most porters wil > look at unless there's an actual problem..)
I haven't thought of that, it'd would be better! I'll give it an attempt at automatizing this in the port infrastructure. so i guess we can go with this sexy sequence of - Index: specialtopics.html =================================================================== RCS file: /home/cvs/www/faq/ports/specialtopics.html,v retrieving revision 1.89 diff -u -p -r1.89 specialtopics.html --- specialtopics.html 14 Oct 2022 18:07:42 -0000 1.89 +++ specialtopics.html 4 Nov 2022 11:53:22 -0000 @@ -149,30 +149,6 @@ those libraries set to version 0.0, clea and when you regenerate the PLIST you should see that it starts to use the version numbers. -<h3>Avoid DT_SONAME hardcoding</h3> - -Some ports use the <code>-soname</code> flag of -<a href="https://man.openbsd.org/ld">ld(1)</a> to override the library -specification in the DT_SONAME field. -Setting DT_SONAME is not a bug itself but is usually not desirable on -OpenBSD where <a href="https://man.openbsd.org/ld.so">ld.so(1)</a> is smart and -the ports tree takes care of library versioning. -Moreover, a wrong soname can result in unusable binaries that depend on this -library; either always or after some updates to the port containing the library. -To check if the DT_SONAME field is set, run the following command: - -<pre class="cmdbox"> -$ <b>objdump -x /path/to/libfoo.so.0.0 | fgrep SONAME</b> - SONAME libfoo.so.0.0 -</pre> - -As a general rule, <em>setting soname explicitly should be patched out</em>. -The only exception is a situation when the right soname is recorded -<em>and</em> it's hard to patch soname-related code out <em>and</em> -upstream won't accept such a patch. -In that case the soname should fully match the file name (see the example -above). - <h3>Try putting all user visible libraries into /usr/local/lib</h3> As a rule, requesting the user to add directories to their