mirror of
https://gitlab.com/buildroot.org/buildroot.git
synced 2026-09-30 22:11:59 -09:00
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>
(cherry picked from commit 019ad60567)
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
This commit is contained in:
committed by
Peter Korsgaard
parent
567d01e0dc
commit
667c418a24
@@ -13,17 +13,22 @@ define REDIS_USERS
|
|||||||
redis -1 redis -1 * /var/lib/redis /bin/false - Redis Server
|
redis -1 redis -1 * /var/lib/redis /bin/false - Redis Server
|
||||||
endef
|
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)
|
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
|
endif
|
||||||
|
|
||||||
# Redis doesn't support DESTDIR (yet, see
|
# Redis doesn't support DESTDIR (yet, see
|
||||||
# https://github.com/antirez/redis/pull/609). We set PREFIX
|
# https://github.com/antirez/redis/pull/609). We set PREFIX
|
||||||
# instead.
|
# instead.
|
||||||
REDIS_BUILDOPTS = $(TARGET_CONFIGURE_OPTS) \
|
REDIS_BUILDOPTS = $(TARGET_CONFIGURE_OPTS) \
|
||||||
LDFLAGS="$(TARGET_LDFLAGS) $(REDIS_LIBATOMIC)" \
|
PREFIX=$(TARGET_DIR)/usr MALLOC=libc
|
||||||
PREFIX=$(TARGET_DIR)/usr MALLOC=libc \
|
|
||||||
|
|
||||||
define REDIS_BUILD_CMDS
|
define REDIS_BUILD_CMDS
|
||||||
$(TARGET_MAKE_ENV) $(MAKE) $(REDIS_BUILDOPTS) -C $(@D)
|
$(TARGET_MAKE_ENV) $(MAKE) $(REDIS_BUILDOPTS) -C $(@D)
|
||||||
|
|||||||
Reference in New Issue
Block a user