From eaf409c2ea37d17e2b4fb64c84a8573ff82e9190 Mon Sep 17 00:00:00 2001 From: jca Date: Wed, 15 Jan 2020 14:30:50 +0000 Subject: [PATCH] Unbreak non-amd64: check __LP64__ to detect 64 bits host OS This fixes pointer truncation on sparc64 and probably mips64. Bump REVISION since quickjs previously built on arm64 but with different bignum sizing. ok cwen@ bcallah@ (maintainer) --- lang/quickjs/Makefile | 3 ++- lang/quickjs/patches/patch-libbf_h | 16 ++++++++++++++++ lang/quickjs/patches/patch-quickjs_h | 16 ++++++++++++++++ 3 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 lang/quickjs/patches/patch-libbf_h create mode 100644 lang/quickjs/patches/patch-quickjs_h diff --git a/lang/quickjs/Makefile b/lang/quickjs/Makefile index 4db80016fba..6ce545da5b6 100644 --- a/lang/quickjs/Makefile +++ b/lang/quickjs/Makefile @@ -1,8 +1,9 @@ -# $OpenBSD: Makefile,v 1.3 2020/01/15 14:24:23 jca Exp $ +# $OpenBSD: Makefile,v 1.4 2020/01/15 14:30:50 jca Exp $ COMMENT = small, embeddable JavaScript engine in C V = 2019.10.27 +REVISION = 0 DISTNAME = quickjs-${V:S/./-/g} PKGNAME = quickjs-${V} diff --git a/lang/quickjs/patches/patch-libbf_h b/lang/quickjs/patches/patch-libbf_h new file mode 100644 index 00000000000..d37e9f9bb65 --- /dev/null +++ b/lang/quickjs/patches/patch-libbf_h @@ -0,0 +1,16 @@ +$OpenBSD: patch-libbf_h,v 1.1 2020/01/15 14:30:50 jca Exp $ + +Use more generic test for 64 bits platform. + +Index: libbf.h +--- libbf.h.orig ++++ libbf.h +@@ -27,7 +27,7 @@ + #include + #include + +-#if defined(__x86_64__) ++#if defined(__LP64__) + #define LIMB_LOG2_BITS 6 + #else + #define LIMB_LOG2_BITS 5 diff --git a/lang/quickjs/patches/patch-quickjs_h b/lang/quickjs/patches/patch-quickjs_h new file mode 100644 index 00000000000..6e70091ea9e --- /dev/null +++ b/lang/quickjs/patches/patch-quickjs_h @@ -0,0 +1,16 @@ +$OpenBSD: patch-quickjs_h,v 1.1 2020/01/15 14:30:50 jca Exp $ + +Use more generic test for 64 bits platform. + +Index: quickjs.h +--- quickjs.h.orig ++++ quickjs.h +@@ -53,7 +53,7 @@ typedef struct JSClass JSClass; + typedef uint32_t JSClassID; + typedef uint32_t JSAtom; + +-#if defined(__x86_64__) || defined(__aarch64__) ++#if defined(__LP64__) + #define JS_PTR64 + #define JS_PTR64_DEF(a) a + #else