From: Khem Raj Date: Wed, 27 Jul 2022 03:19:04 +0000 (-0400) Subject: systemd: Fix conflict between glibc mount.h and kernel mount.h X-Git-Tag: uninative-3.7~185 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=86a33f98a7c0d6f2c2b51d02ba9e01b63062cf98;p=thirdparty%2Fopenembedded%2Fopenembedded-core.git systemd: Fix conflict between glibc mount.h and kernel mount.h See glibc documentation [1] for details [1] https://sourceware.org/glibc/wiki/Release/2.36 Signed-off-by: Khem Raj Signed-off-by: Luca Ceresoli Signed-off-by: Richard Purdie --- diff --git a/meta/recipes-core/systemd/systemd/0001-glibc-Remove-include-linux-fs.h-to-resolve-fsconfig_.patch b/meta/recipes-core/systemd/systemd/0001-glibc-Remove-include-linux-fs.h-to-resolve-fsconfig_.patch new file mode 100644 index 00000000000..6222dfe60dd --- /dev/null +++ b/meta/recipes-core/systemd/systemd/0001-glibc-Remove-include-linux-fs.h-to-resolve-fsconfig_.patch @@ -0,0 +1,97 @@ +From b0933e76c6f0594c10cf8a9a70b34e15b68066d1 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 + +Upstream-Status: Backport [https://github.com/systemd/systemd/pull/23992/commits/21c03ad5e9d8d0350e30dae92a5e15da318a1539] +Signed-off-by: Khem Raj +--- + 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 9c170acc0a..a2e4d5054e 100644 +--- a/meson.build ++++ b/meson.build +@@ -481,7 +481,6 @@ decl_headers = ''' + #include + #include + #include +-#include + ''' + + foreach decl : ['char16_t', +@@ -493,6 +492,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 +@@ -508,6 +518,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 6c1de92a26..00591d6c2d 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 3256871803..2eafe43290 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 e76e4a0b38..0c8dec7688 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" +-- +2.25.1 + diff --git a/meta/recipes-core/systemd/systemd_251.3.bb b/meta/recipes-core/systemd/systemd_251.3.bb index 8497e24af97..72b9155f2e1 100644 --- a/meta/recipes-core/systemd/systemd_251.3.bb +++ b/meta/recipes-core/systemd/systemd_251.3.bb @@ -25,6 +25,7 @@ SRC_URI += " \ file://0001-binfmt-Don-t-install-dependency-links-at-install-tim.patch \ file://0003-implment-systemd-sysv-install-for-OE.patch \ file://0001-Move-sysusers.d-sysctl.d-binfmt.d-modules-load.d-to-.patch \ + file://0001-glibc-Remove-include-linux-fs.h-to-resolve-fsconfig_.patch \ " # patches needed by musl