From patchwork Tue Jul 28 12:42:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabrice Fontaine X-Patchwork-Id: 1337799 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=140.211.166.133; helo=hemlock.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=iLpcgVK9; dkim-atps=neutral Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BGGYF11Tpz9sT6 for ; Tue, 28 Jul 2020 22:42:57 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 5D55C87E68; Tue, 28 Jul 2020 12:42:55 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id BAvck4rbFVuH; Tue, 28 Jul 2020 12:42:54 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 7539787E5F; Tue, 28 Jul 2020 12:42:54 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id 4A1761BF3BA for ; Tue, 28 Jul 2020 12:42:53 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 4051924214 for ; Tue, 28 Jul 2020 12:42:53 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id EYyCUrBrnXDx for ; Tue, 28 Jul 2020 12:42:52 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wm1-f66.google.com (mail-wm1-f66.google.com [209.85.128.66]) by silver.osuosl.org (Postfix) with ESMTPS id 0DC8C22F26 for ; Tue, 28 Jul 2020 12:42:52 +0000 (UTC) Received: by mail-wm1-f66.google.com with SMTP id f18so18061915wml.3 for ; Tue, 28 Jul 2020 05:42:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=16BlGuQv4pghtE0d3Dxk3lmvs+Djo0VqaiWmSow4WLs=; b=iLpcgVK99tm+BvEB+ieT8G0JTurT9c150WmQQ7cMCSgxUCFHEjDX9PRfixCjqRsZJ/ MWKDzC+qqREI4+6zXd1FK3KXTgPpKHtt8rvDPOuHDGvDRigsM1zDt+bA/LXilrvBsF4K 11zf2dhPGIL2AHEKPcH8/LeqLVS2imXUsYH3tEwQWoKLAObsKdEGY5naETzaghDFv7lC DgebY8WRfL59YqzanxBqSQc9wChMxTJQ5gA8HAiZYmwHUgEGwx9uFNg85QsgHB6gcXay DcfCjvHmDqel685WlChtvlIjaoNgzBd+zt1OH+LqBL8nFo7Y3/5w/vjD+OUvZewnJ0U7 aLTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=16BlGuQv4pghtE0d3Dxk3lmvs+Djo0VqaiWmSow4WLs=; b=kmIfYL15NWTWJe46kNV6Zd/OKc2/NPqQHDgEcAe7IQ/REykCXTadw/NYv4T/eVKens bhVHEoGHkeHCiRPZB++HXhiES3gTy4l9PWqaukfSo3IOMbaVI6jAaguiH0IrJxncV8Fi WURvnfoh0MxckzPEHy3EnEgASIy2W5GwqNGC7MHeKyupnRFn24rGpYzqg8lq1i6ufJIg oT/HvHyRFsBgc4ju0bYq0rAj6+zMBWGtLS4QRu/lKBMnJC0TLuP+CQr33cOiZysgANAz gVgby6HjrMxrPDthjg0nIRU24uBRb7mVu4s91BoF3V36Xu30/MXYsCw13jTw0RM/TkEo pYiA== X-Gm-Message-State: AOAM533tXxOL40xale7Tnr1X3E5DGJXG0yZGGVIIbo3CMYf/Tf63Urpg P3NGuhyA2fDTPfpePb0RFzAix6f0 X-Google-Smtp-Source: ABdhPJwBUj/h5GMP3ni8+bAncE1g77ZeckoVXilvQF6PvODZlVGdC+uGaarp8GZjR/g41u8d36KdHQ== X-Received: by 2002:a1c:4b0d:: with SMTP id y13mr3836796wma.6.1595940170136; Tue, 28 Jul 2020 05:42:50 -0700 (PDT) Received: from kali.home (2a01cb0881b76d00c2afd0dfa851d2b9.ipv6.abo.wanadoo.fr. [2a01:cb08:81b7:6d00:c2af:d0df:a851:d2b9]) by smtp.gmail.com with ESMTPSA id k4sm18473407wrd.72.2020.07.28.05.42.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Jul 2020 05:42:49 -0700 (PDT) From: Fabrice Fontaine To: buildroot@buildroot.org Date: Tue, 28 Jul 2020 14:42:38 +0200 Message-Id: <20200728124238.2824679-1-fontaine.fabrice@gmail.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Subject: [Buildroot] [PATCH 1/1] package/lxc: fix build when __NR_signalfd is not available X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Fabrice Fontaine , =?utf-8?b?SsOpcsO0bWUg?= =?utf-8?b?UG91aWxsZXI=?= Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Fixes: - http://autobuild.buildroot.org/results/75096a48d2dbda57459523db3ed0952e63f93535 Signed-off-by: Fabrice Fontaine --- ...fail-if-__NR_signalfd-is-not-defined.patch | 54 +++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 package/lxc/0001-syscall-don-t-fail-if-__NR_signalfd-is-not-defined.patch 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 +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 +[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; + }