This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] libsanitizer demangling using cp-demangle.c
- From: Konstantin Serebryany <konstantin dot s dot serebryany at gmail dot com>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: Alexey Samsonov <samsonov at google dot com>, Ian Lance Taylor <iant at google dot com>, Dmitry Vyukov <dvyukov at google dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 9 Jan 2014 17:51:05 +0400
- Subject: Re: [PATCH] libsanitizer demangling using cp-demangle.c
- Authentication-results: sourceware.org; auth=none
- References: <20131206075033 dot GE892 at tucnak dot redhat dot com> <CACT4Y+b4Txm5oWOCEC71OmU5+4sbxgpkx=6ziiXD7DPfBrpeoA at mail dot gmail dot com> <20131206082507 dot GF892 at tucnak dot redhat dot com> <CACT4Y+bn6bPbqcX4TghnQBKUe=JtVbxxrtKxA--z-5399hKUeg at mail dot gmail dot com> <CAGSYnCNgAB8G4mVFnA_TEkVyLKn2=ag_ef1ecrNn8HZTJtF1nw at mail dot gmail dot com> <20131206095337 dot GH892 at tucnak dot redhat dot com> <CAKOQZ8yPBfi3=tfxh7aZL0CPExX0EgGN+V3nYF2epERm0u+hPg at mail dot gmail dot com> <20131210113834 dot GQ892 at tucnak dot redhat dot com>
On Tue, Dec 10, 2013 at 3:38 PM, Jakub Jelinek <jakub@redhat.com> wrote:
> On Fri, Dec 06, 2013 at 06:40:52AM -0800, Ian Lance Taylor wrote:
>> There was a recent buggy patch to the demangler that added calls to
>> malloc and realloc (2013-10-25 Gary Benson <gbenson@redhat.com>).
>> That patch must be fixed or reverted before the 4.9 release. The main
>> code in the demangler must not call malloc/realloc.
>>
>> When that patch is fixed, you can use the cplus_demangle_v3_callback
>> function to get a demangler that never calls malloc.
>
> AFAIK Gary is working on a fix, when that is fixed, with the following
> patch libsanitizer (when using libbacktrace for symbolization) will not
> use system malloc/realloc/free for the demangling at all.
>
> Tested on x86_64-linux (-m64/-m32). Note that the changes for the 3 files
> unfortunately will need to be applied upstream to compiler-rt, is that
> possible?
>
> 2013-12-10 Jakub Jelinek <jakub@redhat.com>
>
> * sanitizer_common/sanitizer_symbolizer_libbacktrace.h
> (LibbacktraceSymbolizer::Demangle): New declaration.
> * sanitizer_common/sanitizer_symbolizer_posix_libcdep.cc
sanitizer_symbolizer_posix_libcdep.cc is the file from upstream.
If it gets any change in the GCC variant, I will not be able to do
merges from upstream until the same code is applied upstream.
> (POSIXSymbolizer::Demangle): Use libbacktrace_symbolizer_'s Demangle
> method if possible.
> * sanitizer_common/sanitizer_symbolizer_libbacktrace.cc: Include
> "demangle.h" if SANITIZE_CP_DEMANGLE is defined.
> (struct CplusV3DemangleData): New type.
> (CplusV3DemangleCallback, CplusV3Demangle): New functions.
> (SymbolizeCodePCInfoCallback, SymbolizeCodeCallback,
> SymbolizeDataCallback): Use CplusV3Demangle.
> * sanitizer_common/Makefile.am (AM_CXXFLAGS): Add
> -DSANITIZE_CP_DEMANGLE and -I $(top_srcdir)/../include.
> * libbacktrace/backtrace-rename.h (cplus_demangle_builtin_types,
> cplus_demangle_fill_ctor, cplus_demangle_fill_dtor,
> cplus_demangle_fill_extended_operator, cplus_demangle_fill_name,
> cplus_demangle_init_info, cplus_demangle_mangled_name,
> cplus_demangle_operators, cplus_demangle_print,
> cplus_demangle_print_callback, cplus_demangle_type, cplus_demangle_v3,
> cplus_demangle_v3_callback, is_gnu_v3_mangled_ctor,
> is_gnu_v3_mangled_dtor, java_demangle_v3, java_demangle_v3_callback):
> Define.
> (__asan_internal_memcmp, __asan_internal_strncmp): New prototypes.
> (memcmp, strncmp): Redefine.
> * libbacktrace/Makefile.am (libsanitizer_libbacktrace_la_SOURCES): Add
> ../../libiberty/cp-demangle.c.
> * libbacktrace/bridge.cc (__asan_internal_memcmp,
> __asan_internal_strncmp): New functions.
> * sanitizer_common/Makefile.in: Regenerated.
> * libbacktrace/Makefile.in: Regenerated.
> * configure: Regenerated.
> * configure.ac: Regenerated.
> * config.h.in: Regenerated.
>
> --- libsanitizer/sanitizer_common/sanitizer_symbolizer_libbacktrace.h.jj 2013-12-05 12:04:28.000000000 +0100
> +++ libsanitizer/sanitizer_common/sanitizer_symbolizer_libbacktrace.h 2013-12-10 11:01:26.777371566 +0100
> @@ -29,6 +29,8 @@ class LibbacktraceSymbolizer {
>
> bool SymbolizeData(DataInfo *info);
>
> + const char *Demangle(const char *name);
> +
> private:
> explicit LibbacktraceSymbolizer(void *state) : state_(state) {}
>
> --- libsanitizer/sanitizer_common/sanitizer_symbolizer_posix_libcdep.cc.jj 2013-12-05 12:04:28.000000000 +0100
> +++ libsanitizer/sanitizer_common/sanitizer_symbolizer_posix_libcdep.cc 2013-12-10 11:03:02.971876505 +0100
> @@ -513,6 +513,11 @@ class POSIXSymbolizer : public Symbolize
> SymbolizerScope sym_scope(this);
> if (internal_symbolizer_ != 0)
> return internal_symbolizer_->Demangle(name);
> + if (libbacktrace_symbolizer_ != 0) {
> + const char *demangled = libbacktrace_symbolizer_->Demangle(name);
> + if (demangled)
> + return demangled;
> + }
> return DemangleCXXABI(name);
> }
>
> --- libsanitizer/sanitizer_common/sanitizer_symbolizer_libbacktrace.cc.jj 2013-12-09 14:32:06.000000000 +0100
> +++ libsanitizer/sanitizer_common/sanitizer_symbolizer_libbacktrace.cc 2013-12-10 11:48:19.803830291 +0100
> @@ -20,6 +20,10 @@
> # include "backtrace-supported.h"
> # if SANITIZER_POSIX && BACKTRACE_SUPPORTED && !BACKTRACE_USES_MALLOC
> # include "backtrace.h"
> +# if SANITIZER_CP_DEMANGLE
> +# undef ARRAY_SIZE
> +# include "demangle.h"
> +# endif
> # else
> # define SANITIZER_LIBBACKTRACE 0
> # endif
> @@ -31,6 +35,60 @@ namespace __sanitizer {
>
> namespace {
>
> +#if SANITIZER_CP_DEMANGLE
> +struct CplusV3DemangleData {
> + char *buf;
> + uptr size, allocated;
> +};
> +
> +extern "C" {
> +static void CplusV3DemangleCallback(const char *s, size_t l, void *vdata) {
> + CplusV3DemangleData *data = (CplusV3DemangleData *)vdata;
> + uptr needed = data->size + l + 1;
> + if (needed > data->allocated) {
> + data->allocated *= 2;
> + if (needed > data->allocated)
> + data->allocated = needed;
> + char *buf = (char *)InternalAlloc(data->allocated);
> + if (data->buf) {
> + internal_memcpy(buf, data->buf, data->size);
> + InternalFree(data->buf);
> + }
> + data->buf = buf;
> + }
> + internal_memcpy(data->buf + data->size, s, l);
> + data->buf[data->size + l] = '\0';
> + data->size += l;
> +}
> +} // extern "C"
> +
> +char *CplusV3Demangle(const char *name, bool always_alloc) {
> + CplusV3DemangleData data;
> + data.buf = 0;
> + data.size = 0;
> + data.allocated = 0;
> + if (cplus_demangle_v3_callback(name, DMGL_PARAMS | DMGL_ANSI,
> + CplusV3DemangleCallback, &data)) {
> + if (data.size + 64 > data.allocated)
> + return data.buf;
> + char *buf = internal_strdup(data.buf);
> + InternalFree(data.buf);
> + return buf;
> + }
> + if (data.buf)
> + InternalFree(data.buf);
> + if (always_alloc)
> + return internal_strdup(name);
> + return 0;
> +}
> +#else
> +const char *CplusV3Demangle(const char *name, bool always_alloc) {
> + if (always_alloc)
> + return internal_strdup(name);
> + return 0;
> +}
> +#endif
> +
> struct SymbolizeCodeData {
> AddressInfo *frames;
> uptr n_frames;
> @@ -49,7 +107,7 @@ static int SymbolizeCodePCInfoCallback(v
> info->Clear();
> info->FillAddressAndModuleInfo(addr, cdata->module_name,
> cdata->module_offset);
> - info->function = internal_strdup(function);
> + info->function = CplusV3Demangle(function, true);
> if (filename)
> info->file = internal_strdup(filename);
> info->line = lineno;
> @@ -67,7 +125,7 @@ static void SymbolizeCodeCallback(void *
> info->Clear();
> info->FillAddressAndModuleInfo(addr, cdata->module_name,
> cdata->module_offset);
> - info->function = internal_strdup(symname);
> + info->function = CplusV3Demangle(symname, true);
> cdata->n_frames = 1;
> }
> }
> @@ -76,7 +134,7 @@ static void SymbolizeDataCallback(void *
> uintptr_t symval, uintptr_t symsize) {
> DataInfo *info = (DataInfo *)vdata;
> if (symname && symval) {
> - info->name = internal_strdup(symname);
> + info->name = CplusV3Demangle(symname, true);
> info->start = symval;
> info->size = symsize;
> }
> @@ -121,6 +179,17 @@ bool LibbacktraceSymbolizer::SymbolizeDa
> return true;
> }
>
> +const char *LibbacktraceSymbolizer::Demangle(const char *name) {
> +#if SANITIZER_CP_DEMANGLE
> + const char *demangled = CplusV3Demangle(name, false);
> + if (demangled)
> + return demangled;
> + return name;
> +#else
> + return 0;
> +#endif
> +}
> +
> #else // SANITIZER_LIBBACKTRACE
>
> LibbacktraceSymbolizer *LibbacktraceSymbolizer::get(LowLevelAllocator *alloc) {
> @@ -139,6 +208,10 @@ bool LibbacktraceSymbolizer::SymbolizeDa
> return false;
> }
>
> +const char *LibbacktraceSymbolizer::Demangle(const char *name) {
> + return 0;
> +}
> +
> #endif // SANITIZER_LIBBACKTRACE
>
> } // namespace __sanitizer
> --- libsanitizer/sanitizer_common/Makefile.am.jj 2013-12-10 09:56:36.000000000 +0100
> +++ libsanitizer/sanitizer_common/Makefile.am 2013-12-10 10:41:03.745693274 +0100
> @@ -7,8 +7,10 @@ DEFS = -D_GNU_SOURCE -D_DEBUG -D__STDC_C
> AM_CXXFLAGS = -Wall -W -Wno-unused-parameter -Wwrite-strings -pedantic -Wno-long-long -fPIC -fno-builtin -fno-exceptions -fno-rtti -fomit-frame-pointer -funwind-tables -fvisibility=hidden -Wno-variadic-macros
> AM_CXXFLAGS += $(LIBSTDCXX_RAW_CXX_CXXFLAGS)
> if LIBBACKTRACE_SUPPORTED
> -AM_CXXFLAGS += -DSANITIZER_LIBBACKTRACE -I $(top_srcdir)/../libbacktrace \
> +AM_CXXFLAGS += -DSANITIZER_LIBBACKTRACE -DSANITIZER_CP_DEMANGLE \
> + -I $(top_srcdir)/../libbacktrace \
> -I $(top_builddir)/libbacktrace \
> + -I $(top_srcdir)/../include \
> -include $(top_srcdir)/libbacktrace/backtrace-rename.h
> endif
> ACLOCAL_AMFLAGS = -I m4
> --- libsanitizer/libbacktrace/backtrace-rename.h.jj 2013-12-10 09:55:20.000000000 +0100
> +++ libsanitizer/libbacktrace/backtrace-rename.h 2013-12-10 11:50:24.186187737 +0100
> @@ -14,25 +14,49 @@
> #define backtrace_vector_grow __asan_backtrace_vector_grow
> #define backtrace_vector_release __asan_backtrace_vector_release
>
> +#define cplus_demangle_builtin_types __asan_cplus_demangle_builtin_types
> +#define cplus_demangle_fill_ctor __asan_cplus_demangle_fill_ctor
> +#define cplus_demangle_fill_dtor __asan_cplus_demangle_fill_dtor
> +#define cplus_demangle_fill_extended_operator __asan_cplus_demangle_fill_extended_operator
> +#define cplus_demangle_fill_name __asan_cplus_demangle_fill_name
> +#define cplus_demangle_init_info __asan_cplus_demangle_init_info
> +#define cplus_demangle_mangled_name __asan_cplus_demangle_mangled_name
> +#define cplus_demangle_operators __asan_cplus_demangle_operators
> +#define cplus_demangle_print __asan_cplus_demangle_print
> +#define cplus_demangle_print_callback __asan_cplus_demangle_print_callback
> +#define cplus_demangle_type __asan_cplus_demangle_type
> +#define cplus_demangle_v3 __asan_cplus_demangle_v3
> +#define cplus_demangle_v3_callback __asan_cplus_demangle_v3_callback
> +#define is_gnu_v3_mangled_ctor __asan_is_gnu_v3_mangled_ctor
> +#define is_gnu_v3_mangled_dtor __asan_is_gnu_v3_mangled_dtor
> +#define java_demangle_v3 __asan_java_demangle_v3
> +#define java_demangle_v3_callback __asan_java_demangle_v3_callback
> +
> #ifndef __cplusplus
>
> #include <string.h>
>
> extern void *__asan_internal_memcpy (void *, const void *, size_t);
> extern void *__asan_internal_memset (void *, int, size_t);
> +extern int __asan_internal_memcmp (const void *, const void *, size_t);
> extern int __asan_internal_strcmp (const char *, const char *);
> +extern int __asan_internal_strncmp (const char *, const char *, size_t);
> extern size_t __asan_internal_strlen (const char *);
> extern size_t __asan_internal_strnlen (const char *, size_t);
>
> #undef memcpy
> #undef memset
> +#undef memcmp
> #undef strcmp
> +#undef strncmp
> #undef strlen
> #undef strnlen
>
> #define memcpy(x,y,z) __asan_internal_memcpy (x, y, z)
> #define memset(x,y,z) __asan_internal_memset (x, y, z)
> +#define memcmp(x,y,z) __asan_internal_memcmp (x, y, z)
> #define strcmp(x,y) __asan_internal_strcmp (x, y)
> +#define strncmp(x,y,z) __asan_internal_strncmp (x, y, z)
> #define strlen(x) __asan_internal_strlen (x)
> #ifdef HAVE_DECL_STRNLEN
> #define strnlen(x,y) __asan_internal_strnlen (x, y)
> --- libsanitizer/libbacktrace/Makefile.am.jj 2013-12-10 09:55:20.000000000 +0100
> +++ libsanitizer/libbacktrace/Makefile.am 2013-12-10 10:07:33.115084811 +0100
> @@ -51,6 +51,7 @@ libsanitizer_libbacktrace_la_SOURCES = \
> ../../libbacktrace/internal.h \
> ../../libbacktrace/posix.c \
> ../../libbacktrace/state.c \
> + ../../libiberty/cp-demangle.c \
> bridge.cc
>
> FORMAT_FILES = \
> --- libsanitizer/libbacktrace/bridge.cc.jj 2013-12-10 09:55:20.000000000 +0100
> +++ libsanitizer/libbacktrace/bridge.cc 2013-12-10 11:48:49.038678487 +0100
> @@ -52,11 +52,23 @@ __asan_internal_memset (void *dest, int
> }
>
> int
> +__asan_internal_memcmp (const void *s1, const void *s2, size_t n)
> +{
> + return __sanitizer::internal_memcmp (s1, s2, n);
> +}
> +
> +int
> __asan_internal_strcmp (const char *s1, const char *s2)
> {
> return __sanitizer::internal_strcmp (s1, s2);
> }
>
> +int
> +__asan_internal_strncmp (const char *s1, const char *s2, size_t n)
> +{
> + return __sanitizer::internal_strncmp (s1, s2, n);
> +}
> +
> size_t
> __asan_internal_strlen (const char *str)
> {
> --- libsanitizer/sanitizer_common/Makefile.in.jj 2013-12-10 10:28:02.000000000 +0100
> +++ libsanitizer/sanitizer_common/Makefile.in 2013-12-10 11:38:37.921836716 +0100
> @@ -35,8 +35,10 @@ POST_UNINSTALL = :
> build_triplet = @build@
> host_triplet = @host@
> target_triplet = @target@
> -@LIBBACKTRACE_SUPPORTED_TRUE@am__append_1 = -DSANITIZER_LIBBACKTRACE -I $(top_srcdir)/../libbacktrace \
> +@LIBBACKTRACE_SUPPORTED_TRUE@am__append_1 = -DSANITIZER_LIBBACKTRACE -DSANITIZER_CP_DEMANGLE \
> +@LIBBACKTRACE_SUPPORTED_TRUE@ -I $(top_srcdir)/../libbacktrace \
> @LIBBACKTRACE_SUPPORTED_TRUE@ -I $(top_builddir)/libbacktrace \
> +@LIBBACKTRACE_SUPPORTED_TRUE@ -I $(top_srcdir)/../include \
> @LIBBACKTRACE_SUPPORTED_TRUE@ -include $(top_srcdir)/libbacktrace/backtrace-rename.h
>
> subdir = sanitizer_common
> --- libsanitizer/libbacktrace/Makefile.in.jj 2013-12-10 09:57:05.000000000 +0100
> +++ libsanitizer/libbacktrace/Makefile.in 2013-12-10 11:38:37.858837042 +0100
> @@ -90,7 +90,7 @@ CONFIG_CLEAN_VPATH_FILES =
> LTLIBRARIES = $(noinst_LTLIBRARIES)
> am__DEPENDENCIES_1 =
> am_libsanitizer_libbacktrace_la_OBJECTS = atomic.lo dwarf.lo \
> - fileline.lo posix.lo state.lo bridge.lo
> + fileline.lo posix.lo state.lo cp-demangle.lo bridge.lo
> libsanitizer_libbacktrace_la_OBJECTS = \
> $(am_libsanitizer_libbacktrace_la_OBJECTS)
> DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
> @@ -280,6 +280,7 @@ libsanitizer_libbacktrace_la_SOURCES = \
> ../../libbacktrace/internal.h \
> ../../libbacktrace/posix.c \
> ../../libbacktrace/state.c \
> + ../../libiberty/cp-demangle.c \
> bridge.cc
>
> FORMAT_FILES = \
> @@ -362,6 +363,7 @@ distclean-compile:
> @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alloc.Plo@am__quote@
> @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atomic.Plo@am__quote@
> @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bridge.Plo@am__quote@
> +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cp-demangle.Plo@am__quote@
> @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dwarf.Plo@am__quote@
> @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf.Plo@am__quote@
> @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fileline.Plo@am__quote@
> @@ -428,6 +430,13 @@ state.lo: ../../libbacktrace/state.c
> @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
> @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o state.lo `test -f '../../libbacktrace/state.c' || echo '$(srcdir)/'`../../libbacktrace/state.c
>
> +cp-demangle.lo: ../../libiberty/cp-demangle.c
> +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cp-demangle.lo -MD -MP -MF $(DEPDIR)/cp-demangle.Tpo -c -o cp-demangle.lo `test -f '../../libiberty/cp-demangle.c' || echo '$(srcdir)/'`../../libiberty/cp-demangle.c
> +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/cp-demangle.Tpo $(DEPDIR)/cp-demangle.Plo
> +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../../libiberty/cp-demangle.c' object='cp-demangle.lo' libtool=yes @AMDEPBACKSLASH@
> +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
> +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cp-demangle.lo `test -f '../../libiberty/cp-demangle.c' || echo '$(srcdir)/'`../../libiberty/cp-demangle.c
> +
> elf.lo: ../../libbacktrace/elf.c
> @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT elf.lo -MD -MP -MF $(DEPDIR)/elf.Tpo -c -o elf.lo `test -f '../../libbacktrace/elf.c' || echo '$(srcdir)/'`../../libbacktrace/elf.c
> @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/elf.Tpo $(DEPDIR)/elf.Plo
> --- libsanitizer/configure.jj 2013-12-10 09:55:20.000000000 +0100
> +++ libsanitizer/configure 2013-12-10 10:27:35.569870491 +0100
> @@ -16134,12 +16134,14 @@ ac_config_commands="$ac_config_commands
>
>
>
> -for ac_header in sys/mman.h
> +for ac_header in sys/mman.h alloca.h
> do :
> - ac_fn_c_check_header_mongrel "$LINENO" "sys/mman.h" "ac_cv_header_sys_mman_h" "$ac_includes_default"
> -if test "x$ac_cv_header_sys_mman_h" = x""yes; then :
> + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
> +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
> +eval as_val=\$$as_ac_Header
> + if test "x$as_val" = x""yes; then :
> cat >>confdefs.h <<_ACEOF
> -#define HAVE_SYS_MMAN_H 1
> +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
> _ACEOF
>
> fi
> --- libsanitizer/configure.ac.jj 2013-12-10 09:55:20.000000000 +0100
> +++ libsanitizer/configure.ac 2013-12-10 10:27:25.878930779 +0100
> @@ -208,7 +208,7 @@ AC_SUBST(BACKTRACE_SUPPORTED)
>
> GCC_HEADER_STDINT(gstdint.h)
>
> -AC_CHECK_HEADERS(sys/mman.h)
> +AC_CHECK_HEADERS(sys/mman.h alloca.h)
> if test "$ac_cv_header_sys_mman_h" = "no"; then
> have_mmap=no
> else
> --- libsanitizer/config.h.in.jj 2013-12-10 09:55:20.000000000 +0100
> +++ libsanitizer/config.h.in 2013-12-10 10:26:53.000000000 +0100
> @@ -3,6 +3,9 @@
> /* ELF size: 32 or 64 */
> #undef BACKTRACE_ELF_SIZE
>
> +/* Define to 1 if you have the <alloca.h> header file. */
> +#undef HAVE_ALLOCA_H
> +
> /* Define to 1 if you have the __atomic functions */
> #undef HAVE_ATOMIC_FUNCTIONS
>
>
>
> Jakub