From 140c00e44c089c3c2953aca2772f73161d414686 Mon Sep 17 00:00:00 2001 From: q66 Date: Thu, 6 Jan 2022 17:28:27 +0100 Subject: [PATCH] jsonnet: fix build on non-x86/arm architectures --- .../patches/fix-build-non-x86-arm.patch | 27 +++++++++++++++++++ srcpkgs/jsonnet/patches/fix-ppc-be.patch | 22 +++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 srcpkgs/jsonnet/patches/fix-build-non-x86-arm.patch create mode 100644 srcpkgs/jsonnet/patches/fix-ppc-be.patch diff --git a/srcpkgs/jsonnet/patches/fix-build-non-x86-arm.patch b/srcpkgs/jsonnet/patches/fix-build-non-x86-arm.patch new file mode 100644 index 00000000000..fc899d74a6d --- /dev/null +++ b/srcpkgs/jsonnet/patches/fix-build-non-x86-arm.patch @@ -0,0 +1,27 @@ +commit 9d1ebbeb750a790e0df045bf24ea2181a6ba3cf7 +Author: q66 +Date: Thu Jan 6 17:06:34 2022 +0100 + + error: 'trap_instruction' was not declared in this scope + +diff --git a/third_party/rapidyaml/rapidyaml/ext/c4core/src/c4/ext/debugbreak/debugbreak.h b/third_party/rapidyaml/rapidyaml/ext/c4core/src/c4/ext/debugbreak/debugbreak.h +index f570bf8..9c5fc2c 100644 +--- a/third_party/rapidyaml/rapidyaml/ext/c4core/src/c4/ext/debugbreak/debugbreak.h ++++ b/third_party/rapidyaml/rapidyaml/ext/c4core/src/c4/ext/debugbreak/debugbreak.h +@@ -102,13 +102,16 @@ __inline__ static void trap_instruction(void) + } + #else + enum { HAVE_TRAP_INSTRUCTION = 0, }; ++#define NO_TRAP_INSTRUCTION 1 + #endif + + __attribute__((gnu_inline, always_inline)) + __inline__ static void debug_break(void) + { + if (HAVE_TRAP_INSTRUCTION) { ++#ifndef NO_TRAP_INSTRUCTION + trap_instruction(); ++#endif + } else if (DEBUG_BREAK_PREFER_BUILTIN_TRAP_TO_SIGTRAP) { + /* raises SIGILL on Linux x86{,-64}, to continue in gdb: + * (gdb) handle SIGILL stop nopass diff --git a/srcpkgs/jsonnet/patches/fix-ppc-be.patch b/srcpkgs/jsonnet/patches/fix-ppc-be.patch new file mode 100644 index 00000000000..4ebbaddeadb --- /dev/null +++ b/srcpkgs/jsonnet/patches/fix-ppc-be.patch @@ -0,0 +1,22 @@ +--- a/third_party/rapidyaml/rapidyaml/ext/c4core/src/c4/ext/fast_float/include/fast_float/float_common.h ++++ b/third_party/rapidyaml/rapidyaml/ext/c4core/src/c4/ext/fast_float/include/fast_float/float_common.h +@@ -9,10 +9,12 @@ + || defined(__amd64) || defined(__aarch64__) || defined(_M_ARM64) \ + || defined(__MINGW64__) \ + || defined(__s390x__) \ ++ || defined(__powerpc64__) \ + || (defined(__ppc64__) || defined(__PPC64__) || defined(__ppc64le__) || defined(__PPC64LE__))) + #define FASTFLOAT_64BIT + #elif (defined(__i386) || defined(__i386__) || defined(_M_IX86) \ + || defined(__arm__) \ ++ || defined(__powerpc__) \ + || defined(__MINGW32__)) + #define FASTFLOAT_32BIT + #else +@@ -337,4 +339,4 @@ inline OStream& operator<<(OStream &out, const fast_float::decimal &d) { + return out; + } + +-#endif +\ No newline at end of file ++#endif