summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2019-10-26 06:08:45 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2019-10-26 06:08:45 +0000
commit28bfd386f2e8046c7b1cfb4b796ea1347e6a42b0 (patch)
tree7a972e941187dad868d05a377e23ca7245270da3
parentc9e549afa60dc3c4660e1de42a79f810299c2ade (diff)
downloadskalibs-28bfd386f2e8046c7b1cfb4b796ea1347e6a42b0.tar.xz
Switch getrandom sysdep back to choose cl
-rwxr-xr-xconfigure4
-rw-r--r--doc/crosscompile.html5
-rw-r--r--src/sysdeps/trygetrandom.c6
3 files changed, 9 insertions, 6 deletions
diff --git a/configure b/configure
index d49390f..189a047 100755
--- a/configure
+++ b/configure
@@ -45,7 +45,7 @@ $package options:
Sysdeps autodetection override:
--with-sysdep-K=V assume sysdep K has the value V [autodetected]
-List of mandatory K for cross-compiling: devurandom (V=yes|no), getrandom (V=yes|no)
+List of mandatory K for cross-compiling: devurandom (V=yes|no)
EOF
exit 0
@@ -625,11 +625,11 @@ choose cl itimer 'setitimer()'
choose cl namespaces 'namespaces'
choose cl nsgetparent 'NS_GET_PARENT'
choose cl explicit_bzero 'explicit_bzero()'
+choose cl getrandom 'getrandom()'
# And here are the evil irreducible sysdeps.
choose clr devurandom '/dev/urandom'
-choose clr getrandom 'getrandom()'
rm -f "$tmps"
echo "Creating config.mak..."
diff --git a/doc/crosscompile.html b/doc/crosscompile.html
index 73fee33..6ff8bb1 100644
--- a/doc/crosscompile.html
+++ b/doc/crosscompile.html
@@ -83,16 +83,13 @@ the time <tt>yes</tt> or <tt>no</tt>.
<p>
At all times, <tt>./configure --help</tt> provides the list of sysdeps
you need to provide a <tt>--with-sysdep-*</tt> option for. As of
-skalibs-2.9.1.0, there are two sysdeps in this case:
+skalibs-2.9.1.0, there is only one sysdep in this case:
</p>
<ul>
<li> <tt>devurandom</tt>: <tt>yes</tt> if the target has a valid
pseudorandom generation device in <tt>/dev/urandom</tt>, and <tt>no</tt>
otherwise. </li>
- <li> <tt>getrandom</tt>: <tt>yes</tt> if the target supports the
-<a href="http://man7.org/linux/man-pages/man2/getrandom.2.html">getrandom()</a>
-system call, and <tt>no</tt> otherwise. </li>
</ul>
</body>
diff --git a/src/sysdeps/trygetrandom.c b/src/sysdeps/trygetrandom.c
index cc2426b..a9f03d1 100644
--- a/src/sysdeps/trygetrandom.c
+++ b/src/sysdeps/trygetrandom.c
@@ -1,5 +1,11 @@
/* ISC license. */
+#include <features.h>
+
+#ifdef __stub_getrandom
+#error getrandom() appears to be a stub function, we won't use it.
+#endif
+
#include <sys/random.h>
int main (void)