aboutsummaryrefslogtreecommitdiff
path: root/libsframe
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2024-04-09 06:43:36 -0700
committerH.J. Lu <hjl.tools@gmail.com>2024-04-10 03:57:46 -0700
commit303da223b1b7401623eaec418b22b7b80d5b16af (patch)
treef59018172e707319eb90d6b08eed73ad5ba28f0e /libsframe
parent219822fd5db6305592b45677a3b38c02b523360e (diff)
downloadgdb-303da223b1b7401623eaec418b22b7b80d5b16af.zip
gdb-303da223b1b7401623eaec418b22b7b80d5b16af.tar.gz
gdb-303da223b1b7401623eaec418b22b7b80d5b16af.tar.bz2
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). Replace AC_FUNC_MMAP with GCC_AC_FUNC_MMAP to avoid the sanitizer configure check failure. bfd/ * configure.ac: Replace AC_FUNC_MMAP with GCC_AC_FUNC_MMAP. * Makefile.in: Regenerated. * aclocal.m4: Likewise. * configure: Likewise. binutils/ * configure.ac: Replace AC_FUNC_MMAP with GCC_AC_FUNC_MMAP. * Makefile.in: Regenerated. * aclocal.m4: Likewise. * configure: Likewise. ld/ * configure.ac: Replace AC_FUNC_MMAP with GCC_AC_FUNC_MMAP. * Makefile.in: Regenerated. * aclocal.m4: Likewise. * configure: Likewise. libctf/ * configure.ac: Replace AC_FUNC_MMAP with GCC_AC_FUNC_MMAP. * Makefile.in: Regenerated. * aclocal.m4: Likewise. * configure: Likewise. libsframe/ * configure.ac: Replace AC_FUNC_MMAP with GCC_AC_FUNC_MMAP. * Makefile.in: Regenerated. * aclocal.m4: Likewise. * configure: Likewise.
Diffstat (limited to 'libsframe')
-rw-r--r--libsframe/Makefile.in1
-rw-r--r--libsframe/aclocal.m41
-rwxr-xr-xlibsframe/configure5
-rw-r--r--libsframe/configure.ac2
4 files changed, 8 insertions, 1 deletions
diff --git a/libsframe/Makefile.in b/libsframe/Makefile.in
index 9e3d268..111d6a3 100644
--- a/libsframe/Makefile.in
+++ b/libsframe/Makefile.in
@@ -126,6 +126,7 @@ am__aclocal_m4_deps = $(top_srcdir)/../bfd/acinclude.m4 \
$(top_srcdir)/../config/depstand.m4 \
$(top_srcdir)/../config/jobserver.m4 \
$(top_srcdir)/../config/lead-dot.m4 \
+ $(top_srcdir)/../config/mmap.m4 \
$(top_srcdir)/../config/override.m4 \
$(top_srcdir)/../config/warnings.m4 \
$(top_srcdir)/../libtool.m4 $(top_srcdir)/../ltoptions.m4 \
diff --git a/libsframe/aclocal.m4 b/libsframe/aclocal.m4
index b0cdd6b..8804d9f 100644
--- a/libsframe/aclocal.m4
+++ b/libsframe/aclocal.m4
@@ -1233,6 +1233,7 @@ m4_include([../config/dejagnu.m4])
m4_include([../config/depstand.m4])
m4_include([../config/jobserver.m4])
m4_include([../config/lead-dot.m4])
+m4_include([../config/mmap.m4])
m4_include([../config/override.m4])
m4_include([../config/warnings.m4])
m4_include([../libtool.m4])
diff --git a/libsframe/configure b/libsframe/configure
index 1d9e5e1..8a9018c 100755
--- a/libsframe/configure
+++ b/libsframe/configure
@@ -12520,6 +12520,9 @@ done
+save_ASAN_OPTIONS="$ASAN_OPTIONS"
+ ASAN_OPTIONS=detect_leaks=0
+ export ASAN_OPTIONS
for ac_func in getpagesize
do :
@@ -12698,6 +12701,8 @@ $as_echo "#define HAVE_MMAP 1" >>confdefs.h
fi
rm -f conftest.mmap conftest.txt
+ ASAN_OPTIONS="$save_ASAN_OPTIONS"
+
for ac_header in byteswap.h endian.h
do :
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
diff --git a/libsframe/configure.ac b/libsframe/configure.ac
index 733517a..d63f270 100644
--- a/libsframe/configure.ac
+++ b/libsframe/configure.ac
@@ -112,7 +112,7 @@ AM_CONDITIONAL(HAVE_LD_VERSION_SCRIPT, test "$have_ld_version_script" = "yes")
AM_MAINTAINER_MODE
AM_INSTALL_LIBBFD
-AC_FUNC_MMAP
+GCC_AC_FUNC_MMAP
AC_CHECK_HEADERS(byteswap.h endian.h)
dnl Check for bswap_{16,32,64}