From 75f6a43093e145b7e8197d47e3043ff43cb61672 Mon Sep 17 00:00:00 2001 From: Rudi Heitbaum Date: Tue, 12 Jul 2022 13:00:31 +0000 Subject: [PATCH] systemd: enable compile with glibc 2.36 --- .../systemd-0900-build-with-glibc-2.36.patch | 93 +++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 packages/sysutils/systemd/patches/systemd-0900-build-with-glibc-2.36.patch diff --git a/packages/sysutils/systemd/patches/systemd-0900-build-with-glibc-2.36.patch b/packages/sysutils/systemd/patches/systemd-0900-build-with-glibc-2.36.patch new file mode 100644 index 0000000000..752e4b5f3a --- /dev/null +++ b/packages/sysutils/systemd/patches/systemd-0900-build-with-glibc-2.36.patch @@ -0,0 +1,93 @@ +From 21c03ad5e9d8d0350e30dae92a5e15da318a1539 Mon Sep 17 00:00:00 2001 +From: Rudi Heitbaum +Date: Sat, 23 Jul 2022 10:38:49 +0000 +Subject: [PATCH] glibc: Remove #include to resolve + fsconfig_command/mount_attr conflict with glibc 2.36 + +--- + meson.build | 13 ++++++++++++- + src/basic/fd-util.c | 2 ++ + src/core/namespace.c | 2 ++ + src/shared/mount-util.c | 2 ++ + 4 files changed, 18 insertions(+), 1 deletion(-) + +diff --git a/meson.build b/meson.build +index 5d7c8699fe0d..88fe3f5d497e 100644 +--- a/meson.build ++++ b/meson.build +@@ -506,7 +506,6 @@ decl_headers = ''' + #include + #include + #include +-#include + ''' + + foreach decl : ['char16_t', +@@ -518,6 +517,17 @@ foreach decl : ['char16_t', + # We get -1 if the size cannot be determined + have = cc.sizeof(decl, prefix : decl_headers, args : '-D_GNU_SOURCE') > 0 + ++ if decl == 'struct mount_attr' ++ if have ++ want_linux_fs_h = false ++ else ++ have = cc.sizeof(decl, ++ prefix : decl_headers + '#include ', ++ args : '-D_GNU_SOURCE') > 0 ++ want_linux_fs_h = have ++ endif ++ endif ++ + if decl == 'struct statx' + if have + want_linux_stat_h = false +@@ -533,6 +543,7 @@ foreach decl : ['char16_t', + endforeach + + conf.set10('WANT_LINUX_STAT_H', want_linux_stat_h) ++conf.set10('WANT_LINUX_FS_H', want_linux_fs_h) + + foreach ident : ['secure_getenv', '__secure_getenv'] + conf.set10('HAVE_' + ident.to_upper(), cc.has_function(ident)) +diff --git a/src/basic/fd-util.c b/src/basic/fd-util.c +index 6c1de92a26ca..00591d6c2d31 100644 +--- a/src/basic/fd-util.c ++++ b/src/basic/fd-util.c +@@ -3,7 +3,9 @@ + #include + #include + #include ++#if WANT_LINUX_FS_H + #include ++#endif + #include + #include + #include +diff --git a/src/core/namespace.c b/src/core/namespace.c +index 41457ea81647..016afe4d9e90 100644 +--- a/src/core/namespace.c ++++ b/src/core/namespace.c +@@ -7,7 +7,9 @@ + #include + #include + #include ++#if WANT_LINUX_FS_H + #include ++#endif + + #include "alloc-util.h" + #include "base-filesystem.h" +diff --git a/src/shared/mount-util.c b/src/shared/mount-util.c +index 8cf16affcb8f..a119a7c3c1b2 100644 +--- a/src/shared/mount-util.c ++++ b/src/shared/mount-util.c +@@ -7,7 +7,9 @@ + #include + #include + #include ++#if WANT_LINUX_FS_H + #include ++#endif + + #include "alloc-util.h" + #include "chase-symlinks.h"