redis: use BR2_TOOLCHAIN_HAS_LIBATOMIC
authorGustavo Zacarias <gustavo@zacarias.com.ar>
Mon, 28 Mar 2016 14:11:01 +0000 (11:11 -0300)
committerPeter Korsgaard <peter@korsgaard.com>
Mon, 28 Mar 2016 20:41:02 +0000 (22:41 +0200)
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 <gustavo@zacarias.com.ar>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
package/redis/Config.in
package/redis/redis.mk

index 3b7b7436ccd58f4abf0c6ab1947c31d98c478c17..5d7edd8139504f10a7b15e6ddd9071b0473ad40e 100644 (file)
@@ -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
index 6a3dd016439571db9498261c47f1573bcd8eade7..a9df6e712f1cd17652a03b13988aeb08193faf30 100644 (file)
@@ -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