All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v2, 1/1] package/diffutils: fix build with uclibc < 1.0.35
@ 2021-12-01  7:00 Fabrice Fontaine
  2021-12-02 17:17 ` Peter Korsgaard
  0 siblings, 1 reply; 4+ messages in thread
From: Fabrice Fontaine @ 2021-12-01  7:00 UTC (permalink / raw)
  To: buildroot; +Cc: Fabrice Fontaine

Fix the following build failure with uclibc < 1.0.35 raised since bump
to version 3.8 in commit 1f89c80417ad03127650b22c41ec4e30d42c549f:

In file included from ./sys/random.h:40,
                 from getrandom.c:22:
/home/giuliobenetti/autobuild/run/instance-0/output-1/host/x86_64-buildroot-linux-uclibc/sysroot/usr/include/sys/random.h:27:35: error: unknown type name 'size_t'
   27 | extern int getrandom(void *__buf, size_t count, unsigned int flags)
      |                                   ^~~~~~
/home/giuliobenetti/autobuild/run/instance-0/output-1/host/x86_64-buildroot-linux-uclibc/sysroot/usr/include/sys/random.h:8:1: note: 'size_t' is defined in header '<stddef.h>'; did you forget to '#include <stddef.h>'?
    7 | #include <features.h>
  +++ |+#include <stddef.h>
    8 |

Fixes:
 - http://autobuild.buildroot.org/results/adecc3e5def140348dfff30961fe6514c9a8e7b5

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
Changes v1 -> v2:
 - Use upstream patch

 ..._random-port-better-to-uClibc-1-0-35.patch | 39 +++++++++++++++++++
 1 file changed, 39 insertions(+)
 create mode 100644 package/diffutils/0003-sys_random-port-better-to-uClibc-1-0-35.patch

diff --git a/package/diffutils/0003-sys_random-port-better-to-uClibc-1-0-35.patch b/package/diffutils/0003-sys_random-port-better-to-uClibc-1-0-35.patch
new file mode 100644
index 0000000000..f9dd12f8e6
--- /dev/null
+++ b/package/diffutils/0003-sys_random-port-better-to-uClibc-1-0-35.patch
@@ -0,0 +1,39 @@
+From 135414a7f543e4d40ad0a7cbd51885e159a6e0f4 Mon Sep 17 00:00:00 2001
+From: Paul Eggert <eggert@cs.ucla.edu>
+Date: Tue, 30 Nov 2021 17:50:01 -0800
+Subject: sys_random: port better to uClibc < 1.0.35
+
+Problem reported by Fabrice Fontaine in:
+https://lists.gnu.org/r/bug-gnulib/2021-11/msg00043.html
+* lib/sys_random.in.h [HAVE_SYS_RANDOM_H && !__GLIBC__ && __UCLIBC__]:
+Include <stddef.h>, in case this file is included before
+__UCLIBC__ is defined.
+
+[Retrieved (and backported to remove ChangeLog update) from:
+https://git.savannah.gnu.org/cgit/gnulib.git/commit/?id=135414a7f543e4d40ad0a7cbd51885e159a6e0f4]
+Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+---
+ ChangeLog           | 9 +++++++++
+ lib/sys_random.in.h | 6 ++++--
+ 2 files changed, 13 insertions(+), 2 deletions(-)
+
+diff --git a/lib/sys_random.in.h b/lib/sys_random.in.h
+index 1abd6c544..8b4b934a1 100644
+--- a/lib/sys_random.in.h
++++ b/lib/sys_random.in.h
+@@ -23,8 +23,10 @@
+ 
+ #if @HAVE_SYS_RANDOM_H@
+ 
+-/* On uClibc, <sys/random.h> assumes prior inclusion of <stddef.h>.  */
+-# if defined __UCLIBC__
++/* On uClibc < 1.0.35, <sys/random.h> assumes prior inclusion of <stddef.h>.
++   Do not use __UCLIBC__ here, as it might not be defined yet.
++   But avoid namespace pollution on glibc systems.  */
++# ifndef __GLIBC__
+ #  include <stddef.h>
+ # endif
+ /* On Mac OS X 10.5, <sys/random.h> assumes prior inclusion of <sys/types.h>.
+-- 
+cgit v1.2.1
+
-- 
2.33.0

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [Buildroot] [PATCH v2, 1/1] package/diffutils: fix build with uclibc < 1.0.35
  2021-12-01  7:00 [Buildroot] [PATCH v2, 1/1] package/diffutils: fix build with uclibc < 1.0.35 Fabrice Fontaine
@ 2021-12-02 17:17 ` Peter Korsgaard
  2021-12-02 17:29   ` Fabrice Fontaine
  0 siblings, 1 reply; 4+ messages in thread
From: Peter Korsgaard @ 2021-12-02 17:17 UTC (permalink / raw)
  To: Fabrice Fontaine; +Cc: buildroot

>>>>> "Fabrice" == Fabrice Fontaine <fontaine.fabrice@gmail.com> writes:

 > Fix the following build failure with uclibc < 1.0.35 raised since bump
 > to version 3.8 in commit 1f89c80417ad03127650b22c41ec4e30d42c549f:

 > In file included from ./sys/random.h:40,
 >                  from getrandom.c:22:
 > /home/giuliobenetti/autobuild/run/instance-0/output-1/host/x86_64-buildroot-linux-uclibc/sysroot/usr/include/sys/random.h:27:35: error: unknown type name 'size_t'
 >    27 | extern int getrandom(void *__buf, size_t count, unsigned int flags)
 >       |                                   ^~~~~~
 > /home/giuliobenetti/autobuild/run/instance-0/output-1/host/x86_64-buildroot-linux-uclibc/sysroot/usr/include/sys/random.h:8:1: note: 'size_t' is defined in header '<stddef.h>'; did you forget to '#include <stddef.h>'?
 >     7 | #include <features.h>
 >   +++ |+#include <stddef.h>
 >     8 |

 > Fixes:
 >  - http://autobuild.buildroot.org/results/adecc3e5def140348dfff30961fe6514c9a8e7b5

 > Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
 > ---
 > Changes v1 -> v2:
 >  - Use upstream patch

 >  ..._random-port-better-to-uClibc-1-0-35.patch | 39 +++++++++++++++++++
 >  1 file changed, 39 insertions(+)
 >  create mode 100644 package/diffutils/0003-sys_random-port-better-to-uClibc-1-0-35.patch

 > diff --git a/package/diffutils/0003-sys_random-port-better-to-uClibc-1-0-35.patch b/package/diffutils/0003-sys_random-port-better-to-uClibc-1-0-35.patch
 > new file mode 100644
 > index 0000000000..f9dd12f8e6
 > --- /dev/null
 > +++ b/package/diffutils/0003-sys_random-port-better-to-uClibc-1-0-35.patch
 > @@ -0,0 +1,39 @@
 > +From 135414a7f543e4d40ad0a7cbd51885e159a6e0f4 Mon Sep 17 00:00:00 2001
 > +From: Paul Eggert <eggert@cs.ucla.edu>
 > +Date: Tue, 30 Nov 2021 17:50:01 -0800
 > +Subject: sys_random: port better to uClibc < 1.0.35
 > +
 > +Problem reported by Fabrice Fontaine in:
 > +https://lists.gnu.org/r/bug-gnulib/2021-11/msg00043.html
 > +* lib/sys_random.in.h [HAVE_SYS_RANDOM_H && !__GLIBC__ && __UCLIBC__]:
 > +Include <stddef.h>, in case this file is included before
 > +__UCLIBC__ is defined.
 > +
 > +[Retrieved (and backported to remove ChangeLog update) from:
 > +https://git.savannah.gnu.org/cgit/gnulib.git/commit/?id=135414a7f543e4d40ad0a7cbd51885e159a6e0f4]
 > +Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
 > +---
 > + ChangeLog           | 9 +++++++++
 > + lib/sys_random.in.h | 6 ++++--
 > + 2 files changed, 13 insertions(+), 2 deletions(-)
 > +
 > +diff --git a/lib/sys_random.in.h b/lib/sys_random.in.h
 > +index 1abd6c544..8b4b934a1 100644
 > +--- a/lib/sys_random.in.h
 > ++++ b/lib/sys_random.in.h
 > +@@ -23,8 +23,10 @@
 > + 
 > + #if @HAVE_SYS_RANDOM_H@
 > + 
 > +-/* On uClibc, <sys/random.h> assumes prior inclusion of <stddef.h>.  */
 > +-# if defined __UCLIBC__
 > ++/* On uClibc < 1.0.35, <sys/random.h> assumes prior inclusion of <stddef.h>.
 > ++   Do not use __UCLIBC__ here, as it might not be defined yet.
 > ++   But avoid namespace pollution on glibc systems.  */
 > ++# ifndef __GLIBC__
 > + #  include <stddef.h>

Are you sure that works? uClibc-ng defines __GLIBC__.

-- 
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Buildroot] [PATCH v2, 1/1] package/diffutils: fix build with uclibc < 1.0.35
  2021-12-02 17:17 ` Peter Korsgaard
