From 3d36d652932a64e056caedf9ed163315e4d58cfb Mon Sep 17 00:00:00 2001 From: CvH Date: Tue, 8 May 2018 22:38:55 +0200 Subject: [PATCH] systemd: add patches to fix 3.14 aml --- .../systemd-0100-fix-glibc-2.27-build.patch | 32 -------------- ...faults-in-libc-after-mounting-cgroup.patch | 42 +++++++++++++++++++ ...emd-0202-fix-_nr_statx-buildspam-aml.patch | 38 +++++++++++++++++ 3 files changed, 80 insertions(+), 32 deletions(-) delete mode 100644 packages/sysutils/systemd/patches/systemd-0100-fix-glibc-2.27-build.patch create mode 100644 packages/sysutils/systemd/patches/systemd-0201-fix-segfaults-in-libc-after-mounting-cgroup.patch create mode 100644 packages/sysutils/systemd/patches/systemd-0202-fix-_nr_statx-buildspam-aml.patch diff --git a/packages/sysutils/systemd/patches/systemd-0100-fix-glibc-2.27-build.patch b/packages/sysutils/systemd/patches/systemd-0100-fix-glibc-2.27-build.patch deleted file mode 100644 index 3767f742e3..0000000000 --- a/packages/sysutils/systemd/patches/systemd-0100-fix-glibc-2.27-build.patch +++ /dev/null @@ -1,32 +0,0 @@ -From a2a46bc87819ed5fcb06275f1dcba5a9043ef5cd Mon Sep 17 00:00:00 2001 -From: MilhouseVH -Date: Sun, 4 Feb 2018 07:42:40 +0000 -Subject: [PATCH] force enable HAVE_MEMFD_CREATE when building with glibc-2.27+ - -I'm not sure why, but when building with kernel 3.14.y (which does not -have the memfd_create syscall - added in 3.17.0), meson will fail to -determine that the memfd_create syscall is now implemented by glibc-2.27+ -causing systemd to redefine it, resulting in a build failure. - -Since we know thst the syscall is provided by glibc-2.27 this change should be -safe (but ugly). Only required for older kernels as meson correctly enables -this option with default kernels (eg. 4.14.16), and forcing it does no harm. ---- - meson.build | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/meson.build b/meson.build -index 36a62d2..4f56ccb 100644 ---- a/meson.build -+++ b/meson.build -@@ -515,6 +515,7 @@ foreach ident : [ - have = cc.has_function(ident[0], prefix : ident[1], args : '-D_GNU_SOURCE') - conf.set10('HAVE_' + ident[0].to_upper(), have) - endforeach -+conf.set10('HAVE_MEMFD_CREATE', true) - - if cc.has_function('getrandom', prefix : '''#include ''', args : '-D_GNU_SOURCE') - conf.set10('USE_SYS_RANDOM_H', true) --- -2.14.1 - diff --git a/packages/sysutils/systemd/patches/systemd-0201-fix-segfaults-in-libc-after-mounting-cgroup.patch b/packages/sysutils/systemd/patches/systemd-0201-fix-segfaults-in-libc-after-mounting-cgroup.patch new file mode 100644 index 0000000000..23ef68dbda --- /dev/null +++ b/packages/sysutils/systemd/patches/systemd-0201-fix-segfaults-in-libc-after-mounting-cgroup.patch @@ -0,0 +1,42 @@ +https://github.com/systemd/systemd/pull/8391 +From 3b3a93045c3e35b45e410d765eaad78300104cec Mon Sep 17 00:00:00 2001 +From: Yu Watanabe +Date: Thu, 8 Mar 2018 15:22:59 +0900 +Subject: [PATCH] core: do not free heap-allocated strings + +Fixes #8387. +--- + src/core/mount-setup.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/src/core/mount-setup.c b/src/core/mount-setup.c +index 536c17b4d56..9c27972aff5 100644 +--- a/src/core/mount-setup.c ++++ b/src/core/mount-setup.c +@@ -248,6 +248,7 @@ int mount_setup_early(void) { + + int mount_cgroup_controllers(char ***join_controllers) { + _cleanup_set_free_free_ Set *controllers = NULL; ++ bool has_argument = !!join_controllers; + int r; + + if (!cg_is_legacy_wanted()) +@@ -255,7 +256,7 @@ int mount_cgroup_controllers(char ***join_controllers) { + + /* Mount all available cgroup controllers that are built into the kernel. */ + +- if (!join_controllers) ++ if (!has_argument) + /* The defaults: + * mount "cpu" + "cpuacct" together, and "net_cls" + "net_prio". + * +@@ -300,7 +301,8 @@ int mount_cgroup_controllers(char ***join_controllers) { + + t = set_remove(controllers, *i); + if (!t) { +- free(*i); ++ if (has_argument) ++ free(*i); + continue; + } + } diff --git a/packages/sysutils/systemd/patches/systemd-0202-fix-_nr_statx-buildspam-aml.patch b/packages/sysutils/systemd/patches/systemd-0202-fix-_nr_statx-buildspam-aml.patch new file mode 100644 index 0000000000..5e006df38b --- /dev/null +++ b/packages/sysutils/systemd/patches/systemd-0202-fix-_nr_statx-buildspam-aml.patch @@ -0,0 +1,38 @@ +https://github.com/systemd/systemd/pull/8872 +From 773c84349d80c7a6f818f5909a160ddb7337987f Mon Sep 17 00:00:00 2001 +From: Adam Duskett +Date: Wed, 2 May 2018 04:04:50 -0400 +Subject: [PATCH] add __nr_statx defines for extra architectures (#8872) + +This includes: + - arm + - arm64 + - alpha + - powerpc64 + - sparc + +Taken from kernel 4.16.6 +--- + src/basic/missing_syscall.h | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +diff --git a/src/basic/missing_syscall.h b/src/basic/missing_syscall.h +index 2948f789b51..42ada30d524 100644 +--- a/src/basic/missing_syscall.h ++++ b/src/basic/missing_syscall.h +@@ -403,8 +403,14 @@ static inline int missing_bpf(int cmd, union bpf_attr *attr, size_t size) { + + #if !HAVE_STATX + # ifndef __NR_statx +-# if defined __i386__ ++# if defined __aarch64__ || defined __arm__ ++# define __NR_statx 397 ++# elif defined __alpha__ ++# define __NR_statx 522 ++# elif defined __i386__ || defined __powerpc64__ + # define __NR_statx 383 ++# elif defined __sparc__ ++# define __NR_statx 360 + # elif defined __x86_64__ + # define __NR_statx 332 + # else