From: Jan Palus Date: Tue, 23 Aug 2022 11:18:59 +0000 (+0200) Subject: hack for mount.h conflict between linux and glibc headers X-Git-Tag: auto/th/collectd-5.9.2-8~1 X-Git-Url: http://git.pld-linux.org/?p=packages%2Fcollectd.git;a=commitdiff_plain;h=d85164410935e58bd31aa690321d7bbc60760363;hp=dc36bc31fc454488e2eb6627c0b7e106e820ab92 hack for mount.h conflict between linux and glibc headers glibc 2.36 introduced new symbols to that conflict with resulting in failure when both are included: In file included from /usr/include/linux/fs.h:19, from /usr/include/xfs/linux.h:36, from /usr/include/xfs/xfs.h:9, from /usr/include/xfs/xqm.h:9, from src/utils/mount/mount.c:34: /usr/include/linux/mount.h:95:6: error: redeclaration of 'enum fsconfig_command' 95 | enum fsconfig_command { | ^~~~~~~~~~~~~~~~ In file included from ./src/utils/mount/mount.h:57, from src/utils/mount/mount.c:31: /usr/include/sys/mount.h:189:6: note: originally defined here 189 | enum fsconfig_command | ^~~~~~~~~~~~~~~~ /usr/include/linux/mount.h:96:9: error: redeclaration of enumerator 'FSCONFIG_SET_FLAG' 96 | FSCONFIG_SET_FLAG = 0, /* Set parameter, supplying no value */ | ^~~~~~~~~~~~~~~~~ /usr/include/sys/mount.h:191:3: note: previous definition of 'FSCONFIG_SET_FLAG' with type 'enum fsconfig_command' 191 | FSCONFIG_SET_FLAG = 0, /* Set parameter, supplying no value */ | ^~~~~~~~~~~~~~~~~ ... since is included transitively try not to include if glibc >= 2.36 is detected. --- diff --git a/collectd.spec b/collectd.spec index 8a23d99..a84f905 100644 --- a/collectd.spec +++ b/collectd.spec @@ -202,6 +202,7 @@ Source5: %{name}-apache.conf Source10: %{name}-df.conf Source11: %{name}-rrdtool.conf Patch0: %{name}-collection.patch +Patch1: glibc-2.36.patch Patch2: noquote.patch URL: http://collectd.org/ %{?with_ipmi:BuildRequires: OpenIPMI-devel >= 2.0.14-3} @@ -1370,6 +1371,7 @@ Perl files from Collectd package %prep %setup -q %patch0 -p1 +%patch1 -p1 %patch2 -p1 %build diff --git a/glibc-2.36.patch b/glibc-2.36.patch new file mode 100644 index 0000000..17a3218 --- /dev/null +++ b/glibc-2.36.patch @@ -0,0 +1,14 @@ +--- collectd-5.9.2/src/utils/mount/mount.h.orig 2019-10-01 14:00:47.000000000 +0200 ++++ collectd-5.9.2/src/utils/mount/mount.h 2022-08-23 13:13:10.904711606 +0200 +@@ -54,7 +54,11 @@ + #include + #endif + #if HAVE_SYS_MOUNT_H ++#if !defined(__GLIBC__) || (__GLIBC__ < 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 36) + #include ++#else ++#include ++#endif + #endif + #if HAVE_SYS_STATFS_H + #include