From a976602066211f8820c0a2976afe81cad691a2c9 Mon Sep 17 00:00:00 2001 From: Philipp Stephani Date: Sun, 5 May 2019 01:30:23 +0200 Subject: [PATCH] Fix compilation of test module. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Because all other objects are compiled without -fPIC, we can’t use them when linking the test module. Instead, use the source files directly. * test/Makefile.in (HYBRID_MALLOC, LIBEGNU_ARCHIVE): Remove. ($(test_module)): Use source files instead of objects and archives. --- test/Makefile.in | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/test/Makefile.in b/test/Makefile.in index bf5ba101bd4..c18099587c0 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -254,8 +254,6 @@ else FPIC_CFLAGS = -fPIC endif -HYBRID_MALLOC = @HYBRID_MALLOC@ -LIBEGNU_ARCHIVE = ../lib/lib$(if $(HYBRID_MALLOC),e)gnu.a GMP_LIB = @GMP_LIB@ GMP_OBJ = $(if @GMP_OBJ@, ../src/@GMP_OBJ@) @@ -267,10 +265,15 @@ MODULE_CFLAGS = -I../src -I$(srcdir)/../lib \ test_module = $(test_module_dir)/mod-test${SO} src/emacs-module-tests.log src/emacs-module-tests.elc: $(test_module) -$(test_module): $(test_module:${SO}=.c) ../src/emacs-module.h $(LIBEGNU_ARCHIVE) + +# In the compilation command, we can't use any object or archive file +# as source because those are not compiled with -fPIC. Therefore we +# use only source files. +$(test_module): $(test_module:${SO}=.c) ../src/emacs-module.h $(AM_V_at)${MKDIR_P} $(dir $@) $(AM_V_CCLD)$(CC) -shared $(CPPFLAGS) $(MODULE_CFLAGS) $(LDFLAGS) \ - -o $@ $< $(LIBEGNU_ARCHIVE) $(GMP_LIB) $(GMP_OBJ) + -o $@ $< $(GMP_LIB) $(GMP_OBJ:.o=.c) \ + $(srcdir)/../lib/timespec.c $(srcdir)/../lib/gettime.c endif ## Check that there is no 'automated' subdirectory, which would -- 2.39.2