All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [git commit] package/lxc: fix build when __NR_signalfd is not available
@ 2020-08-05 21:18 Thomas Petazzoni
  0 siblings, 0 replies; only message in thread
From: Thomas Petazzoni @ 2020-08-05 21:18 UTC (permalink / raw)
  To: buildroot

commit: https://git.buildroot.net/buildroot/commit/?id=e6c428dcc51ec98a4897a45c8e8c7ea10bfe45f0
branch: https://git.buildroot.net/buildroot/commit/?id=refs/heads/master

Fixes:
 - http://autobuild.buildroot.org/results/75096a48d2dbda57459523db3ed0952e63f93535

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
---
 ...on-t-fail-if-__NR_signalfd-is-not-defined.patch | 54 ++++++++++++++++++++++
 1 file changed, 54 insertions(+)

diff --git a/package/lxc/0001-syscall-don-t-fail-if-__NR_signalfd-is-not-defined.patch b/package/lxc/0001-syscall-don-t-fail-if-__NR_signalfd-is-not-defined.patch
new file mode 100644
index 0000000000..c6e70e0a55
--- /dev/null
+++ b/package/lxc/0001-syscall-don-t-fail-if-__NR_signalfd-is-not-defined.patch
@@ -0,0 +1,54 @@
+From 3341e204dc1e1da6ecbc1ffbe59fca33f23ca557 Mon Sep 17 00:00:00 2001
+From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+Date: Tue, 28 Jul 2020 12:31:31 +0200
+Subject: [PATCH] syscall: don't fail if __NR_signalfd is not defined
+
+lxc fails to build if __NR_signalfd is not defined since version 4.0.0
+and
+https://github.com/lxc/lxc/commit/bed09c9cc0bec7bbd2442fcce4a2a0f03994cb09
+
+However, some architectures don't define __NR_signalfd but only
+__NR_signalfd4. This is the case for example for nios2 or csky:
+https://github.com/bminor/glibc/blob/f9ac84f92f151e07586c55e14ed628d493a5929d/sysdeps/unix/sysv/linux/nios2/arch-syscall.h
+https://github.com/bminor/glibc/blob/f9ac84f92f151e07586c55e14ed628d493a5929d/sysdeps/unix/sysv/linux/csky/arch-syscall.h
+
+Fixes:
+ - http://autobuild.buildroot.org/results/75096a48d2dbda57459523db3ed0952e63f93535
+
+Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+[Retrieved from:
+https://github.com/lxc/lxc/commit/3341e204dc1e1da6ecbc1ffbe59fca33f23ca557]
+---
+ src/lxc/syscall_numbers.h  | 3 ---
+ src/lxc/syscall_wrappers.h | 2 ++
+ 2 files changed, 2 insertions(+), 3 deletions(-)
+
+diff --git a/src/lxc/syscall_numbers.h b/src/lxc/syscall_numbers.h
+index e2e7883786..72e4ffe460 100644
+--- a/src/lxc/syscall_numbers.h
++++ b/src/lxc/syscall_numbers.h
+@@ -228,9 +228,6 @@
+ 		#if _MIPS_SIM == _MIPS_SIM_ABI64	/* n64 */
+ 			#define __NR_signalfd 5276
+ 		#endif
+-	#else
+-		#define -1
+-		#warning "__NR_signalfd not defined for your architecture"
+ 	#endif
+ #endif
+ 
+diff --git a/src/lxc/syscall_wrappers.h b/src/lxc/syscall_wrappers.h
+index 220ef65fde..6aaa437226 100644
+--- a/src/lxc/syscall_wrappers.h
++++ b/src/lxc/syscall_wrappers.h
+@@ -112,8 +112,10 @@ static inline int signalfd(int fd, const sigset_t *mask, int flags)
+ 	int retval;
+ 
+ 	retval = syscall(__NR_signalfd4, fd, mask, _NSIG / 8, flags);
++#ifdef __NR_signalfd
+ 	if (errno == ENOSYS && flags == 0)
+ 		retval = syscall(__NR_signalfd, fd, mask, _NSIG / 8);
++#endif
+ 
+ 	return retval;
+ }

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2020-08-05 21:18 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-05 21:18 [Buildroot] [git commit] package/lxc: fix build when __NR_signalfd is not available Thomas Petazzoni

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.