package/janet: link with -latomic if needed

Link with -latomic if needed to avoid the following build failure since
bump to version 1.18.1 in commit
1ffdab3eac and
eb0b37f729:

/home/giuliobenetti/autobuild/run/instance-3/output-1/host/opt/ext-toolchain/bin/../lib/gcc/sparc-buildroot-linux-uclibc/9.3.0/../../../../sparc-buildroot-linux-uclibc/bin/ld: janet.p/meson-generated_.._janet.c.o: in function `janet_abstract_incref':
janet.c:(.text+0x2790): undefined reference to `__atomic_fetch_add_4'

Fixes:
 - http://autobuild.buildroot.org/results/8d204d8f065e6e4bc1376edd1f639864b3c69c0b

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
This commit is contained in:
Fabrice Fontaine 2021-11-05 20:32:43 +01:00 committed by Arnout Vandecappelle (Essensium/Mind)
parent c89e0cd922
commit 0ddb20c3ad

View File

@ -15,6 +15,11 @@ ifeq ($(BR2_STATIC_LIBS),y)
JANET_CONF_OPTS += -Ddynamic_modules=false
endif
# Uses __atomic_fetch_add_4
ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y)
JANET_LDFLAGS += -latomic
endif
ifeq ($(BR2_TOOLCHAIN_HAS_THREADS),)
JANET_CONF_OPTS += -Dsingle_threaded=true
endif