From: Steve Youngs Date: Fri, 17 May 2019 15:00:07 +0000 (+1000) Subject: Build fixes for recent libc versions (post glibc 2.19) X-Git-Tag: v22.1.17~24 X-Git-Url: http://cgit.sxemacs.org/?p=sxemacs;a=commitdiff_plain;h=8bda9b596c482119b1c43d6af218157a13e6c2dc Build fixes for recent libc versions (post glibc 2.19) This fixes two 'undefined reference' errors when building with a recent glibc. One in effi.c for 'dlsym', and the other in emacs.c for 'memory_warnings'. * configure.ac: Fix mmap detection. Include -ldl in FFI_LIBS. Ensure that vm-limit.o is added to the objects when using the system malloc. Default to using the system malloc. * m4/sxe-emodffi.m4 (SXE_CHECK_FFI): Include -ldl in FFI_LIBS. Signed-off-by: Steve Youngs --- diff --git a/configure.ac b/configure.ac index ec40bfb..48a1d29 100644 --- a/configure.ac +++ b/configure.ac @@ -308,7 +308,7 @@ OG_ARG_WITH([debug-malloc], OG_ARG_WITH([system-malloc], AS_HELP_STRING([--with-system-malloc], [Use a system malloc instead of GNU.]), - [default], [YES if using quantify or purify; NO otherwise]) + [yes], [YES]) OG_ARG_WITH([regex-malloc], AS_HELP_STRING([--with-regex-malloc], @@ -1565,7 +1565,7 @@ AC_RUN_IFELSE([AC_LANG_SOURCE([[#include int main (int argc, char *argv[]) { int fd = -1; - caddr_t p; + #ifndef MAP_ANONYMOUS fd = open ("/dev/zero", O_RDWR); if (fd < 0) @@ -1899,7 +1899,7 @@ SXE_CHECK_SUFFICIENCY([ffi], [FFI support], [ ## additional actions AC_DEFINE([HAVE_LIBFFI], [1], [Description here!]) HAVE_LIBFFI=yes - FFI_LIBS="-lffi" + FFI_LIBS="-lffi -ldl" SXE_ADD_CRUFT_OBJS([effi.o]) ]) @@ -4113,6 +4113,9 @@ if test "$GNU_MALLOC" = "yes"; then : fi elif test "$with_system_malloc" = "yes" -o "$system_malloc" = "yes"; then + if test "$after_morecore_hook_exists" = "yes"; then + SXE_ADD_MEMALLOC_OBJS(vm-limit.o) + fi AC_DEFINE([USE_SYSTEM_MALLOC], [1], [Description here!]) AC_DEFINE([SYSTEM_MALLOC], [1], [Description here!]) elif test "$with_debug_malloc" = "yes"; then diff --git a/m4/sxe-emodffi.m4 b/m4/sxe-emodffi.m4 index 070afc7..be8849f 100644 --- a/m4/sxe-emodffi.m4 +++ b/m4/sxe-emodffi.m4 @@ -256,7 +256,7 @@ AC_DEFUN([SXE_CHECK_FFI], [dnl "$ac_cv_lib_ffi_ffi_call" = "yes"; then sxe_cv_feat_ffi="yes" have_ffi="yes" - FFI_LIBS=-lffi + FFI_LIBS="-lffi -ldl" else sxe_cv_feat_ffi="no" have_ffi="no"