Summary: minor, provide malldbg multiarg for MALLOC_PERTURB_
authorSebastian Freundt <hroptatyr@fresse.org>
Mon, 23 Jan 2012 21:45:10 +0000 (21:45 +0000)
committerSebastian Freundt <hroptatyr@fresse.org>
Mon, 23 Jan 2012 21:45:10 +0000 (21:45 +0000)
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 <hroptatyr@fresse.org>
configure.ac
m4/sxe-compiler.m4
src/Makefile.am

index 4d61bbc..12760e7 100644 (file)
@@ -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],
index 7c39bcf..12fd03b 100644 (file)
@@ -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
index 3c2b36a..9aab242 100644 (file)
@@ -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) \