package/nodejs: link with libatomic when needed
authorMartin Bark <martin@barkynet.com>
Sun, 17 Mar 2019 20:48:00 +0000 (20:48 +0000)
committerThomas Petazzoni <thomas.petazzoni@bootlin.com>
Mon, 18 Mar 2019 20:57:49 +0000 (21:57 +0100)
Fixes:
 - http://autobuild.buildroot.net/results/804951467d3f5b212bd33b95dc8fe9c6f5f63838

Signed-off-by: Martin Bark <martin@barkynet.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
package/nodejs/nodejs.mk

index 5cae4492449664025a9be07e1266f4a3bad7529d..2577239e1973da91bcfb20dbe514780533ac74b6 100644 (file)
@@ -116,6 +116,12 @@ NODEJS_MIPS_ARCH_VARIANT = r1
 endif
 endif
 
+NODEJS_LDFLAGS = $(TARGET_LDFLAGS)
+
+ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y)
+NODEJS_LDFLAGS += -latomic
+endif
+
 define NODEJS_CONFIGURE_CMDS
        mkdir -p $(@D)/bin
        ln -sf $(HOST_DIR)/bin/python2 $(@D)/bin/python
@@ -123,6 +129,7 @@ define NODEJS_CONFIGURE_CMDS
        (cd $(@D); \
                $(TARGET_CONFIGURE_OPTS) \
                PATH=$(@D)/bin:$(BR_PATH) \
+               LDFLAGS="$(NODEJS_LDFLAGS)" \
                LD="$(TARGET_CXX)" \
                PYTHON=$(HOST_DIR)/bin/python2 \
                $(HOST_DIR)/bin/python2 ./configure \
@@ -145,6 +152,7 @@ define NODEJS_BUILD_CMDS
                $(TARGET_CONFIGURE_OPTS) \
                NO_LOAD=cctest.target.mk \
                PATH=$(@D)/bin:$(BR_PATH) \
+               LDFLAGS="$(NODEJS_LDFLAGS)" \
                LD="$(TARGET_CXX)"
 endef
 
@@ -156,6 +164,7 @@ NODEJS_MODULES_LIST= $(call qstrip,\
 
 # Define NPM for other packages to use
 NPM = $(TARGET_CONFIGURE_OPTS) \
+       LDFLAGS="$(NODEJS_LDFLAGS)" \
        LD="$(TARGET_CXX)" \
        npm_config_arch=$(NODEJS_CPU) \
        npm_config_target_arch=$(NODEJS_CPU) \
@@ -184,6 +193,7 @@ define NODEJS_INSTALL_TARGET_CMDS
                $(TARGET_CONFIGURE_OPTS) \
                NO_LOAD=cctest.target.mk \
                PATH=$(@D)/bin:$(BR_PATH) \
+               LDFLAGS="$(NODEJS_LDFLAGS)" \
                LD="$(TARGET_CXX)"
        $(NODEJS_INSTALL_MODULES)
 endef