From 673588d5186361c939ac3eb7664bcffc41071cdc Mon Sep 17 00:00:00 2001 From: Sebastian Freundt Date: Mon, 23 Jan 2012 21:45:10 +0000 Subject: [PATCH] Summary: minor, provide malldbg multiarg for MALLOC_PERTURB_ Keywords: bldchn diagnostics This changeset introduces a multiarg item to the error-checking option group, named `malldbg', that controls MALLOC_PERTURB_ and friends when dumping. This should fix the dumping procedure on MALLOC_PERTURB_ systems as our dumper reacts quite sensitively to that kind of system hardening. This changeset contains no additional intelligence to turn it off automatically, if you see crashes during the dump phase conside --with-error-checking=nomalldbg. Whether or not we can persuade (read fix) the dumper code to react more friendly to this kind of interference is subject to a different patch. * configure.ac: add `malldbg' to the error-checking multiarg * m4/sxe-compiler.m4: prepare EXTRA_BATCHENV in case malldbg is off * src/Makefile.am: extend dumping environment to EXTRA_BATCHENV Signed-off-by: Sebastian Freundt --- configure.ac | 1 + m4/sxe-compiler.m4 | 9 ++++++++- src/Makefile.am | 3 ++- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 4d61bbc..12760e7 100644 --- a/configure.ac +++ b/configure.ac @@ -447,6 +447,7 @@ OG_MULTIARG_WITH([error-checking], [dnl OG_MULTIARG_ITEM([bufpos], [bufpos], [checks on buffer position]) OG_MULTIARG_ITEM([glyphs], [glyphs], [checks on glyph data]) OG_MULTIARG_ITEM([stack], [stack], [checks on stack barriers]) + OG_MULTIARG_ITEM([malldbg], [malldbg], [malloc debugging code]) ]) OG_ARG_WITH([purify], diff --git a/m4/sxe-compiler.m4 b/m4/sxe-compiler.m4 index 7c39bcf..12fd03b 100644 --- a/m4/sxe-compiler.m4 +++ b/m4/sxe-compiler.m4 @@ -1669,8 +1669,15 @@ AC_DEFUN([SXE_CHECK_CFLAGS], [dnl ## so we issue the tests right here if test "${with_error_checking_stack}" = "yes"; then SXE_STACK_FLAGS - SXE_CFLAGS="${SXE_CFLAGS} ${diagflags}" fi + if test "${with_error_checking_malldbg}" = "yes"; then + ## keep MALLOC_PERTURB_ and friends? + : + else + EXTRA_BATCHENV="MALLOC_PERTURB_= MALLOC_CHECK_=" + AC_SUBST([EXTRA_BATCHENV]) + fi + SXE_CFLAGS="${SXE_CFLAGS} ${diagflags}" ## Use either command line flag, environment var, or autodetection if test "$with_ridiculously_aggressive_optimisations" = "yes"; then diff --git a/src/Makefile.am b/src/Makefile.am index 3c2b36a..9aab242 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -242,7 +242,8 @@ AALFILE = $(bldlispdir)/auto-autoloads.el AALCFILE = $(bldlispdir)/auto-autoloads.elc BITCH = $(SXEMACS) -batch SXE_DYLD_PATH = $(bldsrcdir):$(bldsrcdir)/$(LT_OBJDIR):$(bldlwlibdir):$(bldlwlibdir)/$(LT_OBJDIR):$(DESTDIR)$(libdir) -BATCHENV = DYLD_LIBRARY_PATH=$(SXE_DYLD_PATH):$$DYLD_LIBRARY_PATH:$(DYLD_LIBRARY_PATH) \ +BATCHENV = $(EXTRA_BATCHENV) \ + DYLD_LIBRARY_PATH=$(SXE_DYLD_PATH):$$DYLD_LIBRARY_PATH:$(DYLD_LIBRARY_PATH) \ LD_LIBRARY_PATH=$(SXE_DYLD_PATH):$$LD_LIBRARY_PATH:$(LD_LIBRARY_PATH) \ SHLIB_PATH=$(SXE_DYLD_PATH):$$SHLIB_PATH:$(SHLIB_PATH) BITCHENV = $(BATCHENV) \ -- 2.25.1