From 4e082bffbcc46e68644ae0d59b4f09bf2b5feb84 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Thu, 13 Aug 2020 17:49:35 +0200 Subject: [PATCH] sys_random: Work around an uClibc bug. Reported by akater via Stefan Kangas in . * lib/sys_random.in.h: On uClibc, include first. * m4/sys_random_h.m4 (gl_HEADER_SYS_RANDOM): Update comment. * m4/getrandom.m4 (gl_FUNC_GETRANDOM): Likewise. * doc/glibc-headers/sys_random.texi: Mention the uClibc bug. --- ChangeLog | 11 +++++++++++ doc/glibc-headers/sys_random.texi | 2 +- lib/sys_random.in.h | 4 ++++ m4/getrandom.m4 | 5 +++-- m4/sys_random_h.m4 | 5 +++-- 5 files changed, 22 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index c0cee5fe53..884be61ee1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2020-08-13 Bruno Haible + + sys_random: Work around an uClibc bug. + Reported by akater + via Stefan Kangas + in . + * lib/sys_random.in.h: On uClibc, include first. + * m4/sys_random_h.m4 (gl_HEADER_SYS_RANDOM): Update comment. + * m4/getrandom.m4 (gl_FUNC_GETRANDOM): Likewise. + * doc/glibc-headers/sys_random.texi: Mention the uClibc bug. + 2020-08-12 Bruno Haible Avoid implicit conversion from 'unsigned int' to 'int' in initializers. diff --git a/doc/glibc-headers/sys_random.texi b/doc/glibc-headers/sys_random.texi index f533a7abf7..df5d684fd9 100644 --- a/doc/glibc-headers/sys_random.texi +++ b/doc/glibc-headers/sys_random.texi @@ -25,7 +25,7 @@ This header file is missing on some platforms: glibc 2.24, NetBSD 9.0, OpenBSD 3.8, Minix 3.1.8, AIX 7.1, HP-UX 11.11, IRIX 6.5, Cygwin 2.6.x, mingw, MSVC 14. @item This header file is not self-contained on some platforms: -Mac OS X 10.13. +uClibc, Mac OS X 10.13. @end itemize Portability problems not fixed by Gnulib: diff --git a/lib/sys_random.in.h b/lib/sys_random.in.h index 290fa3938e..a8469cf5cc 100644 --- a/lib/sys_random.in.h +++ b/lib/sys_random.in.h @@ -23,6 +23,10 @@ #if @HAVE_SYS_RANDOM_H@ +/* On uClibc, assumes prior inclusion of . */ +# if defined __UCLIBC__ +# include +# endif /* On Mac OS X 10.5, assumes prior inclusion of . On Max OS X 10.13, assumes prior inclusion of a file that includes , such as or . */ diff --git a/m4/getrandom.m4 b/m4/getrandom.m4 index 424c2fad3e..d6da71a2c8 100644 --- a/m4/getrandom.m4 +++ b/m4/getrandom.m4 @@ -1,4 +1,4 @@ -# getrandom.m4 serial 7 +# getrandom.m4 serial 8 dnl Copyright 2020 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -18,7 +18,8 @@ AC_DEFUN([gl_FUNC_GETRANDOM], [gl_cv_func_getrandom_ok], [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( - [[/* Additional includes are needed before on Mac OS X. */ + [[/* Additional includes are needed before on uClibc + and Mac OS X. */ #include #include #include diff --git a/m4/sys_random_h.m4 b/m4/sys_random_h.m4 index a964b15784..8c5d53703b 100644 --- a/m4/sys_random_h.m4 +++ b/m4/sys_random_h.m4 @@ -1,4 +1,4 @@ -# sys_random_h.m4 serial 4 +# sys_random_h.m4 serial 5 dnl Copyright (C) 2020 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -25,7 +25,8 @@ AC_DEFUN([gl_HEADER_SYS_RANDOM], dnl corresponding gnulib module is not in use. gl_WARN_ON_USE_PREPARE([[ #if HAVE_SYS_RANDOM_H -/* Additional includes are needed before on Mac OS X. */ +/* Additional includes are needed before on uClibc + and Mac OS X. */ # include # include # include -- 2.39.5