pkgsrc-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: pkg/56906: libbsd: update devel/libbsd to 0.11.0



So, an update on this topic is due. 

I modified wip/libbsd 's Makefile to enable link-time optimization when
supported, and I forced autoreconf at pre-configure stage, since the
README for 0.11.6 recommends running `autogen'.

The package now explicitly depends on devel/libmd (available as wip/libmd)
through the buildlink methodology.

wip/libbsd (0.11.6) compiles fine on Linux, but any time I try to link
against it in a package (with -lbsd or pkg-config), the compiler hangs
indefinitely at build stage. This didn't ahppen with previous versions
of libbsd.

I was able to reproduce it by attempting to compile the same programs
manually, both on my workstation (Slackware 15.0) and on SDF's MetaArray
(Debian 11), using a very standard mk.conf. Still same issue, as soon as
the compiler tries to link against libbsd, the build freezes forever,
without printing any error.

Apparently nobody else reported this so far. Other distributions do not
apply any noteworthy patch to libbsd-0.11.6, aside from removing the
libtool archives, which for them is common practice. 

I wonder whether this has anything to do with the pkgsrc infrastructure
(default compiler flags, linked libs, mitigations) or if I'm missing
something very stupid in the Makefile, which somebody more knowledgeable
would catch immediately while looking at libbsd's build log.

Anyway, at least I've nailed down the issue to some change introduced
between 0.11.3 and 0.11.4, as libbsd-0.11.3 allows me to pass -lbsd
safely in other packages, while 0.11.4 does not (resulting in the
aforementioned 'hang').

The ChangeLog for libbsd is available at:
https://cgit.freedesktop.org/libbsd/log/?h=main

I'd look at any commit between 0.11.3 and 0.11.4. One may be:
"Switch md5 compatibility logic back to direct linking"
https://cgit.freedesktop.org/libbsd/commit/?h=main&id=e7cf8c5785b14fc8fbd37bb665a5f9a4f28c7888

Would it make sense, for the time being, to pull libbsd-0.11.3, together
to libmd-1.0.4 (latest) in the main tree, and try to understand what's
the issue with 11.0.6 in the meantime?

Speaking of libmd, I successfully built wip/libmd on NetBSD and Solaris
11 (and Linux). It's a very simple package and unless someone has
something to object, I'd consider it ready to import. 
The only problem with libmd is that it contains code licensed under
'beer-ware' [1], an extremely permissive and substantially copyright-
only license, which, while being supposedly BSD/GPL compatible, is not
included among the accepted licenses in licenses.mk  

I found libbsd to be very linux-centric instead (not something
unheard of freedesktop's), in spite of their supposed focus on
portability. Ii'm confident  that libbsd is routinely tested on Linux,
macOS (and perhaps MingW) only.

They recently dropped OpenBSD support, since their obsd-specific
arc4random implementation wouldn't compile in it.

On Solaris 11.4 the build fails early on, due to incompatible
arc4random_addrandom(). I suppose this would turn out the same way on
illumos too.

On NetBSD, arc4random.c, getopt.c and some others compile fine after
patching bsd/unistd.h for closefrom(), but I found that multiple other
functions need major rework. And at this point, it's probably better to
rely on a ad-hoc compat library when porting openbsd software, as done
for openssh, or devel/got.

At the same time, a good portion of *BSD utils ported to Linux adn OS X
relies on libbsd, so it does make sense to have a working and up to date
version in repo.
  
[1] https://en.wikipedia.org/wiki/Beerware

- PVO

Attachment: signature.asc
Description: PGP signature



Home | Main Index | Thread Index | Old Index