From 88d4373f4e1e143535bf72025b6dee6d0836f0f5e0b5b12692034b8f712b3a8d Mon Sep 17 00:00:00 2001 From: Aleksa Sarai Date: Mon, 26 Apr 2021 08:00:58 +0000 Subject: [PATCH] Accepting request 888384 from home:cyphar:docker - Backport patch to fix build on SLE-12 ppc64le. + 0001-cloned_binary-switch-from-error-to-warning-for-SYS_m.patch OBS-URL: https://build.opensuse.org/request/show/888384 OBS-URL: https://build.opensuse.org/package/show/Virtualization:containers/runc?expand=0&rev=107 --- ...itch-from-error-to-warning-for-SYS_m.patch | 38 +++++++++++++++++++ runc.changes | 6 +++ runc.spec | 6 +++ 3 files changed, 50 insertions(+) create mode 100644 0001-cloned_binary-switch-from-error-to-warning-for-SYS_m.patch diff --git a/0001-cloned_binary-switch-from-error-to-warning-for-SYS_m.patch b/0001-cloned_binary-switch-from-error-to-warning-for-SYS_m.patch new file mode 100644 index 0000000..ffda869 --- /dev/null +++ b/0001-cloned_binary-switch-from-error-to-warning-for-SYS_m.patch @@ -0,0 +1,38 @@ +From dd7444d3bba4ae2e461b41026f5f37416d7ee158 Mon Sep 17 00:00:00 2001 +From: Aleksa Sarai +Date: Mon, 26 Apr 2021 17:41:29 +1000 +Subject: [PATCH] cloned_binary: switch from #error to #warning for + SYS_memfd_create hardcode + +We shouldn't refuse to build on architectures just because we don't know +what the syscall number of memfd_create(2) is. In addition, use the +correct defined(...) macros for ppc64 (these are the ones glibc uses). + +Fixes: 3aead32ea246 ("nsenter: hard-code memfd_create(2) syscall numbers") +Signed-off-by: Aleksa Sarai +--- + libcontainer/nsenter/cloned_binary.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/libcontainer/nsenter/cloned_binary.c b/libcontainer/nsenter/cloned_binary.c +index 2667cd65c293..b78000fec317 100644 +--- a/libcontainer/nsenter/cloned_binary.c ++++ b/libcontainer/nsenter/cloned_binary.c +@@ -75,12 +75,12 @@ + # define SYS_memfd_create 385 + # elif defined(__aarch64__) // arm64 + # define SYS_memfd_create 279 +-# elif defined(__ppc__) || defined(__ppc64__) // ppc + ppc64 ++# elif defined(__ppc__) || defined(__PPC64__) || defined(__powerpc64__) // ppc + ppc64 + # define SYS_memfd_create 360 + # elif defined(__s390__) || defined(__s390x__) // s390(x) + # define SYS_memfd_create 350 + # else +-# error "unknown architecture -- cannot hard-code SYS_memfd_create" ++# warning "unknown architecture -- cannot hard-code SYS_memfd_create" + # endif + # endif + #endif +-- +2.31.1 + diff --git a/runc.changes b/runc.changes index b4c86f9..8143a05 100644 --- a/runc.changes +++ b/runc.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Mon Apr 26 07:54:54 UTC 2021 - Aleksa Sarai + +- Backport patch to fix build on SLE-12 ppc64le. + + 0001-cloned_binary-switch-from-error-to-warning-for-SYS_m.patch + ------------------------------------------------------------------- Wed Feb 3 04:09:17 UTC 2021 - Aleksa Sarai diff --git a/runc.spec b/runc.spec index 178326f..a10db92 100644 --- a/runc.spec +++ b/runc.spec @@ -36,6 +36,10 @@ Source0: https://github.com/opencontainers/runc/releases/download/v%{_ver Source1: https://github.com/opencontainers/runc/releases/download/v%{_version}/runc.tar.xz.asc#/runc-%{_version}.tar.xz.asc Source2: runc.keyring Source3: runc-rpmlintrc +# SUSE-FIX: SLE-12 has too old a glibc for memfd_create(2) and __ppc64__ +# doesn't appear to match ppc64le for some reason. This is a backport +# of . +Patch1: 0001-cloned_binary-switch-from-error-to-warning-for-SYS_m.patch BuildRequires: fdupes BuildRequires: go-go-md2man # Due to a limitation in openSUSE's Go packaging we cannot have a BuildRequires @@ -69,6 +73,8 @@ and has grown to become a separate project entirely. %prep %setup -q -n %{name}-%{_version} +# fix build on SLE-12 ppc64le +%patch1 -p1 %build # build runc