diff options
author | Bernd Kuhls <bernd.kuhls@t-online.de> | 2017-05-25 09:19:34 +0200 |
---|---|---|
committer | Thomas Petazzoni <thomas.petazzoni@free-electrons.com> | 2017-05-28 16:26:56 +0200 |
commit | 019ad605670670a51055fb5d27a2a1f374a33289 (patch) | |
tree | cfa312f0da988732d440f339b41d0e78e83a36b4 /package/redis/redis.mk | |
parent | db55de2b42a54ca715a7aa3ed6e388ea6f557092 (diff) | |
download | buildroot-019ad605670670a51055fb5d27a2a1f374a33289.tar.gz buildroot-019ad605670670a51055fb5d27a2a1f374a33289.zip |
package/redis: fix static linking with libatomic
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>
[Thomas:
- improve comment to explain the fix
- remove useless LDFLAGS related code]
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Diffstat (limited to 'package/redis/redis.mk')
-rw-r--r-- | package/redis/redis.mk | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/package/redis/redis.mk b/package/redis/redis.mk index 3f4956cf34..458ed4f8ba 100644 --- a/package/redis/redis.mk +++ b/package/redis/redis.mk @@ -13,16 +13,21 @@ define REDIS_USERS redis -1 redis -1 * /var/lib/redis /bin/false - Redis Server endef -# Uses __atomic_fetch_add_4 +# Uses __atomic_fetch_add_4. Adding -latomic to LDFLAGS does not work, +# because LDFLAGS is used before the list of object files. 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 # 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 |