@ 2021-12-02 17:29   ` Fabrice Fontaine
  2021-12-02 17:41     ` Peter Korsgaard
  0 siblings, 1 reply; 4+ messages in thread
From: Fabrice Fontaine @ 2021-12-02 17:29 UTC (permalink / raw)
  To: Peter Korsgaard; +Cc: Buildroot Mailing List

Le jeu. 2 déc. 2021 à 18:17, Peter Korsgaard <peter@korsgaard.com> a écrit :
>
> >>>>> "Fabrice" == Fabrice Fontaine <fontaine.fabrice@gmail.com> writes:
>
>  > Fix the following build failure with uclibc < 1.0.35 raised since bump
>  > to version 3.8 in commit 1f89c80417ad03127650b22c41ec4e30d42c549f:
>
>  > In file included from ./sys/random.h:40,
>  >                  from getrandom.c:22:
>  > /home/giuliobenetti/autobuild/run/instance-0/output-1/host/x86_64-buildroot-linux-uclibc/sysroot/usr/include/sys/random.h:27:35: error: unknown type name 'size_t'
>  >    27 | extern int getrandom(void *__buf, size_t count, unsigned int flags)
>  >       |                                   ^~~~~~
>  > /home/giuliobenetti/autobuild/run/instance-0/output-1/host/x86_64-buildroot-linux-uclibc/sysroot/usr/include/sys/random.h:8:1: note: 'size_t' is defined in header '<stddef.h>'; did you forget to '#include <stddef.h>'?
>  >     7 | #include <features.h>
>  >   +++ |+#include <stddef.h>
>  >     8 |
>
>  > Fixes:
>  >  - http://autobuild.buildroot.org/results/adecc3e5def140348dfff30961fe6514c9a8e7b5
>
>  > Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
>  > ---
>  > Changes v1 -> v2:
>  >  - Use upstream patch
>
>  >  ..._random-port-better-to-uClibc-1-0-35.patch | 39 +++++++++++++++++++
>  >  1 file changed, 39 insertions(+)
>  >  create mode 100644 package/diffutils/0003-sys_random-port-better-to-uClibc-1-0-35.patch
>
>  > diff --git a/package/diffutils/0003-sys_random-port-better-to-uClibc-1-0-35.patch b/package/diffutils/0003-sys_random-port-better-to-uClibc-1-0-35.patch
>  > new file mode 100644
>  > index 0000000000..f9dd12f8e6
>  > --- /dev/null
>  > +++ b/package/diffutils/0003-sys_random-port-better-to-uClibc-1-0-35.patch
>  > @@ -0,0 +1,39 @@
>  > +From 135414a7f543e4d40ad0a7cbd51885e159a6e0f4 Mon Sep 17 00:00:00 2001
>  > +From: Paul Eggert <eggert@cs.ucla.edu>
>  > +Date: Tue, 30 Nov 2021 17:50:01 -0800
>  > +Subject: sys_random: port better to uClibc < 1.0.35
>  > +
>  > +Problem reported by Fabrice Fontaine in:
>  > +https://lists.gnu.org/r/bug-gnulib/2021-11/msg00043.html
>  > +* lib/sys_random.in.h [HAVE_SYS_RANDOM_H && !__GLIBC__ && __UCLIBC__]:
>  > +Include <stddef.h>, in case this file is included before
>  > +__UCLIBC__ is defined.
>  > +
>  > +[Retrieved (and backported to remove ChangeLog update) from:
>  > +https://git.savannah.gnu.org/cgit/gnulib.git/commit/?id=135414a7f543e4d40ad0a7cbd51885e159a6e0f4]
>  > +Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
>  > +---
>  > + ChangeLog           | 9 +++++++++
>  > + lib/sys_random.in.h | 6 ++++--
>  > + 2 files changed, 13 insertions(+), 2 deletions(-)
>  > +
>  > +diff --git a/lib/sys_random.in.h b/lib/sys_random.in.h
>  > +index 1abd6c544..8b4b934a1 100644
>  > +--- a/lib/sys_random.in.h
>  > ++++ b/lib/sys_random.in.h
>  > +@@ -23,8 +23,10 @@
>  > +
>  > + #if @HAVE_SYS_RANDOM_H@
>  > +
>  > +-/* On uClibc, <sys/random.h> assumes prior inclusion of <stddef.h>.  */
>  > +-# if defined __UCLIBC__
>  > ++/* On uClibc < 1.0.35, <sys/random.h> assumes prior inclusion of <stddef.h>.
>  > ++   Do not use __UCLIBC__ here, as it might not be defined yet.
>  > ++   But avoid namespace pollution on glibc systems.  */
>  > ++# ifndef __GLIBC__
>  > + #  include <stddef.h>
>
> Are you sure that works? uClibc-ng defines __GLIBC__.
Indeed, but as features.h is not included before this ifndef, it works
(I build tested it).
In my initial proposal, I included features.h and kept the ifdef
__UCLIBC__ : https://lists.gnu.org/archive/html/bug-gnulib/2021-11/msg00045.html
However, upstream preferred this solution.
I don't really know if features.h is a uclibc-header or not.
>
> --
> Bye, Peter Korsgaard
Best Regards,

Fabrice
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Buildroot] [PATCH v2, 1/1] package/diffutils: fix build with uclibc < 1.0.35
  2021-12-02 17:29   ` Fabrice Fontaine
@ 2021-12-02 17:41     ` Peter Korsgaard
  0 siblings, 0 replies; 4+ messages in thread
From: Peter Korsgaard @ 2021-12-02 17:41 UTC (permalink / raw)
  To: Fabrice Fontaine; +Cc: Buildroot Mailing List

>>>>> "Fabrice" == Fabrice Fontaine <fontaine.fabrice@gmail.com> writes:

 > Le jeu. 2 déc. 2021 à 18:17, Peter Korsgaard <peter@korsgaard.com> a écrit :
 >> > ++# ifndef __GLIBC__
 >> > + #  include <stddef.h>
 >> 
 >> Are you sure that works? uClibc-ng defines __GLIBC__.
 > Indeed, but as features.h is not included before this ifndef, it works
 > (I build tested it).
 > In my initial proposal, I included features.h and kept the ifdef
 > __UCLIBC__ : https://lists.gnu.org/archive/html/bug-gnulib/2021-11/msg00045.html
 > However, upstream preferred this solution.
 > I don't really know if features.h is a uclibc-header or not.

Ok - Committed, thanks.

-- 
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-12-02 17:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-01  7:00 [Buildroot] [PATCH v2, 1/1] package/diffutils: fix build with uclibc < 1.0.35 Fabrice Fontaine
2021-12-02 17:17 ` Peter Korsgaard
2021-12-02 17:29   ` Fabrice Fontaine
2021-12-02 17:41     ` Peter Korsgaard

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.