Update to quickjs-2020.09.06

A full changelog is here: https://bellard.org/quickjs/Changelog
From gkoehler@, who also tested it on macppc and powerpc64!
This commit is contained in:
bcallah 2020-09-23 15:37:32 +00:00
parent 27714f2c95
commit 5c327e456f
11 changed files with 75 additions and 52 deletions

View File

@ -1,9 +1,8 @@
# $OpenBSD: Makefile,v 1.5 2020/04/06 20:24:53 cwen Exp $
# $OpenBSD: Makefile,v 1.6 2020/09/23 15:37:32 bcallah Exp $
COMMENT = small, embeddable JavaScript engine in C
V = 2019.10.27
REVISION = 0
V = 2020.09.06
DISTNAME = quickjs-${V:S/./-/g}
PKGNAME = quickjs-${V}
@ -15,7 +14,7 @@ MAINTAINER = Brian Callahan <bcallah@openbsd.org>
# MIT
PERMIT_PACKAGE = Yes
WANTLIB += c m
WANTLIB += c m pthread
MASTER_SITES = https://bellard.org/quickjs/
EXTRACT_SUFX = .tar.xz

View File

@ -1,2 +1,2 @@
SHA256 (quickjs-2019-10-27.tar.xz) = Uc3KTreFHS64so1ELfqjYhOSAXGgzw68BGgCNpQ0oXY=
SIZE (quickjs-2019-10-27.tar.xz) = 763012
SHA256 (quickjs-2020-09-06.tar.xz) = ACGj6M3Gth4iVBHQXihB0kN+HM9LTKu5pfdoXr+1dxc=
SIZE (quickjs-2020-09-06.tar.xz) = 753080

View File

@ -1,4 +1,4 @@
$OpenBSD: patch-Makefile,v 1.1.1.1 2019/12/21 14:24:03 bcallah Exp $
$OpenBSD: patch-Makefile,v 1.2 2020/09/23 15:37:32 bcallah Exp $
Remove hardcoded -O2
Use default ar
@ -23,7 +23,7 @@ Index: Makefile
ifdef CONFIG_DARWIN
# use clang instead of gcc
@@ -81,8 +82,8 @@ ifdef CONFIG_CLANG
@@ -83,8 +84,8 @@ ifdef CONFIG_CLANG
else
HOST_CC=gcc
CC=$(CROSS_PREFIX)gcc
@ -34,7 +34,7 @@ Index: Makefile
ifdef CONFIG_LTO
AR=$(CROSS_PREFIX)gcc-ar
else
@@ -97,7 +98,7 @@ DEFINES:=-D_GNU_SOURCE -DCONFIG_VERSION=\"$(shell cat
@@ -106,7 +107,7 @@ endif
CFLAGS+=$(DEFINES)
CFLAGS_DEBUG=$(CFLAGS) -O0
CFLAGS_SMALL=$(CFLAGS) -Os
@ -43,12 +43,16 @@ Index: Makefile
CFLAGS_NOLTO:=$(CFLAGS_OPT)
LDFLAGS=-g
ifdef CONFIG_LTO
@@ -165,7 +166,7 @@ QJSBN_OBJS=$(OBJDIR)/qjs.bn.o $(OBJDIR)/repl-bn.bn.o $
@@ -170,10 +171,10 @@ QJS_LIB_OBJS+=$(OBJDIR)/libbf.o
QJS_OBJS+=$(OBJDIR)/qjscalc.o
endif
-HOST_LIBS=-lm -ldl -lpthread
+HOST_LIBS=-lm -lpthread
LIBS=-lm
ifndef CONFIG_WIN32
-LIBS+=-ldl
+LIBS+=
-LIBS+=-ldl -lpthread
+LIBS+=-lpthread
endif
$(OBJDIR):

View File

