Hi!

> http://build-failures.rhaalovely.net/powerpc/last/lang/quickjs.log
(not the same issue on sparc64 and mips64)

As mentioned by the COMPILER comment, it requires stdatomic so we need
to link it on powerpc and probably hppa.

Later, i've found out that on big endian archs an extra define seems
needed, because none of our includes define WORDS_BIGENDIAN, and it
is not defined by the upstream Makefile. If you wonder why i searched
for it, it's because tests are successfully failing:

--8<--
===>  Regression tests for quickjs-2019.10.27
cc -O2 -pipe -DWORDS_BIGENDIAN -Wall -MMD -MF .obj/bjson.pic.o.d 
-Wno-array-bounds -D_GNU_SOURCE -DCONFIG_VERSION=\"2019-10-27\" -fPIC 
-DJS_SHARED_LIBRARY -c -o .obj/tests/bjson.pic.o tests/bjson.c
cc -latomic -shared -o tests/bjson.so .obj/tests/bjson.pic.o -lm 
./qjs tests/test_closure.js
./qjs tests/test_op.js
./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:410)
    at <eval> (tests/test_builtin.js:637)
-->8--

Tests are using javascript TypedArrays in many places, and it appears
that these arrays are byte-order dependent [0]. It would require a
lot of patching, so i think we should pass it, as far as ports are
concerned. The latest version has no changes that would solve the
issue.

It indeed builds [1] on macppc. No REVISION bump is needed, we have
no quickjs package built on all ${BE_ARCHS}.

Comments/feedback are welcome,

Charlène.


[0] 
https://hacks.mozilla.org/2017/01/typedarray-or-dataview-understanding-byte-order/
[1] https://bin.charlenew.xyz/quickjs.log


Index: Makefile
===================================================================
RCS file: /cvs/ports/lang/quickjs/Makefile,v
retrieving revision 1.1.1.1
diff -u -p -u -p -r1.1.1.1 Makefile
--- Makefile    21 Dec 2019 14:24:03 -0000      1.1.1.1
+++ Makefile    13 Jan 2020 16:37:11 -0000
@@ -23,4 +23,15 @@ COMPILER =   base-clang ports-gcc
 USE_GMAKE =    Yes
 MAKE_FLAGS =   CC="${CC}"
 
+# Fix "undefined reference to `__atomic_store_8'"
+.if ${MACHINE_ARCH:Mpowerpc} || ${MACHINE_ARCH:Mhppa}
+WANTLIB +=     atomic
+MAKE_FLAGS +=  LDFLAGS="${LDFLAGS} -latomic"
+.endif
+
+.include <bsd.port.arch.mk>
+.if ${PROPERTIES:Mbe}
+CFLAGS +=      -DWORDS_BIGENDIAN
+.endif
+
 .include <bsd.port.mk>


Reply via email to