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 /seccomp-bpf.c | |
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>
Diffstat (limited to 'seccomp-bpf.c')
-rw-r--r-- | seccomp-bpf.c | 16 |
1 files changed, 9 insertions, 7 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) |