runc/0001-cloned_binary-switch-from-error-to-warning-for-SYS_m.patch
Aleksa Sarai 88d4373f4e 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
2021-04-26 08:00:58 +00:00

39 lines
1.5 KiB
Diff

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