Re: Skalibs on OpenBSD

From: Guillermo <gdiazhartusch_at_gmail.com>
Date: Mon, 13 Feb 2017 14:01:58 -0300

Hi,

2017-02-13 2:49 GMT-03:00 multiplex'd:
>
> [...] However, when I compile s6, one of the programs fails
> to link (I didn't pay attention to which one), with the linker complaining about
> an undefined reference to arc4random_addrandom().
>
> Long story short, after searching through the skalibs source, OpenBSD's manpages
> and OpenBSD's CVS, I found that OpenBSD removed the arc4random_addrandom() and
> arc4random_stir() functions in 2013.
>
> I tried commenting out the body of random_init() in librandom [...]

Don't. This looks like a portability issue. The definition of
random_init() that makes use of arc4random_addrandom() is
#ifdef-guarded. It gets picked up if macro SKALIBS_HASARC4RANDOM is
defined, and whether it is (in <skalibs/sysdeps.h>) or not depends on
the result of tests perfomed by skalib's 'configure' script. In this
case, the particular test is this one:

<http://git.skarnet.org/cgi-bin/cgit.cgi/skalibs/plain/src/sysdeps/tryarc4random.c?h=v2.4.0.2&id=77bfd9b4f9406f767178da98cf76ab98b2ffa5ea>

What it actually tests for is the presence of function
arc4random_uniform(), probably assuming that if it is available, then
arc4random_addrandom() will be as well, and looking at OpenBSD's man
pages, it seems version 5.5 and later defeat that assumption. If
that's really it, you did the right thing by reporting it here, and
Laurent is going to love this one :D

G.
Received on Mon Feb 13 2017 - 17:01:58 UTC

This archive was generated by hypermail 2.3.0 : Sun May 09 2021 - 19:38:49 UTC