sdbus-c++-libsystemd: Upgrade to 250.9 systemd release

Fix build with latest musl
Drop upstreamed patches

Signed-off-by: Khem Raj <raj.khem@gmail.com>
This commit is contained in:
Khem Raj 2022-12-20 20:14:27 -08:00
parent 562413e686
commit e661eb0b3b
4 changed files with 40 additions and 127 deletions

View File

@ -0,0 +1,38 @@
From 19cc68d4a89b59889be442d2997ff030cdc3de73 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Tue, 20 Dec 2022 20:11:17 -0800
Subject: [PATCH] dirent-util: Remove asserts on dirent64 == dirent
We already have assert_cc(_FILE_OFFSET_BITS == 64) which ensures that 64bit LFS functions are same as their original counterparts
Upstream-Status: Submitted [https://github.com/systemd/systemd/pull/25809]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
src/basic/dirent-util.h | 11 -----------
1 file changed, 11 deletions(-)
diff --git a/src/basic/dirent-util.h b/src/basic/dirent-util.h
index 04bc53003f..4cb317184d 100644
--- a/src/basic/dirent-util.h
+++ b/src/basic/dirent-util.h
@@ -35,17 +35,6 @@ struct dirent *readdir_no_dot(DIR *dirp);
/* Only if 64bit off_t is enabled struct dirent + struct dirent64 are actually the same. We require this, and
* we want them to be interchangeable to make getdents64() work, hence verify that. */
assert_cc(_FILE_OFFSET_BITS == 64);
-assert_cc(sizeof(struct dirent) == sizeof(struct dirent64));
-assert_cc(offsetof(struct dirent, d_ino) == offsetof(struct dirent64, d_ino));
-assert_cc(sizeof_field(struct dirent, d_ino) == sizeof_field(struct dirent64, d_ino));
-assert_cc(offsetof(struct dirent, d_off) == offsetof(struct dirent64, d_off));
-assert_cc(sizeof_field(struct dirent, d_off) == sizeof_field(struct dirent64, d_off));
-assert_cc(offsetof(struct dirent, d_reclen) == offsetof(struct dirent64, d_reclen));
-assert_cc(sizeof_field(struct dirent, d_reclen) == sizeof_field(struct dirent64, d_reclen));
-assert_cc(offsetof(struct dirent, d_type) == offsetof(struct dirent64, d_type));
-assert_cc(sizeof_field(struct dirent, d_type) == sizeof_field(struct dirent64, d_type));
-assert_cc(offsetof(struct dirent, d_name) == offsetof(struct dirent64, d_name));
-assert_cc(sizeof_field(struct dirent, d_name) == sizeof_field(struct dirent64, d_name));
#define FOREACH_DIRENT_IN_BUFFER(de, buf, sz) \
for (void *_end = (uint8_t*) ({ (de) = (buf); }) + (sz); \
--
2.39.0

View File

@ -1,74 +0,0 @@
From b0933e76c6f0594c10cf8a9a70b34e15b68066d1 Mon Sep 17 00:00:00 2001
From: Rudi Heitbaum <rudi@heitbaum.com>
Date: Sat, 23 Jul 2022 10:38:49 +0000
Subject: [PATCH] glibc: Remove #include <linux/fs.h> 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 <raj.khem@gmail.com>
---
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(-)
--- a/meson.build
+++ b/meson.build
@@ -474,7 +474,6 @@ decl_headers = '''
#include <uchar.h>
#include <sys/mount.h>
#include <sys/stat.h>
-#include <linux/fs.h>
'''
foreach decl : ['char16_t',
@@ -486,6 +485,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 <linux/fs.h>',
+ args : '-D_GNU_SOURCE') > 0
+ want_linux_fs_h = have
+ endif
+ endif
+
if decl == 'struct statx'
if have
want_linux_stat_h = false
@@ -501,6 +511,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))
--- a/src/core/namespace.c
+++ b/src/core/namespace.c
@@ -6,7 +6,9 @@
#include <stdio.h>
#include <sys/mount.h>
#include <unistd.h>
+#if WANT_LINUX_FS_H
#include <linux/fs.h>
+#endif
#include "alloc-util.h"
#include "base-filesystem.h"
--- a/src/shared/mount-util.c
+++ b/src/shared/mount-util.c
@@ -7,7 +7,9 @@
#include <sys/statvfs.h>
#include <unistd.h>
#include <linux/loop.h>
+#if WANT_LINUX_FS_H
#include <linux/fs.h>
+#endif
#include "alloc-util.h"
#include "chase-symlinks.h"

