[Define if mmap with MAP_ANON(YMOUS) works.])
fi
])
+
+dnl
+dnl Avoid the sanitizer run-time memory leak failure in the mmap configure
+dnl test. This should be removed when autoconf with commit:
+dnl
+dnl commit 09b6e78d1592ce10fdc975025d699ee41444aa3f
+dnl Author: Paul Eggert <eggert@cs.ucla.edu>
+dnl Date: Fri Feb 5 21:06:20 2016 -0800
+dnl Fix memory leak in AC_FUNC_MMAP
+dnl
+dnl * lib/autoconf/functions.m4 (AC_FUNC_MMAP): Fix memory leak
+dnl in test case, found by configuring with gcc -fsanitize=address.
+dnl
+dnl is in use.
+dnl
+AC_DEFUN([GCC_AC_FUNC_MMAP],
+ save_ASAN_OPTIONS="$ASAN_OPTIONS"
+ ASAN_OPTIONS=detect_leaks=0
+ export ASAN_OPTIONS
+ m4_defn([AC_FUNC_MMAP])
+ ASAN_OPTIONS="$save_ASAN_OPTIONS"
+)
dnl This is a shame. We have to provide a default for some link tests,
dnl similar to the default for run tests.
-m4_define([AC_FUNC_MMAP],
+m4_define([GCC_AC_FUNC_MMAP],
if test x$gcc_no_link = xyes; then
if test "x${ac_cv_func_mmap_fixed_mapped+set}" != xset; then
ac_cv_func_mmap_fixed_mapped=no
fi
fi
if test "x${ac_cv_func_mmap_fixed_mapped}" != xno; then
- m4_defn([AC_FUNC_MMAP])
+ m4_defn([GCC_AC_FUNC_MMAP])
fi)
m4_divert_pop()dnl
$(srcdir)/../config/cet.m4 \
$(srcdir)/../config/enable.m4 \
$(srcdir)/../config/gcc-plugin.m4 \
+ $(srcdir)/../config/mmap.m4 \
$(srcdir)/../config/no-executables.m4 \
$(srcdir)/../config/override.m4 \
$(srcdir)/../config/picflag.m4 \
dnl but erroneously reads past the end of strings. This can cause
dnl a SEGV in some cases.
AC_DEFUN([libiberty_AC_FUNC_STRNCMP],
-[AC_REQUIRE([AC_FUNC_MMAP])
+[AC_REQUIRE([GCC_AC_FUNC_MMAP])
AC_CACHE_CHECK([for working strncmp], ac_cv_func_strncmp_works,
[AC_TRY_RUN([
/* Test by Jim Wilson and Kaveh Ghazi.
m4_include([../config/enable.m4])
m4_include([../config/gcc-plugin.m4])
m4_include([../config/hwcaps.m4])
+m4_include([../config/mmap.m4])
m4_include([../config/no-executables.m4])
m4_include([../config/override.m4])
m4_include([../config/picflag.m4])
fi
fi
if test "x${ac_cv_func_mmap_fixed_mapped}" != xno; then
+ save_ASAN_OPTIONS="$ASAN_OPTIONS"
+ ASAN_OPTIONS=detect_leaks=0
+ export ASAN_OPTIONS
for ac_func in getpagesize
do :
fi
rm -f conftest.mmap conftest.txt
+ ASAN_OPTIONS="$save_ASAN_OPTIONS"
+
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working strncmp" >&5
$(top_srcdir)/../config/override.m4 \
$(top_srcdir)/../ltoptions.m4 $(top_srcdir)/../ltsugar.m4 \
$(top_srcdir)/../ltversion.m4 $(top_srcdir)/../lt~obsolete.m4 \
- $(top_srcdir)/acinclude.m4 \
+ $(top_srcdir)/acinclude.m4 $(top_srcdir)/../config/mmap.m4 \
$(top_srcdir)/../config/no-executables.m4 \
$(top_srcdir)/../libtool.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+sinclude(../config/mmap.m4)
sinclude(../config/no-executables.m4)
sinclude(../libtool.m4)
dnl The lines below arrange for aclocal not to bring libtool.m4
# We ignore --with-system-zlib in this case.
target_all=libzgcj.la
else
- if test x$gcc_no_link = xyes; then
- if test "x${ac_cv_func_mmap_fixed_mapped+set}" != xset; then
- ac_cv_func_mmap_fixed_mapped=no
- fi
-fi
-if test "x${ac_cv_func_mmap_fixed_mapped}" != xno; then
fi
rm -f conftest.mmap conftest.txt
-fi
for ac_func in memcpy strerror
do :
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`