@ -1,9 +1,9 @@
$OpenBSD: patch-qjs_c,v 1.1.1.1 2019/12/21 14:24:03 bcallah Exp $
$OpenBSD: patch-qjs_c,v 1.2 2020/09/23 15:37:32 bcallah Exp $
Index: qjs.c
--- qjs.c.orig
+++ qjs.c
@@ -130,7 +130,7 @@ static inline size_t js_trace_malloc_usable_size(void
@@ -152,7 +152,7 @@ static inline size_t js_trace_malloc_usable_size(void
return malloc_usable_size(ptr);
#else
/* change this to `return 0;` if compilation fails */
@ -12,7 +12,7 @@ Index: qjs.c
#endif
}
@@ -246,7 +246,7 @@ static const JSMallocFunctions trace_mf = {
@@ -268,7 +268,7 @@ static const JSMallocFunctions trace_mf = {
(size_t (*)(const void *))malloc_usable_size,
#else
/* change this to `NULL,` if compilation fails */

View File

@ -1,4 +1,4 @@
$OpenBSD: patch-qjsc_c,v 1.1.1.1 2019/12/21 14:24:03 bcallah Exp $
$OpenBSD: patch-qjsc_c,v 1.2 2020/09/23 15:37:32 bcallah Exp $
Remove -ldl
@ -10,6 +10,6 @@ Index: qjsc.c
*arg++ = libjsname;
*arg++ = "-lm";
- *arg++ = "-ldl";
*arg++ = "-lpthread";
*arg = NULL;
if (verbose) {

View File

@ -1,14 +1,17 @@
$OpenBSD: patch-quickjs-libc_c,v 1.1.1.1 2019/12/21 14:24:03 bcallah Exp $
$OpenBSD: patch-quickjs-libc_c,v 1.2 2020/09/23 15:37:32 bcallah Exp $
Index: quickjs-libc.c
--- quickjs-libc.c.orig
+++ quickjs-libc.c
@@ -45,7 +45,7 @@
#include <termios.h>
#include <sys/ioctl.h>
#include <sys/wait.h>
-#if defined(__APPLE__)
+#if defined(__APPLE__) || defined(__OpenBSD__)
typedef sig_t sighandler_t;
@@ -55,6 +55,11 @@ typedef sig_t sighandler_t;
#endif
#endif /* __APPLE__ */
+#if defined(__OpenBSD__)
+typedef sig_t sighandler_t;
+extern char **environ;
+#endif
+
#endif
#if !defined(_WIN32)

View File

@ -1,9 +1,9 @@
$OpenBSD: patch-quickjs_c,v 1.1.1.1 2019/12/21 14:24:03 bcallah Exp $
$OpenBSD: patch-quickjs_c,v 1.2 2020/09/23 15:37:32 bcallah Exp $
Index: quickjs.c
--- quickjs.c.orig
+++ quickjs.c
@@ -1349,7 +1349,7 @@ static inline size_t js_def_malloc_usable_size(void *p
@@ -1667,7 +1667,7 @@ static inline size_t js_def_malloc_usable_size(void *p
return malloc_usable_size(ptr);
#else
/* change this to `return 0;` if compilation fails */
@ -12,7 +12,7 @@ Index: quickjs.c
#endif
}
@@ -1423,7 +1423,7 @@ static const JSMallocFunctions def_malloc_funcs = {
@@ -1741,7 +1741,7 @@ static const JSMallocFunctions def_malloc_funcs = {
(size_t (*)(const void *))malloc_usable_size,
#else
/* change this to `NULL,` if compilation fails */

View File

@ -1,16 +0,0 @@
$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

View File

@ -1,14 +1,16 @@
$OpenBSD: patch-tests_test_builtin_js,v 1.1.1.1 2019/12/21 14:24:03 bcallah Exp $
$OpenBSD: patch-tests_test_builtin_js,v 1.2 2020/09/23 15:37:32 bcallah Exp $
Disable tests that fail on OpenBSD.
More info: https://github.com/NetBSD/pkgsrc/blob/trunk/lang/quickjs/patches/patch-tests_test__builtin.js
Fix the Float32Array test on big-endian platforms.
Index: tests/test_builtin.js
--- tests/test_builtin.js.orig
+++ tests/test_builtin.js
@@ -304,12 +304,12 @@ function test_number()
assert(parseFloat("123.2"), 123.2);
assert(parseFloat("123.2e3"), 123200);
@@ -313,12 +313,12 @@ function test_number()
assert(Number.isNaN(Number("-")));
assert(Number.isNaN(Number("\x00a")));
- assert((25).toExponential(0), "3e+1");
- assert((-25).toExponential(0), "-3e+1");
@ -25,3 +27,17 @@ Index: tests/test_builtin.js
}
function test_eval2()
@@ -412,11 +412,11 @@ function test_typed_array()
a[0] = -1;
a = new Float32Array(buffer, 8, 1);
- a[0] = 1;
+ a[0] = 8651851;
a = new Uint8Array(buffer);
- assert(a.toString(), "0,0,255,255,0,0,0,0,0,0,128,63,255,255,255,255");
+ assert(a.toString(), "0,0,255,255,0,0,0,0,75,4,4,75,255,255,255,255");
assert(a.buffer, buffer);

View File

@ -0,0 +1,20 @@
$OpenBSD: patch-tests_test_std_js,v 1.1 2020/09/23 15:37:32 bcallah Exp $
This test waits forever if the process ignores SIGQUIT.
Index: tests/test_std.js
--- tests/test_std.js.orig
+++ tests/test_std.js
@@ -252,10 +252,10 @@ function test_os_exec()
pid = os.exec(["cat"], { block: false } );
assert(pid >= 0);
- os.kill(pid, os.SIGQUIT);
+ os.kill(pid, os.SIGTERM);
[ret, status] = os.waitpid(pid, 0);
assert(ret, pid);
- assert(status & 0x7f, os.SIGQUIT);
+ assert(status & 0x7f, os.SIGTERM);
}
function test_timer()

View File

@ -1,7 +1,5 @@
@comment $OpenBSD: PLIST,v 1.1.1.1 2019/12/21 14:24:03 bcallah Exp $
@comment $OpenBSD: PLIST,v 1.2 2020/09/23 15:37:32 bcallah Exp $
@bin bin/qjs
@bin bin/qjsbn
@bin bin/qjsbnc
@bin bin/qjsc
bin/qjscalc
include/quickjs/
@ -9,4 +7,3 @@ include/quickjs/quickjs-libc.h
include/quickjs/quickjs.h
lib/quickjs/
@static-lib lib/quickjs/libquickjs.a
@static-lib lib/quickjs/libquickjs.bn.a