Re: False positive in skalibs system feature test

From: Jens Rehsack <rehsack_at_gmail.com>
Date: Fri, 25 Oct 2019 09:51:15 +0200

> Am 24.10.2019 um 23:41 schrieb Laurent Bercot <ska-skaware_at_skarnet.org>:
>
>
> Excellent analysis, as always. :) Thank you.
>
>
>> * If GNU libc is used, a 'choose cl' test is unreliable.
>> * GNU/Hurd and GNU/k*BSD would be 'getrandom: no' OSes, at least until
>> the libc is updated to make a system call on GNU/kFreeBSD [1]
>> * A 'choose clr' test would be reliable.
>> * Any other alternative (passing an LDFLAGS that produces a build
>> failure, overriding the result of tests, or whatever) kind of implies
>> knowledge about what the outcome of the detection is going to be,
>> anyway, doesn't it? It's not really a detection.
>
> - I will temporarily make it a 'choose clr' test.
> - However, I think this is a misdesign in the glibc, that accomplishes
> nothing else than break autodetection. As such, it should be reported
> to the glibc team.
> - Either this misdesign breaks autoconf too, or autoconf has a way of
> working around it. (Or nobody ever tests for getrandom(), but I doubt
> it - some configure scripts test for strcmp(), so, yeah.)

strcmp is C99 - and it's not "sometimes surprisingly unimplemented".

> - I have no time to take care of the real issue for at least a week.
> Could anyone please:
> * investigate how autoconf deals with it?

I digged a bit for that. As said, generally autoconf doesn't deal with
glibc or Linux specialities (it does in 90s ... - that causes more trouble
than it solves).

Another project using getrandom() does the run test, too:
* https://github.com/zeromq/libzmq/pull/3085

A hint to LibreSSL in https://lwn.net/Articles/800509/ delivered a reasonable
answer:
sno_at_beaker:~/prj/libressl-3.0.2$ grep -Rl getrandom *
ChangeLog
crypto/compat/getentropy_linux.c
sno_at_beaker:~/prj/libressl-3.0.2$ less crypto/compat/getentropy_linux.c
...
#if defined(SYS_getrandom) && defined(GRND_NONBLOCK)
static int getentropy_getrandom(void *buf, size_t len);
#endif
...
sno_at_beaker:~/prj/libressl-3.0.2$ grep -Rl SYS_getrandom *
crypto/compat/getentropy_linux.c
sno_at_beaker:~/prj/libressl-3.0.2$ grep -Rl SYS_getrandom /usr/include/
/usr/include/bits/syscall.h
/usr/include/x86_64-linux-gnu/bits/syscall.h
/usr/include/x86_64-linux-gnu/expat_config.h

Seems, there isn't much need in probing at configure stage ...

> * report the thing to libc-alpha?
>
> Thanks in advance,

Hope it helps a little bit.

Cheers
--
Jens Rehsack - rehsack_at_gmail.com



Received on Fri Oct 25 2019 - 07:51:15 UTC

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