From 219822fd5db6305592b45677a3b38c02b523360e Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Tue, 9 Apr 2024 06:39:21 -0700 Subject: mmap: Avoid the sanitizer configure check failure When -fsanitize=address,undefined is used to build, the mmap configure check failed with ================================================================= ==231796==ERROR: LeakSanitizer: detected memory leaks Direct leak of 4096 byte(s) in 1 object(s) allocated from: #0 0x7cdd3d0defdf in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:69 #1 0x5750c7f6d72b in main /home/alan/build/gas-san/all/bfd/conftest.c:239 Direct leak of 4096 byte(s) in 1 object(s) allocated from: #0 0x7cdd3d0defdf in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:69 #1 0x5750c7f6d2e1 in main /home/alan/build/gas-san/all/bfd/conftest.c:190 SUMMARY: AddressSanitizer: 8192 byte(s) leaked in 2 allocation(s). Define GCC_AC_FUNC_MMAP with export ASAN_OPTIONS=detect_leaks=0 to avoid the sanitizer configure check failure. config/ * mmap.m4 (GCC_AC_FUNC_MMAP): New. * no-executables.m4 (AC_FUNC_MMAP): Renamed to GCC_AC_FUNC_MMAP. Change AC_FUNC_MMAP to GCC_AC_FUNC_MMAP. libiberty/ * Makefile.in (aclocal_deps): Add $(srcdir)/../config/mmap.m4. * acinclude.m4: Change AC_FUNC_MMAP to GCC_AC_FUNC_MMAP. * aclocal.m4: Regenerated. * configure: Likewise. zlib/ * acinclude.m4: Include ../config/mmap.m4. * Makefile.in: Regenerated. * configure: Likewise. --- zlib/configure | 7 ------- 1 file changed, 7 deletions(-) (limited to 'zlib/configure') diff --git a/zlib/configure b/zlib/configure index 2d55136..0e8a28a 100755 --- a/zlib/configure +++ b/zlib/configure @@ -11245,12 +11245,6 @@ if test -n "$with_cross_host"; then # 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 @@ -11452,7 +11446,6 @@ $as_echo "#define HAVE_MMAP 1" >>confdefs.h 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` -- cgit v1.1