aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbserver
diff options
context:
space:
mode:
authorFrank Ch. Eigler <fche@redhat.com>2019-08-06 11:23:48 -0400
committerFrank Ch. Eigler <fche@redhat.com>2019-08-06 15:09:53 -0400
commit404f29021abaef86a341663444fb069eb1f0282a (patch)
tree76a3409f363d27b2c0fcceaaea2dcf2a86f7e5e6 /gdb/gdbserver
parent046bebe1c0a367687bd693eb4594fcdcba0b8f7e (diff)
downloadgdb-404f29021abaef86a341663444fb069eb1f0282a.zip
gdb-404f29021abaef86a341663444fb069eb1f0282a.tar.gz
gdb-404f29021abaef86a341663444fb069eb1f0282a.tar.bz2
[PR build/24886] disable glibc mcheck support
This patch drops gdb's configury support for glibc's mcheck function. It has been observed to cause false abort()s, because it is thread-unsafe yet interposes every malloc/free operation. So if any library transitively used by gdb also uses threads, then these functions can easily corrupt their own checking data. These days, gcc ASAN and valgrind provide high quality checking, and mcheck is apparently itself being slowly deprecated. So, let's stop linking to it. Attached patch drops the autoconf/Makefile machinery for both gdb and gdbserver. No testsuite-visible impact. IMHO not worth mentioning in NEWS. See also: https://sourceware.org/bugzilla/show_bug.cgi?id=9939 gdb/ChangeLog PR build/24886 * configure.ac: Drop enable-libmcheck support. * configure, config.in: Rebuild. * libmcheck.m4: Remove. * acinclude.m4: Don't include it. * Makefile.in: Don't distribute it. * top.c (print_gdb_configuration): Don't mention it. gdb/gdbserver/ChangeLog PR build/24886 * configure.ac: Drop enable-libmcheck support. * configure, config.in: Rebuild. * acinclude.m4: Don't include it.
Diffstat (limited to 'gdb/gdbserver')
-rw-r--r--gdb/gdbserver/ChangeLog7
-rw-r--r--gdb/gdbserver/acinclude.m43
-rw-r--r--gdb/gdbserver/config.in3
-rwxr-xr-xgdb/gdbserver/configure159
-rw-r--r--gdb/gdbserver/configure.ac9
5 files changed, 53 insertions, 128 deletions
diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog
index a7dccf5..2dda352 100644
--- a/gdb/gdbserver/ChangeLog
+++ b/gdb/gdbserver/ChangeLog
@@ -1,3 +1,10 @@
+2019-08-06 Frank Ch. Eigler <fche@redhat.com>
+
+ PR build/24886
+ * configure.ac: Drop enable-libmcheck support.
+ * configure, config.in: Rebuild.
+ * acinclude.m4: Don't include it.
+
2019-07-19 Alan Hayward <alan.hayward@arm.com>
* configure.srv: Remove Arm xml files.
diff --git a/gdb/gdbserver/acinclude.m4 b/gdb/gdbserver/acinclude.m4
index 96ded3d..3887b16 100644
--- a/gdb/gdbserver/acinclude.m4
+++ b/gdb/gdbserver/acinclude.m4
@@ -3,9 +3,6 @@ sinclude(../../bfd/bfd.m4)
sinclude(../acx_configure_dir.m4)
-# This gets GDB_AC_LIBMCHECK.
-sinclude(../libmcheck.m4)
-
# This gets AM_GDB_WARNINGS.
sinclude(../warning.m4)
diff --git a/gdb/gdbserver/config.in b/gdb/gdbserver/config.in
index 05537df..3991964 100644
--- a/gdb/gdbserver/config.in
+++ b/gdb/gdbserver/config.in
@@ -123,9 +123,6 @@
/* Define to 1 if you have the `dl' library (-ldl). */
#undef HAVE_LIBDL
-/* Define to 1 if you have the `mcheck' library (-lmcheck). */
-#undef HAVE_LIBMCHECK
-
/* Define if the target supports branch tracing. */
#undef HAVE_LINUX_BTRACE
diff --git a/gdb/gdbserver/configure b/gdb/gdbserver/configure
index 0c04fcc..7e5be51 100755
--- a/gdb/gdbserver/configure
+++ b/gdb/gdbserver/configure
@@ -721,7 +721,6 @@ ac_user_opts='
enable_option_checking
enable_maintainer_mode
enable_largefile
-enable_libmcheck
enable_unit_tests
with_ust
with_ust_include
@@ -1367,7 +1366,6 @@ Optional Features:
enable make rules and dependencies not useful (and
sometimes confusing) to the casual installer
--disable-largefile omit support for large files
- --enable-libmcheck Try linking with -lmcheck if available
--enable-unit-tests Enable the inclusion of unit tests when compiling
GDB
--enable-werror treat compile warnings as errors
@@ -1756,52 +1754,6 @@ $as_echo "$ac_res" >&6; }
} # ac_fn_c_check_header_compile
-# ac_fn_c_try_link LINENO
-# -----------------------
-# Try to link conftest.$ac_ext, and return whether this succeeded.
-ac_fn_c_try_link ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- rm -f conftest.$ac_objext conftest$ac_exeext
- if { { ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_link") 2>conftest.err
- ac_status=$?
- if test -s conftest.err; then
- grep -v '^ *+' conftest.err >conftest.er1
- cat conftest.er1 >&5
- mv -f conftest.er1 conftest.err
- fi
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext && {
- test "$cross_compiling" = yes ||
- test -x conftest$ac_exeext
- }; then :
- ac_retval=0
-else
- $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_retval=1
-fi
- # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
- # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
- # interfere with the next link command; also delete a directory that is
- # left behind by Apple's compiler. We do this before executing the actions.
- rm -rf conftest.dSYM conftest_ipa8_conftest.oo
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
- as_fn_set_status $ac_retval
-
-} # ac_fn_c_try_link
-
# ac_fn_c_check_type LINENO TYPE VAR INCLUDES
# -------------------------------------------
# Tests whether TYPE exists after having included INCLUDES, setting cache
@@ -1856,6 +1808,52 @@ $as_echo "$ac_res" >&6; }
} # ac_fn_c_check_type
+# ac_fn_c_try_link LINENO
+# -----------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_link ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ rm -f conftest.$ac_objext conftest$ac_exeext
+ if { { ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ grep -v '^ *+' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ mv -f conftest.er1 conftest.err
+ fi
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ test -x conftest$ac_exeext
+ }; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=1
+fi
+ # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
+ # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
+ # interfere with the next link command; also delete a directory that is
+ # left behind by Apple's compiler. We do this before executing the actions.
+ rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_link
+
# ac_fn_c_check_func LINENO FUNC VAR
# ----------------------------------
# Tests whether FUNC exists, setting the cache variable VAR accordingly
@@ -5827,71 +5825,6 @@ fi
# Set the 'development' global.
. $srcdir/../../bfd/development.sh
-# Enable -lmcheck by default (it provides cheap-enough memory
-# mangling), but turn it off for releases.
-if $development; then
- libmcheck_default=yes
-else
- libmcheck_default=no
-fi
-
- # Check whether --enable-libmcheck was given.
-if test "${enable_libmcheck+set}" = set; then :
- enableval=$enable_libmcheck; case "${enableval}" in
- yes | y) ENABLE_LIBMCHECK="yes" ;;
- no | n) ENABLE_LIBMCHECK="no" ;;
- *) as_fn_error $? "bad value ${enableval} for --enable-libmcheck" "$LINENO" 5 ;;
- esac
-fi
-
-
- if test -z "${ENABLE_LIBMCHECK}"; then
- ENABLE_LIBMCHECK=${libmcheck_default}
- fi
-
- if test "$ENABLE_LIBMCHECK" = "yes" ; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lmcheck" >&5
-$as_echo_n "checking for main in -lmcheck... " >&6; }
-if ${ac_cv_lib_mcheck_main+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lmcheck $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-
-int
-main ()
-{
-return main ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_mcheck_main=yes
-else
- ac_cv_lib_mcheck_main=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mcheck_main" >&5
-$as_echo "$ac_cv_lib_mcheck_main" >&6; }
-if test "x$ac_cv_lib_mcheck_main" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBMCHECK 1
-_ACEOF
-
- LIBS="-lmcheck $LIBS"
-
-fi
-
- fi
-
-
# Check whether we will enable the inclusion of unit tests when
# compiling GDB.
diff --git a/gdb/gdbserver/configure.ac b/gdb/gdbserver/configure.ac
index 574b7c5..0009aac 100644
--- a/gdb/gdbserver/configure.ac
+++ b/gdb/gdbserver/configure.ac
@@ -45,15 +45,6 @@ AC_HEADER_STDC
# Set the 'development' global.
. $srcdir/../../bfd/development.sh
-# Enable -lmcheck by default (it provides cheap-enough memory
-# mangling), but turn it off for releases.
-if $development; then
- libmcheck_default=yes
-else
- libmcheck_default=no
-fi
-GDB_AC_LIBMCHECK(${libmcheck_default})
-
GDB_AC_SELFTEST([
srv_selftest_objs="gdbsupport/selftest.o"
])