View File

@ -1,50 +0,0 @@
From fbc10748c7c59d82024a4d35146b8dfef8d52927 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Fri, 21 Jan 2022 15:15:11 -0800
Subject: [PATCH 1/2] pass correct parameters to getdents64
Fixes
../git/src/basic/recurse-dir.c:57:40: error: incompatible pointer types passing 'uint8_t *' (aka 'unsigned char *') to parameter of type 'struct dirent *' [-Werror,-Wincompatible-pointer-types]
n = getdents64(dir_fd, (uint8_t*) de->buffer + de->buffer_size, bs - de->buffer_size);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../git/src/basic/stat-util.c:102:28: error: incompatible pointer types passing 'union (unnamed union at ../git/src/basic/stat-util.c:78:9) *' to parameter of type 'struct dirent *' [-Werror,-Wincompatible-pointer-types]
n = getdents64(fd, &buffer, sizeof(buffer));
^~~~~~~
Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
src/basic/recurse-dir.c | 2 +-
src/basic/stat-util.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/basic/recurse-dir.c b/src/basic/recurse-dir.c
index efa1797b7b..797285e3be 100644
--- a/src/basic/recurse-dir.c
+++ b/src/basic/recurse-dir.c
@@ -54,7 +54,7 @@ int readdir_all(int dir_fd,
bs = MIN(MALLOC_SIZEOF_SAFE(de) - offsetof(DirectoryEntries, buffer), (size_t) SSIZE_MAX);
assert(bs > de->buffer_size);
- n = getdents64(dir_fd, (uint8_t*) de->buffer + de->buffer_size, bs - de->buffer_size);
+ n = getdents64(dir_fd, de->buffer + de->buffer_size, bs - de->buffer_size);
if (n < 0)
return -errno;
if (n == 0)
diff --git a/src/basic/stat-util.c b/src/basic/stat-util.c
index efac7b002e..9e1fe7f5a0 100644
--- a/src/basic/stat-util.c
+++ b/src/basic/stat-util.c
@@ -99,7 +99,7 @@ int dir_is_empty_at(int dir_fd, const char *path) {
return fd;
}
- n = getdents64(fd, &buffer, sizeof(buffer));
+ n = getdents64(fd, (struct dirent *)&buffer, sizeof(buffer));
if (n < 0)
return -errno;
--
2.34.1

View File

@ -10,11 +10,11 @@ inherit meson pkgconfig
DEPENDS += "gperf-native gettext-native util-linux libcap util-linux python3-jinja2-native"
SRCREV = "73be9643910c3f7f3ff84765d63060846c110016"
SRCREV = "1d5e0e9910500f3c3584485f77bfc35e601036e3"
SRCBRANCH = "v250-stable"
SRC_URI = "git://github.com/systemd/systemd-stable.git;protocol=https;branch=${SRCBRANCH} \
file://static-libsystemd-pkgconfig.patch \
file://0001-glibc-Remove-include-linux-fs.h-to-resolve-fsconfig_.patch \
file://0001-dirent-util-Remove-asserts-on-dirent64-dirent.patch \
"
# patches needed by musl
@ -44,7 +44,6 @@ SRC_URI_MUSL = "\
file://0025-Handle-__cpu_mask-usage.patch \
file://0026-Handle-missing-gshadow.patch \
file://0028-missing_syscall.h-Define-MIPS-ABI-defines-for-musl.patch \
file://0001-pass-correct-parameters-to-getdents64.patch \
file://0002-Add-sys-stat.h-for-S_IFDIR.patch \
file://0001-Adjust-for-musl-headers.patch \
"