From: Philipp Stephani Date: Sat, 4 May 2019 23:30:23 +0000 (+0200) Subject: Fix compilation of test module. X-Git-Tag: emacs-27.0.90~2986 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=a976602066211f8820c0a2976afe81cad691a2c9;p=emacs.git Fix compilation of test module. 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. --- 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