Commit e5e642aa authored by Yossi Gottlieb's avatar Yossi Gottlieb Committed by Oran Agra
Browse files

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 f26e90be)
parent 52cccfbe
......@@ -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 $@
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment