Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] package/redis: fix static linking with libatomic
@ 2017-05-25  7:19 Bernd Kuhls
  2017-05-28 14:37 ` Thomas Petazzoni
  2017-06-01 14:25 ` Peter Korsgaard
  0 siblings, 2 replies; 3+ messages in thread
From: Bernd Kuhls @ 2017-05-25  7:19 UTC (permalink / raw)
  To: buildroot

Fixes
http://autobuild.buildroot.net/results/7f1/7f1ecccbfdb6bd95824d9c884f1577e71e0e1e09/
http://autobuild.buildroot.net/results/c0b/c0b1bdcc5fbddf8b996b923015184d753882d4b8/

Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
---
 package/redis/redis.mk | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/package/redis/redis.mk b/package/redis/redis.mk
index 3f4956cf3..2a5012812 100644
--- a/package/redis/redis.mk
+++ b/package/redis/redis.mk
@@ -14,8 +14,14 @@ define REDIS_USERS
 endef
 
 # Uses __atomic_fetch_add_4
+# src/Makefile contains a wrong linking order which breaks linking
+# for static builds. We need to add -latomic to FINAL_LIBS to provide
+# -latomic at the correct place in the linking command.
 ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y)
-REDIS_LIBATOMIC = -latomic
+define REDIS_FIX_MAKEFILE
+	$(SED) 's/FINAL_LIBS=-lm/FINAL_LIBS=-lm -latomic/' $(@D)/src/Makefile
+endef
+REDIS_POST_PATCH_HOOKS = REDIS_FIX_MAKEFILE
 endif
 
 # Redis doesn't support DESTDIR (yet, see
-- 
2.11.0

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

* [Buildroot] [PATCH 1/1] package/redis: fix static linking with libatomic
  2017-05-25  7:19 [Buildroot] [PATCH 1/1] package/redis: fix static linking with libatomic Bernd Kuhls
@ 2017-05-28 14:37 ` Thomas Petazzoni
  2017-06-01 14:25 ` Peter Korsgaard
  1 sibling, 0 replies; 3+ messages in thread
From: Thomas Petazzoni @ 2017-05-28 14:37 UTC (permalink / raw)
  To: buildroot

Hello,

On Thu, 25 May 2017 09:19:34 +0200, Bernd Kuhls wrote:

>  # Uses __atomic_fetch_add_4
> +# src/Makefile contains a wrong linking order which breaks linking
> +# for static builds. We need to add -latomic to FINAL_LIBS to provide

The Makefile doesn't really contain a "wrong linking" order, it's
simply that LDFLAGS are used before the list of object files. So I've
reworded a bit the comment here.

> +# -latomic at the correct place in the linking command.
>  ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y)
> -REDIS_LIBATOMIC = -latomic

You forgot to adjust the place where REDIS_LIBATOMIC was used, so I've
adjusted that as well.

Applied to master with those two issues fixed.

Could you submit a patch upstream that adds something like
EXTRA_FINAL_LIBS:

FINAL_LIBS = -lm $(EXTRA_FINAL_LIBS)

This way we could nicely pass it from the environment.

Thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

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

* [Buildroot] [PATCH 1/1] package/redis: fix static linking with libatomic
  2017-05-25  7:19 [Buildroot] [PATCH 1/1] package/redis: fix static linking with libatomic Bernd Kuhls
  2017-05-28 14:37 ` Thomas Petazzoni
@ 2017-06-01 14:25 ` Peter Korsgaard
  1 sibling, 0 replies; 3+ messages in thread
From: Peter Korsgaard @ 2017-06-01 14:25 UTC (permalink / raw)
  To: buildroot

>>>>> "Bernd" == Bernd Kuhls <bernd.kuhls@t-online.de> writes:

 > Fixes
 > http://autobuild.buildroot.net/results/7f1/7f1ecccbfdb6bd95824d9c884f1577e71e0e1e09/
 > http://autobuild.buildroot.net/results/c0b/c0b1bdcc5fbddf8b996b923015184d753882d4b8/

 > Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>

Committed to 2017.02.x, thanks.

-- 
Bye, Peter Korsgaard

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

end of thread, other threads:[~2017-06-01 14:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-05-25  7:19 [Buildroot] [PATCH 1/1] package/redis: fix static linking with libatomic Bernd Kuhls
2017-05-28 14:37 ` Thomas Petazzoni
2017-06-01 14:25 ` Peter Korsgaard

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