Message ID | 20220607172526.910675-1-fontaine.fabrice@gmail.com |
---|---|
State | Superseded |
Headers | show |
Series | [1/1] package/dieharder: pass _GNU_SOURCE in CFLAGS | expand |
On 07/06/2022 19:25, Fabrice Fontaine wrote: > Drop third patch and pass _GNU_SOURCE in CFLAGS to avoid the following > build failure: > > In file included from /nvmedata/autobuild/instance-18/output-1/host/microblazeel-buildroot-linux-gnu/sysroot/usr/include/bits/stat.h:25, > from /nvmedata/autobuild/instance-18/output-1/host/microblazeel-buildroot-linux-gnu/sysroot/usr/include/sys/stat.h:101, > from ../include/dieharder/libdieharder.h:23, > from bits.c:7: > /nvmedata/autobuild/instance-18/output-1/host/microblazeel-buildroot-linux-gnu/sysroot/usr/include/bits/struct_stat.h:99:33: error: field 'st_atim' has incomplete type > 99 | struct timespec st_atim; /* Time of last access. */ > | ^~~~~~~ > > Fixes: > - http://autobuild.buildroot.org/results/4609c8e2af24d9536eb33397a4659ad740aca742 > > Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com> Superseded by [1]. Regards, Arnout [1] https://patchwork.ozlabs.org/project/buildroot/patch/20220725100745.2878896-1-arnout@mind.be/ > --- > ...RCE-for-uint-and-M_PI-with-musl-libc.patch | 28 ------------------- > ...0003-Add-static-to-inline-functions.patch} | 0 > ...ch => 0004-Remove-defunct-rgb_operm.patch} | 0 > package/dieharder/dieharder.mk | 6 +++- > 4 files changed, 5 insertions(+), 29 deletions(-) > delete mode 100644 package/dieharder/0003-Add-_GNU_SOURCE-for-uint-and-M_PI-with-musl-libc.patch > rename package/dieharder/{0004-Add-static-to-inline-functions.patch => 0003-Add-static-to-inline-functions.patch} (100%) > rename package/dieharder/{0005-Remove-defunct-rgb_operm.patch => 0004-Remove-defunct-rgb_operm.patch} (100%) > > diff --git a/package/dieharder/0003-Add-_GNU_SOURCE-for-uint-and-M_PI-with-musl-libc.patch b/package/dieharder/0003-Add-_GNU_SOURCE-for-uint-and-M_PI-with-musl-libc.patch > deleted file mode 100644 > index d71cd57445..0000000000 > --- a/package/dieharder/0003-Add-_GNU_SOURCE-for-uint-and-M_PI-with-musl-libc.patch > +++ /dev/null > @@ -1,28 +0,0 @@ > -From 526510a27ef47a16699dd34a2373ad9b6bb5e8f3 Mon Sep 17 00:00:00 2001 > -From: Julien Viard de Galbert <julien@vdg.name> > -Date: Sat, 14 Jan 2017 14:19:47 +0100 > -Subject: [PATCH] Add _GNU_SOURCE for uint and M_PI with musl libc > - > -When building with musl libc _GNU_SOURCE need to be defined > -to provide uint type and M_PI macro > - > -Signed-off-by: Julien Viard de Galbert <julien@vdg.name> > ---- > - include/dieharder/libdieharder.h | 1 + > - 1 file changed, 1 insertion(+) > - > -diff --git a/include/dieharder/libdieharder.h b/include/dieharder/libdieharder.h > -index d98b758..c1a5023 100644 > ---- a/include/dieharder/libdieharder.h > -+++ b/include/dieharder/libdieharder.h > -@@ -17,6 +17,7 @@ > - > - /* This turns on uint macro in c99 */ > - #define __USE_MISC 1 > -+#define _GNU_SOURCE 1 > - #include <stdint.h> > - #include <sys/types.h> > - #include <sys/stat.h> > --- > -2.1.4 > - > diff --git a/package/dieharder/0004-Add-static-to-inline-functions.patch b/package/dieharder/0003-Add-static-to-inline-functions.patch > similarity index 100% > rename from package/dieharder/0004-Add-static-to-inline-functions.patch > rename to package/dieharder/0003-Add-static-to-inline-functions.patch > diff --git a/package/dieharder/0005-Remove-defunct-rgb_operm.patch b/package/dieharder/0004-Remove-defunct-rgb_operm.patch > similarity index 100% > rename from package/dieharder/0005-Remove-defunct-rgb_operm.patch > rename to package/dieharder/0004-Remove-defunct-rgb_operm.patch > diff --git a/package/dieharder/dieharder.mk b/package/dieharder/dieharder.mk > index cbf28922fd..e15bac6bbe 100644 > --- a/package/dieharder/dieharder.mk > +++ b/package/dieharder/dieharder.mk > @@ -36,9 +36,13 @@ endif > # parallel build fail, disable it > DIEHARDER_MAKE = $(MAKE1) > > +DIEHARDER_CFLAGS = $(TARGET_CFLAGS) -D_GNU_SOURCE > + > # Too many fixes needed to build with -fno-common which is default since gcc 10 > ifeq ($(BR2_TOOLCHAIN_GCC_AT_LEAST_10),y) > -DIEHARDER_CONF_ENV += CFLAGS="$(TARGET_CFLAGS) -fcommon" > +DIEHARDER_CFLAGS += -fcommon > endif > > +DIEHARDER_CONF_ENV += CFLAGS="$(DIEHARDER_CFLAGS)" > + > $(eval $(autotools-package))
diff --git a/package/dieharder/0003-Add-_GNU_SOURCE-for-uint-and-M_PI-with-musl-libc.patch b/package/dieharder/0003-Add-_GNU_SOURCE-for-uint-and-M_PI-with-musl-libc.patch deleted file mode 100644 index d71cd57445..0000000000 --- a/package/dieharder/0003-Add-_GNU_SOURCE-for-uint-and-M_PI-with-musl-libc.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 526510a27ef47a16699dd34a2373ad9b6bb5e8f3 Mon Sep 17 00:00:00 2001 -From: Julien Viard de Galbert <julien@vdg.name> -Date: Sat, 14 Jan 2017 14:19:47 +0100 -Subject: [PATCH] Add _GNU_SOURCE for uint and M_PI with musl libc - -When building with musl libc _GNU_SOURCE need to be defined -to provide uint type and M_PI macro - -Signed-off-by: Julien Viard de Galbert <julien@vdg.name> ---- - include/dieharder/libdieharder.h | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/include/dieharder/libdieharder.h b/include/dieharder/libdieharder.h -index d98b758..c1a5023 100644 ---- a/include/dieharder/libdieharder.h -+++ b/include/dieharder/libdieharder.h -@@ -17,6 +17,7 @@ - - /* This turns on uint macro in c99 */ - #define __USE_MISC 1 -+#define _GNU_SOURCE 1 - #include <stdint.h> - #include <sys/types.h> - #include <sys/stat.h> --- -2.1.4 - diff --git a/package/dieharder/0004-Add-static-to-inline-functions.patch b/package/dieharder/0003-Add-static-to-inline-functions.patch similarity index 100% rename from package/dieharder/0004-Add-static-to-inline-functions.patch rename to package/dieharder/0003-Add-static-to-inline-functions.patch diff --git a/package/dieharder/0005-Remove-defunct-rgb_operm.patch b/package/dieharder/0004-Remove-defunct-rgb_operm.patch similarity index 100% rename from package/dieharder/0005-Remove-defunct-rgb_operm.patch rename to package/dieharder/0004-Remove-defunct-rgb_operm.patch diff --git a/package/dieharder/dieharder.mk b/package/dieharder/dieharder.mk index cbf28922fd..e15bac6bbe 100644 --- a/package/dieharder/dieharder.mk +++ b/package/dieharder/dieharder.mk @@ -36,9 +36,13 @@ endif # parallel build fail, disable it DIEHARDER_MAKE = $(MAKE1) +DIEHARDER_CFLAGS = $(TARGET_CFLAGS) -D_GNU_SOURCE + # Too many fixes needed to build with -fno-common which is default since gcc 10 ifeq ($(BR2_TOOLCHAIN_GCC_AT_LEAST_10),y) -DIEHARDER_CONF_ENV += CFLAGS="$(TARGET_CFLAGS) -fcommon" +DIEHARDER_CFLAGS += -fcommon endif +DIEHARDER_CONF_ENV += CFLAGS="$(DIEHARDER_CFLAGS)" + $(eval $(autotools-package))
Drop third patch and pass _GNU_SOURCE in CFLAGS to avoid the following build failure: In file included from /nvmedata/autobuild/instance-18/output-1/host/microblazeel-buildroot-linux-gnu/sysroot/usr/include/bits/stat.h:25, from /nvmedata/autobuild/instance-18/output-1/host/microblazeel-buildroot-linux-gnu/sysroot/usr/include/sys/stat.h:101, from ../include/dieharder/libdieharder.h:23, from bits.c:7: /nvmedata/autobuild/instance-18/output-1/host/microblazeel-buildroot-linux-gnu/sysroot/usr/include/bits/struct_stat.h:99:33: error: field 'st_atim' has incomplete type 99 | struct timespec st_atim; /* Time of last access. */ | ^~~~~~~ Fixes: - http://autobuild.buildroot.org/results/4609c8e2af24d9536eb33397a4659ad740aca742 Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com> --- ...RCE-for-uint-and-M_PI-with-musl-libc.patch | 28 ------------------- ...0003-Add-static-to-inline-functions.patch} | 0 ...ch => 0004-Remove-defunct-rgb_operm.patch} | 0 package/dieharder/dieharder.mk | 6 +++- 4 files changed, 5 insertions(+), 29 deletions(-) delete mode 100644 package/dieharder/0003-Add-_GNU_SOURCE-for-uint-and-M_PI-with-musl-libc.patch rename package/dieharder/{0004-Add-static-to-inline-functions.patch => 0003-Add-static-to-inline-functions.patch} (100%) rename package/dieharder/{0005-Remove-defunct-rgb_operm.patch => 0004-Remove-defunct-rgb_operm.patch} (100%)