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
This commit is contained in:
Aleksa Sarai 2021-04-26 08:00:58 +00:00 committed by Git OBS Bridge
parent 0146fb1293
commit 88d4373f4e
3 changed files with 50 additions and 0 deletions

View File

@ -0,0 +1,38 @@
From dd7444d3bba4ae2e461b41026f5f37416d7ee158 Mon Sep 17 00:00:00 2001
From: Aleksa Sarai <asarai@suse.de>
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 <asarai@suse.de>
---
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

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Mon Apr 26 07:54:54 UTC 2021 - Aleksa Sarai <asarai@suse.com>
- 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 <asarai@suse.com>

View File

@ -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 <https://github.com/opencontainers/runc/pull/2919>.
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