Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] redis: use BR2_TOOLCHAIN_HAS_LIBATOMIC
@ 2016-03-28 14:11 Gustavo Zacarias
  2016-03-28 20:36 ` Peter Korsgaard
  2016-03-28 20:40 ` Peter Korsgaard
  0 siblings, 2 replies; 3+ messages in thread
From: Gustavo Zacarias @ 2016-03-28 14:11 UTC (permalink / raw)
  To: buildroot

It uses __atomic_fetch_add_4 so libatomic must be pulled in if
necessary. Fixes:
http://autobuild.buildroot.net/results/dfd/dfdfd77463b0ddd7016202372afcad7fb6fc9ce4/

Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
---
 package/redis/Config.in |  2 ++
 package/redis/redis.mk  | 10 +++++++++-
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/package/redis/Config.in b/package/redis/Config.in
index 3b7b743..5d7edd8 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 6a3dd01..b285ab5 100644
--- a/package/redis/redis.mk
+++ b/package/redis/redis.mk
@@ -13,10 +13,18 @@ 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) \
+REDIS_BUILDOPTS = \
+	CC="$(TARGET_CC)" \
+	CFLAGS="$(TARGET_CFLAGS)" \
+	LDFLAGS="$(TARGET_LDFLAGS) $(REDIS_LIBATOMIC)" \
 	PREFIX=$(TARGET_DIR)/usr MALLOC=libc \
 
 define REDIS_BUILD_CMDS
-- 
2.7.3

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [Buildroot] [PATCH] redis: use BR2_TOOLCHAIN_HAS_LIBATOMIC
  2016-03-28 14:11 [Buildroot] [PATCH] redis: use BR2_TOOLCHAIN_HAS_LIBATOMIC Gustavo Zacarias
@ 2016-03-28 20:36 ` Peter Korsgaard
  2016-03-28 20:40 ` Peter Korsgaard
  1 sibling, 0 replies; 3+ messages in thread
From: Peter Korsgaard @ 2016-03-28 20:36 UTC (permalink / raw)
  To: buildroot

>>>>> "Gustavo" == Gustavo Zacarias <gustavo@zacarias.com.ar> writes:

 > It uses __atomic_fetch_add_4 so libatomic must be pulled in if
 > necessary. Fixes:
 > http://autobuild.buildroot.net/results/dfd/dfdfd77463b0ddd7016202372afcad7fb6fc9ce4/

 > Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>

Committed, thanks.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Buildroot] [PATCH] redis: use BR2_TOOLCHAIN_HAS_LIBATOMIC
  2016-03-28 14:11 [Buildroot] [PATCH] redis: use BR2_TOOLCHAIN_HAS_LIBATOMIC Gustavo Zacarias
  2016-03-28 20:36 ` Peter Korsgaard
@ 2016-03-28 20:40 ` Peter Korsgaard
  1 sibling, 0 replies; 3+ messages in thread
From: Peter Korsgaard @ 2016-03-28 20:40 UTC (permalink / raw)
  To: buildroot

>>>>> "Gustavo" == Gustavo Zacarias <gustavo@zacarias.com.ar> writes:

 > It uses __atomic_fetch_add_4 so libatomic must be pulled in if
 > necessary. Fixes:
 > http://autobuild.buildroot.net/results/dfd/dfdfd77463b0ddd7016202372afcad7fb6fc9ce4/

 >  # Redis doesn't support DESTDIR (yet, see
 >  # https://github.com/antirez/redis/pull/609).  We set PREFIX
 >  # instead.
 > -REDIS_BUILDOPTS = $(TARGET_CONFIGURE_OPTS) \
 > +REDIS_BUILDOPTS = \
 > +	CC="$(TARGET_CC)" \
 > +	CFLAGS="$(TARGET_CFLAGS)" \
 > +	LDFLAGS="$(TARGET_LDFLAGS) $(REDIS_LIBATOMIC)" \
 >  	PREFIX=$(TARGET_DIR)/usr MALLOC=libc \

On second thought, I prefer to keep this as TARGET_CONFIGURE_OPTS
instead of explicitly passing CC / CFLAGS, so I've changed that while
committing.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-03-28 20:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-28 14:11 [Buildroot] [PATCH] redis: use BR2_TOOLCHAIN_HAS_LIBATOMIC Gustavo Zacarias
2016-03-28 20:36 ` Peter Korsgaard
2016-03-28 20:40 ` Peter Korsgaard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox