diff options
author | Sergei Trofimovich <slyfox@gentoo.org> | 2021-06-10 07:58:54 +0100 |
---|---|---|
committer | Sergei Trofimovich <slyfox@gentoo.org> | 2021-06-10 07:58:54 +0100 |
commit | 6012cc3584cfa18c6e37c2a1a56af08b04a9a5f6 (patch) | |
tree | 7d0352c46766ae10e8a29042c8b4ce9a981cc207 | |
parent | lddtree: respect (destination) root with --argv0 interp probing (diff) | |
download | pax-utils-6012cc3584cfa18c6e37c2a1a56af08b04a9a5f6.tar.gz pax-utils-6012cc3584cfa18c6e37c2a1a56af08b04a9a5f6.tar.bz2 pax-utils-6012cc3584cfa18c6e37c2a1a56af08b04a9a5f6.zip |
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 <slyfox@gentoo.org>
-rw-r--r-- | seccomp-bpf.c | 16 | ||||
-rw-r--r-- | 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[] = { |