From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id C65BD1382C5 for ; Thu, 10 Jun 2021 07:02:59 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 1FEE3E0893; Thu, 10 Jun 2021 07:02:59 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id E92A2E0893 for ; Thu, 10 Jun 2021 07:02:58 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id D1198340D67 for ; Thu, 10 Jun 2021 07:02:57 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 8B41779A for ; Thu, 10 Jun 2021 07:02:56 +0000 (UTC) From: "Sergei Trofimovich" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sergei Trofimovich" Message-ID: <1623308334.6012cc3584cfa18c6e37c2a1a56af08b04a9a5f6.slyfox@gentoo> Subject: [gentoo-commits] proj/pax-utils:master commit in: / X-VCS-Repository: proj/pax-utils X-VCS-Files: seccomp-bpf.c seccomp-bpf.h X-VCS-Directories: / X-VCS-Committer: slyfox X-VCS-Committer-Name: Sergei Trofimovich X-VCS-Revision: 6012cc3584cfa18c6e37c2a1a56af08b04a9a5f6 X-VCS-Branch: master Date: Thu, 10 Jun 2021 07:02:56 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 8e67d710-9e5d-48e2-a6ac-a7ae6b508d10 X-Archives-Hash: 40b33ed081bbbb4389ec957bf5ae4f17 commit: 6012cc3584cfa18c6e37c2a1a56af08b04a9a5f6 Author: Sergei Trofimovich gentoo org> AuthorDate: Thu Jun 10 06:58:54 2021 +0000 Commit: Sergei Trofimovich gentoo org> CommitDate: Thu Jun 10 06:58:54 2021 +0000 URL: https://gitweb.gentoo.org/proj/pax-utils.git/commit/?id=6012cc35 seccomp: fix build failure on mips (use _MIP_SIM tests) glibc's sysdeps/mips/sgidefs.h unconditionally mips _ABI* enum values: #define _ABIO32 1 #define _ABIN32 2 #define _ABI64 3 #define _ABIO64 4 This causes build failures on multiple definitions: In file included from security.c:9: seccomp-bpf.h:73:28: error: redefinition of 'seccomp_bpf_blks_base' 73 | static const unsigned char seccomp_bpf_blks_base[] = { | ^~~~~~~~~~~~~~~~~~~~~ The fix is to test current ABI against _MIPS_SIM. Fixed-by: Manuel Lauss Bug: https://bugs.gentoo.org/795075 Signed-off-by: Sergei Trofimovich gentoo.org> seccomp-bpf.c | 16 +++++++++------- seccomp-bpf.h | 16 +++++++++------- 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/seccomp-bpf.c b/seccomp-bpf.c index f69e5ce..8e61f7f 100644 --- a/seccomp-bpf.c +++ b/seccomp-bpf.c @@ -28,12 +28,12 @@ static const struct { #define A(arch, ifdef) { #arch, SCMP_ARCH_##arch, ifdef } A(AARCH64, "defined(__aarch64__)"), A(ARM, "defined(__arm__)"), - A(MIPS, "defined(__mips__) && defined(__MIPSEB__) && defined(_ABIO32)"), - A(MIPS64, "defined(__mips__) && defined(__MIPSEB__) && defined(_ABI64)"), - A(MIPS64N32, "defined(__mips__) && defined(__MIPSEB__) && defined(_ABIN32)"), - A(MIPSEL, "defined(__mips__) && defined(__MIPSEL__) && defined(_ABIO32)"), - A(MIPSEL64, "defined(__mips__) && defined(__MIPSEL__) && defined(_ABI64)"), - A(MIPSEL64N32, "defined(__mips__) && defined(__MIPSEL__) && defined(_ABIN32)"), + A(MIPS, "defined(__mips__) && defined(__MIPSEB__) && (_MIPS_SIM == _ABIO32)"), + A(MIPS64, "defined(__mips__) && defined(__MIPSEB__) && (_MIPS_SIM == _ABI64)"), + A(MIPS64N32, "defined(__mips__) && defined(__MIPSEB__) && (_MIPS_SIM == _ABIN32)"), + A(MIPSEL, "defined(__mips__) && defined(__MIPSEL__) && (_MIPS_SIM == _ABIO32)"), + A(MIPSEL64, "defined(__mips__) && defined(__MIPSEL__) && (_MIPS_SIM == _ABI64)"), + A(MIPSEL64N32, "defined(__mips__) && defined(__MIPSEL__) && (_MIPS_SIM == _ABIN32)"), A(PARISC, "defined(__hppa__) && !defined(__hppa64__)"), A(PARISC64, "defined(__hppa__) && defined(__hppa64__)"), A(PPC, "defined(__powerpc__) && !defined(__powerpc64__) && defined(__BIG_ENDIAN__)"), @@ -210,7 +210,9 @@ int main(void) if (!ctx) err(1, "seccomp_init failed"); - printf("/* AUTO GENERATED; see seccomp-bpf.c for details. */\n"); + printf("/* AUTO GENERATED FILE. To regenerate run:\n"); + printf("/* $ make seccomp-bpf.h\n"); + printf("/* See seccomp-bpf.c for details. */\n"); printf("#undef SECCOMP_BPF_AVAILABLE\n"); if (seccomp_arch_remove(ctx, seccomp_arch_native()) < 0) diff --git a/seccomp-bpf.h b/seccomp-bpf.h index 5966bd5..95f5bfb 100644 --- a/seccomp-bpf.h +++ b/seccomp-bpf.h @@ -1,4 +1,6 @@ -/* AUTO GENERATED; see seccomp-bpf.c for details. */ +/* AUTO GENERATED FILE. To regenerate run: +/* $ make seccomp-bpf.h +/* See seccomp-bpf.c for details. */ #undef SECCOMP_BPF_AVAILABLE #if defined(__aarch64__) @@ -23,7 +25,7 @@ static const unsigned char seccomp_bpf_blks_fork[] = { }; #endif -#if defined(__mips__) && defined(__MIPSEB__) && defined(_ABIO32) +#if defined(__mips__) && defined(__MIPSEB__) && (_MIPS_SIM == _ABIO32) /* MIPS */ #define SECCOMP_BPF_AVAILABLE static const unsigned char seccomp_bpf_blks_base[] = { @@ -34,7 +36,7 @@ static const unsigned char seccomp_bpf_blks_fork[] = { }; #endif -#if defined(__mips__) && defined(__MIPSEB__) && defined(_ABI64) +#if defined(__mips__) && defined(__MIPSEB__) && (_MIPS_SIM == _ABI64) /* MIPS64 */ #define SECCOMP_BPF_AVAILABLE static const unsigned char seccomp_bpf_blks_base[] = { @@ -45,7 +47,7 @@ static const unsigned char seccomp_bpf_blks_fork[] = { }; #endif -#if defined(__mips__) && defined(__MIPSEB__) && defined(_ABIN32) +#if defined(__mips__) && defined(__MIPSEB__) && (_MIPS_SIM == _ABIN32) /* MIPS64N32 */ #define SECCOMP_BPF_AVAILABLE static const unsigned char seccomp_bpf_blks_base[] = { @@ -56,7 +58,7 @@ static const unsigned char seccomp_bpf_blks_fork[] = { }; #endif -#if defined(__mips__) && defined(__MIPSEL__) && defined(_ABIO32) +#if defined(__mips__) && defined(__MIPSEL__) && (_MIPS_SIM == _ABIO32) /* MIPSEL */ #define SECCOMP_BPF_AVAILABLE static const unsigned char seccomp_bpf_blks_base[] = { @@ -67,7 +69,7 @@ static const unsigned char seccomp_bpf_blks_fork[] = { }; #endif -#if defined(__mips__) && defined(__MIPSEL__) && defined(_ABI64) +#if defined(__mips__) && defined(__MIPSEL__) && (_MIPS_SIM == _ABI64) /* MIPSEL64 */ #define SECCOMP_BPF_AVAILABLE static const unsigned char seccomp_bpf_blks_base[] = { @@ -78,7 +80,7 @@ static const unsigned char seccomp_bpf_blks_fork[] = { }; #endif -#if defined(__mips__) && defined(__MIPSEL__) && defined(_ABIN32) +#if defined(__mips__) && defined(__MIPSEL__) && (_MIPS_SIM == _ABIN32) /* MIPSEL64N32 */ #define SECCOMP_BPF_AVAILABLE static const unsigned char seccomp_bpf_blks_base[] = {