On Tue, 18 Feb 2020 18:25:49 -0500 Brian Callahan <call...@rpi.edu> wrote:
> Could someone on macppc please give this a test and make sure that > atomics are still needed? Yes, atomics are needed. The -latomic in LDFLAGS allows my macppc to link qjsc, but the build fails later, because qjsc doesn't know to use -latomic to link JavaScript code; see log below. I fixed my macppc build by adding the line *arg++ = "-latomic"; after -lm in qjsc.c. Then I can build and install, but "make test" fails, because (float)1 got packed in big-endian order 63,128,0,0, but the test expects little-endian order 0,0,128,63: ./qjs tests/test_builtin.js Error: assertion failed: got |0,0,255,255,0,0,0,0,63,128,0,0,255,255,255,255|, expected |0,0,255,255,0,0,0,0,0,0,128,63,255,255,255,255| at assert (tests/test_builtin.js:17) at test_typed_array (tests/test_builtin.js:413) at <eval> (tests/test_builtin.js:640) On amd64, "make test" seems to pass, but also writes a qjs.core in WRKSRC. I didn't study the core. ===> Building for quickjs-2020.01.19 ./qjsc -fno-string-normalize -fno-map -fno-promise -fno-typedarray -fno-typedarray -fno-regexp -fno-json -fno-eval -fno-proxy -fno-date -m -o examples/hello_module examples/hello_module.js ./libquickjs.a(quickjs.o): In function `js_host_resolve_imported_module': quickjs.c:(.text+0x3a4f0): warning: strcat() is almost always misused, please use strlcat() ./libquickjs.a(quickjs.o): In function `js_dtoa': quickjs.c:(.text+0x2ab48): warning: sprintf() is often misused, please use snprintf() quickjs.c:(.text+0x2ac24): warning: strcpy() is almost always misused, please use strlcpy() ./libquickjs.a(quickjs.o): In function `js_atomics_op': quickjs.c:(.text+0x38a40): undefined reference to `__atomic_fetch_add_8' quickjs.c:(.text+0x38a58): undefined reference to `__atomic_fetch_and_8' quickjs.c:(.text+0x38a70): undefined reference to `__atomic_fetch_or_8' quickjs.c:(.text+0x38c5c): undefined reference to `__atomic_load_8' quickjs.c:(.text+0x38d18): undefined reference to `__atomic_fetch_sub_8' quickjs.c:(.text+0x38d30): undefined reference to `__atomic_fetch_xor_8' quickjs.c:(.text+0x38d48): undefined reference to `__atomic_exchange_8' quickjs.c:(.text+0x38d68): undefined reference to `__atomic_compare_exchange_8' ./libquickjs.a(quickjs.o): In function `js_atomics_store': quickjs.c:(.text+0x39a54): undefined reference to `__atomic_store_8' collect2: error: ld returned 1 exit status gmake: *** [Makefile:336: examples/hello_module] Error 1 *** Error 2 in . (/usr/ports/infrastructure/mk/bsd.port.mk:2891 '/usr/ports/pobj/quickjs-2020.01.19/.build_done': @cd /usr/ports/pobj/quickj...) *** Error 2 in . (/usr/ports/infrastructure/mk/bsd.port.mk:2091 '/usr/ports/packages/powerpc/all/quickjs-2020.01.19.tgz': @cd /usr/ports/lan...) *** Error 2 in . (/usr/ports/infrastructure/mk/bsd.port.mk:2578 '_internal-package': @case X${_DEPENDS_CACHE} in X) _DEPENDS_CACHE=$(doas -...) *** Error 2 in . (/usr/ports/infrastructure/mk/bsd.port.mk:2557 'package': @:; cd /usr/ports/lang/quickjs && PKGPATH=lang/quickjs make _inte...) *** Error 2 in . (/usr/ports/infrastructure/mk/bsd.port.mk:2112 '/var/db/pkg/quickjs-2020.01.19/+CONTENTS': @cd /usr/ports/lang/quickjs && P...) *** Error 2 in /usr/ports/lang/quickjs (/usr/ports/infrastructure/mk/bsd.port.mk:2557 'install': @lock=quickjs-2020.01.19; export _LOCKS_HE...)