Hi,
Try running qjsc with -c flag to output source .c file and then compile
it separately with additional lib.
Or, add the missing lib option by editing qjsc.c source...
On 7/19/20 12:35 AM, Jesse Kriss wrote:
Hi there -
I'm trying to run quickjs on a Raspberry Pi 4. Building from source works (although I had
to run make with LDFLAGS="-g -latomic") and running qjs works, but when I run
qjsc I get the following error:
$ qjsc -o hello hello.js
/usr/bin/ld: /usr/local/lib/quickjs/libquickjs.a(quickjs.nolto.o): in function
`js_atomics_op':
/home/pi/Documents/opt/quickjs-2020-07-05/quickjs.c:52895: undefined reference
to `__atomic_fetch_add_8'
/usr/bin/ld: /home/pi/Documents/opt/quickjs-2020-07-05/quickjs.c:52896:
undefined reference to `__atomic_fetch_and_8'
/usr/bin/ld: /home/pi/Documents/opt/quickjs-2020-07-05/quickjs.c:52897:
undefined reference to `__atomic_fetch_or_8'
/usr/bin/ld: /home/pi/Documents/opt/quickjs-2020-07-05/quickjs.c:52898:
undefined reference to `__atomic_fetch_sub_8'
/usr/bin/ld: /home/pi/Documents/opt/quickjs-2020-07-05/quickjs.c:52899:
undefined reference to `__atomic_fetch_xor_8'
/usr/bin/ld: /home/pi/Documents/opt/quickjs-2020-07-05/quickjs.c:52900:
undefined reference to `__atomic_exchange_8'
/usr/bin/ld: /home/pi/Documents/opt/quickjs-2020-07-05/quickjs.c:52943:
undefined reference to `__atomic_compare_exchange_8'
/usr/bin/ld: /home/pi/Documents/opt/quickjs-2020-07-05/quickjs.c:52914:
undefined reference to `__atomic_load_8'
/usr/bin/ld: /usr/local/lib/quickjs/libquickjs.a(quickjs.nolto.o): in function
`js_atomics_store':
/home/pi/Documents/opt/quickjs-2020-07-05/quickjs.c:53011: undefined reference
to `__atomic_store_8'
collect2: error: ld returned 1 exit status
Any ideas? The examples in the Makefile compile and run, so it makes me wonder
if there are some flags set there that aren't being applied when qjsc runs, but
I'm admittedly out of my element on this one.
$ uname -a
Linux raspberrypi 4.19.118-v7l+ #1311 SMP Mon Apr 27 14:26:42 BST 2020 armv7l
GNU/Linux
Thanks,
Jesse