From 339048ba661578463f323a60ebe28c6ca4f9ed95 Mon Sep 17 00:00:00 2001 From: Gustavo Zacarias Date: Mon, 28 Mar 2016 11:11:01 -0300 Subject: [PATCH] redis: use BR2_TOOLCHAIN_HAS_LIBATOMIC It uses __atomic_fetch_add_4 so libatomic must be pulled in if necessary. Fixes: http://autobuild.buildroot.net/results/dfd/dfdfd77463b0ddd7016202372afcad7fb6fc9ce4/ [Peter: keep TARGET_CONFIGURE_OPTS] Signed-off-by: Gustavo Zacarias Signed-off-by: Peter Korsgaard --- package/redis/Config.in | 2 ++ package/redis/redis.mk | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/package/redis/Config.in b/package/redis/Config.in index 3b7b7436cc..5d7edd8139 100644 --- a/package/redis/Config.in +++ b/package/redis/Config.in @@ -1,6 +1,7 @@ config BR2_PACKAGE_REDIS bool "redis" depends on BR2_USE_MMU # fork() + depends on BR2_TOOLCHAIN_HAS_ATOMIC depends on BR2_TOOLCHAIN_HAS_THREADS help Redis is an open source, advanced key-value store. It is @@ -11,4 +12,5 @@ config BR2_PACKAGE_REDIS comment "redis needs a toolchain w/ threads" depends on BR2_USE_MMU + depends on BR2_TOOLCHAIN_HAS_ATOMIC depends on !BR2_TOOLCHAIN_HAS_THREADS diff --git a/package/redis/redis.mk b/package/redis/redis.mk index 6a3dd01643..a9df6e712f 100644 --- a/package/redis/redis.mk +++ b/package/redis/redis.mk @@ -13,10 +13,16 @@ define REDIS_USERS redis -1 redis -1 * /var/lib/redis /bin/false - Redis Server endef +# Uses __atomic_fetch_add_4 +ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y) +REDIS_LIBATOMIC = -latomic +endif + # Redis doesn't support DESTDIR (yet, see # https://github.com/antirez/redis/pull/609). We set PREFIX # instead. REDIS_BUILDOPTS = $(TARGET_CONFIGURE_OPTS) \ + LDFLAGS="$(TARGET_LDFLAGS) $(REDIS_LIBATOMIC)" \ PREFIX=$(TARGET_DIR)/usr MALLOC=libc \ define REDIS_BUILD_CMDS -- 2.30.2