emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master a976602 2/2: Fix compilation of test module.


From: Philipp Stephani
Subject: [Emacs-diffs] master a976602 2/2: Fix compilation of test module.
Date: Sat, 4 May 2019 19:35:51 -0400 (EDT)

branch: master
commit a976602066211f8820c0a2976afe81cad691a2c9
Author: Philipp Stephani <address@hidden>
Commit: Philipp Stephani <address@hidden>

    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.
---
 test/Makefile.in | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/test/Makefile.in b/test/Makefile.in
index bf5ba101..c180995 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]