summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYossi Gottlieb <yossigo@gmail.com>2021-10-31 16:25:57 +0200
committerOran Agra <oran@redislabs.com>2022-12-12 17:02:54 +0200
commite5e642aa9b7396d604db6788cc40b035013e1129 (patch)
tree5df8e58b79cd0ed5d1321a152dde4e7bf6fb977d
parent52cccfbe94df22a084786a9c667f5bd6b05f7ed9 (diff)
downloadredis-e5e642aa9b7396d604db6788cc40b035013e1129.tar.gz
Use 'gcc' instead of 'ld' to link test modules. (#9710)
This solves several problems in a more elegant way: * No need to explicitly use `-lc` on x86_64 when building with `-m32`. * Avoids issues with undefined floating point emulation funcs on ARM. (cherry picked from commit f26e90be0ccad273a8b7a71dfecaa4db43bfff29)
-rw-r--r--tests/modules/Makefile8
1 files changed, 3 insertions, 5 deletions
diff --git a/tests/modules/Makefile b/tests/modules/Makefile
index 52178c871..727e64cd1 100644
--- a/tests/modules/Makefile
+++ b/tests/modules/Makefile
@@ -10,11 +10,9 @@ else # Linux, others
SHOBJ_LDFLAGS ?= -shared
endif
-# Needed to satisfy __stack_chk_fail_local on Linux with -m32, due to gcc
-# -fstack-protector by default. Breaks on FreeBSD and macOS 11 so needs
-# to be Linux specific.
ifeq ($(uname_S),Linux)
- LIBS = -lc
+ LD = gcc
+ CC = gcc
endif
# OS X 11.x doesn't have /usr/lib/libSystem.dylib and needs an explicit setting.
@@ -54,7 +52,7 @@ TEST_MODULES = \
all: $(TEST_MODULES)
32bit:
- $(MAKE) CFLAGS="-m32" LDFLAGS="-melf_i386"
+ $(MAKE) CFLAGS="-m32" LDFLAGS="-m32"
%.xo: %.c ../../src/redismodule.h
$(CC) -I../../src $(CFLAGS) $(SHOBJ_CFLAGS) -fPIC -c $< -o $@