public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [RFC patch] non-release srctrees: --enable-targets=all & 64bit & -lmcheck
@ 2012-05-18 21:14 Jan Kratochvil
  2012-05-20 13:59 ` Alan Modra
  2012-06-01 16:12 ` Tom Tromey
  0 siblings, 2 replies; 7+ messages in thread
From: Jan Kratochvil @ 2012-05-18 21:14 UTC (permalink / raw)
  To: gdb-patches; +Cc: binutils

Hi,

--enable-targets=all commonly discovers checked in regressions:
	http://sourceware.org/ml/binutils/2012-05/msg00271.html
	http://sourceware.org/ml/gdb-patches/2012-05/msg00548.html
	http://sourceware.org/ml/gdb-patches/2012-05/msg00003.html
	http://sourceware.org/ml/gdb-patches/2012-03/msg00279.html
	http://sourceware.org/ml/gdb-patches/2011-03/msg00600.html
	(many more, I did not search too thoroughly)

--enable-64-bit-bfd is required for full --enable-targets=all.

-lmcheck is cheap enough to never be noticed and it also finds checked in
regressions:
	http://sourceware.org/ml/gdb-patches/2012-03/msg00589.html
	http://sourceware.org/ml/gdb-patches/2012-02/msg00612.html
	(many more, I did not search too thoroughly)

As Joel already turns off -Werror (for gdb/) for release branches it could be
just extended for more options.  (This patch requires running autoconf in
bfd/, opcodes/ and gdb/ after changing config/development.m4.)

Unfortuntely this patch cannot be limited only to gdb/ :
-lmcheck could be applied also for ld/, gold/, gas/, gprof/ and binutils/.
I have been targeting only gdb/ and its pre-requisites so far.


Thanks,
Jan


bfd/
2012-05-18  Jan Kratochvil  <jan.kratochvil@redhat.com>

	* acinclude.m4: Include ../config/development.m4.
	* configure: Regenerate.
	* configure.in: Call ACX_DEVELOPMENT.
	(want64): Default it to $development.
	(enable_targets): Default it to all for $development.

config/
2012-05-18  Jan Kratochvil  <jan.kratochvil@redhat.com>

	* development.m4: New file.

gdb/
2012-05-18  Jan Kratochvil  <jan.kratochvil@redhat.com>

	* acinclude.m4: Include ../config/development.m4.
	* config.in: Regenerate.
	* configure: Regenerate.
	* configure.ac: Call ACX_DEVELOPMENT.
	(enable_targets): Default it to all for $development.
	(want64): Default it to $development.
	Call AC_CHECK_LIB for mcheck if $development.
	(ERROR_ON_WARNING): Enable it by default only if $development.

opcodes/
2012-05-18  Jan Kratochvil  <jan.kratochvil@redhat.com>

	* configure: Regenerate.
	* configure.ac: Call ACX_DEVELOPMENT.
	(enable_targets): Default it to all for $development.

diff --git a/bfd/acinclude.m4 b/bfd/acinclude.m4
index d9813bd..6738978 100644
--- a/bfd/acinclude.m4
+++ b/bfd/acinclude.m4
@@ -1,4 +1,5 @@
 sinclude([../config/zlib.m4])
+sinclude([../config/development.m4])
 
 dnl See whether we need to use fopen-bin.h rather than fopen-same.h.
 AC_DEFUN([BFD_BINARY_FOPEN],
diff --git a/bfd/configure.in b/bfd/configure.in
index 9e72c7a..1a5612d 100644
--- a/bfd/configure.in
+++ b/bfd/configure.in
@@ -27,6 +27,7 @@ LT_INIT([dlopen])
 
 # AC_PLUGINS setting $plugins is called by ACX_LARGEFILE.
 ACX_LARGEFILE
+ACX_DEVELOPMENT
 
 AM_CONDITIONAL(PLUGINS, test "$plugins" = "yes")
 
@@ -44,7 +45,7 @@ AC_ARG_ENABLE(64-bit-bfd,
   yes)  want64=true  ;;
   no)   want64=false ;;
   *)    AC_MSG_ERROR(bad value ${enableval} for 64-bit-bfd option) ;;
-esac],[want64=false])dnl
+esac],[want64=$development])dnl
 
 AC_ARG_ENABLE(targets,
 [  --enable-targets        alternative target configurations],
@@ -53,7 +54,12 @@ AC_ARG_ENABLE(targets,
             ;;
   no)       enable_targets= ;;
   *)        enable_targets=$enableval ;;
-esac])dnl
+esac],
+[if $development; then
+   enable_targets=all
+ else
+   enable_targets=
+ fi])
 
 AC_ARG_WITH(mmap,
 [  --with-mmap             try using mmap for BFD input files if available],
diff --git a/config/development.m4 b/config/development.m4
new file mode 100644
index 0000000..2d74cd3
--- /dev/null
+++ b/config/development.m4
@@ -0,0 +1,15 @@
+dnl Copyright (C) 2012 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License.  As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+
+dnl Provide more thorough testing such as --enable-targets=all
+dnl Set to 'true' for development snapshots, 'false' for releases or
+dnl pre-releases.
+
+AC_DEFUN([ACX_DEVELOPMENT],
+[
+  development=true
+])
diff --git a/gdb/acinclude.m4 b/gdb/acinclude.m4
index 9d231e1..ba6679a 100644
--- a/gdb/acinclude.m4
+++ b/gdb/acinclude.m4
@@ -35,6 +35,7 @@ dnl For AM_LANGINFO_CODESET.
 sinclude([../config/codeset.m4])
 
 sinclude([../config/zlib.m4])
+sinclude([../config/development.m4])
 
 #
 # Sometimes the native compiler is a bogus stub for gcc or /usr/ucb/cc. This
diff --git a/gdb/configure.ac b/gdb/configure.ac
index 6433bf9..7d6cedc 100644
--- a/gdb/configure.ac
+++ b/gdb/configure.ac
@@ -26,6 +26,7 @@ AM_MAINTAINER_MODE
 AC_PROG_CC
 AC_USE_SYSTEM_EXTENSIONS
 ACX_LARGEFILE
+ACX_DEVELOPMENT
 AM_PROG_CC_STDC
 
 AC_CONFIG_AUX_DIR(..)
@@ -171,7 +172,12 @@ AS_HELP_STRING([--enable-targets=TARGETS], [alternative target configurations]),
             ;;
   no)       enable_targets= ;;
   *)        enable_targets=$enableval ;;
-esac])
+esac],
+[if $development; then
+   enable_targets=all
+ else
+   enable_targets=
+ fi])
 
 # Check whether to enable 64-bit support on 32-bit hosts
 AC_ARG_ENABLE(64-bit-bfd,
@@ -180,7 +186,7 @@ AS_HELP_STRING([--enable-64-bit-bfd], [64-bit support (on hosts with narrower wo
   yes)  want64=true  ;;
   no)   want64=false ;;
   *)    AC_MSG_ERROR(bad value ${enableval} for 64-bit-bfd option) ;;
-esac],[want64=false])dnl
+esac],[want64=$development])dnl
 
 # Provide defaults for some variables set by the per-host and per-target
 # configuration.
@@ -640,6 +646,11 @@ AC_SUBST(READLINE_DEPS)
 AC_SUBST(READLINE_CFLAGS)
 AC_SUBST(READLINE_TEXI_INCFLAG)
 
+dnl -lmcheck provides cheap enough memory mangling for debugging purposes.
+if $development; then
+  AC_CHECK_LIB(mcheck, main)
+fi
+
 # Generate jit-reader.h
 
 # This is typedeffed to GDB_CORE_ADDR in jit-reader.h
@@ -1822,8 +1833,8 @@ AC_ARG_ENABLE(werror,
      *) AC_MSG_ERROR(bad value ${enableval} for --enable-werror) ;;
    esac])
 
-# Enable -Werror by default when using gcc
-if test "${GCC}" = yes -a -z "${ERROR_ON_WARNING}" ; then
+# Enable -Werror by default when using gcc.  Turn it off for releases.
+if test "${GCC}" = yes -a -z "${ERROR_ON_WARNING}" && $development; then
     ERROR_ON_WARNING=yes
 fi
 
diff --git a/opcodes/configure.in b/opcodes/configure.in
index dadfe4a..f818abe 100644
--- a/opcodes/configure.in
+++ b/opcodes/configure.in
@@ -20,6 +20,7 @@ AM_INIT_AUTOMAKE(opcodes, ${BFD_VERSION})
 AC_PROG_CC
 AC_GNU_SOURCE
 AC_USE_SYSTEM_EXTENSIONS
+ACX_DEVELOPMENT
 
 dnl These must be called before LT_INIT, because it may want
 dnl to call AC_CHECK_PROG.
@@ -39,7 +40,12 @@ AC_ARG_ENABLE(targets,
             ;;
   no)       enable_targets= ;;
   *)        enable_targets=$enableval ;;
-esac])dnl
+esac],
+[if $development; then
+   enable_targets=all
+ else
+   enable_targets=
+ fi])
 
 AM_BINUTILS_WARNINGS
 
diff --git a/bfd/configure b/bfd/configure
index fe51170..b154e25 100755
--- a/bfd/configure
+++ b/bfd/configure
@@ -11985,6 +11985,9 @@ fi
 
 
 
+  development=true
+
+
  if test "$plugins" = "yes"; then
   PLUGINS_TRUE=
   PLUGINS_FALSE='#'
@@ -12010,7 +12013,7 @@ if test "${enable_64_bit_bfd+set}" = set; then :
   *)    as_fn_error "bad value ${enableval} for 64-bit-bfd option" "$LINENO" 5 ;;
 esac
 else
-  want64=false
+  want64=$development
 fi
 
 # Check whether --enable-targets was given.
@@ -12021,9 +12024,16 @@ if test "${enable_targets+set}" = set; then :
   no)       enable_targets= ;;
   *)        enable_targets=$enableval ;;
 esac
+else
+  if $development; then
+   enable_targets=all
+ else
+   enable_targets=
+ fi
 fi
 
 
+
 # Check whether --with-mmap was given.
 if test "${with_mmap+set}" = set; then :
   withval=$with_mmap; case "${withval}" in
diff --git a/gdb/config.in b/gdb/config.in
index a3bd8dd..5767773 100644
--- a/gdb/config.in
+++ b/gdb/config.in
@@ -201,6 +201,9 @@
 /* Define to 1 if you have the `m' library (-lm). */
 #undef HAVE_LIBM
 
+/* Define to 1 if you have the `mcheck' library (-lmcheck). */
+#undef HAVE_LIBMCHECK
+
 /* Define if Python 2.4 is being used. */
 #undef HAVE_LIBPYTHON2_4
 
diff --git a/gdb/configure b/gdb/configure
index de746e8..fca12f1 100755
--- a/gdb/configure
+++ b/gdb/configure
@@ -4277,6 +4277,9 @@ fi
 
 
 
+  development=true
+
+
 
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${CC-cc} option to accept ANSI C" >&5
@@ -5029,6 +5032,12 @@ if test "${enable_targets+set}" = set; then :
   no)       enable_targets= ;;
   *)        enable_targets=$enableval ;;
 esac
+else
+  if $development; then
+   enable_targets=all
+ else
+   enable_targets=
+ fi
 fi
 
 
@@ -5041,7 +5050,7 @@ if test "${enable_64_bit_bfd+set}" = set; then :
   *)    as_fn_error "bad value ${enableval} for 64-bit-bfd option" "$LINENO" 5 ;;
 esac
 else
-  want64=false
+  want64=$development
 fi
 
 # Provide defaults for some variables set by the per-host and per-target
@@ -7034,6 +7043,48 @@ fi
 
 
 
+if $development; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lmcheck" >&5
+$as_echo_n "checking for main in -lmcheck... " >&6; }
+if test "${ac_cv_lib_mcheck_main+set}" = set; 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" = x""yes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBMCHECK 1
+_ACEOF
+
+  LIBS="-lmcheck $LIBS"
+
+fi
+
+fi
+
 # Generate jit-reader.h
 
 # This is typedeffed to GDB_CORE_ADDR in jit-reader.h
@@ -12300,8 +12351,8 @@ if test "${enable_werror+set}" = set; then :
 fi
 
 
-# Enable -Werror by default when using gcc
-if test "${GCC}" = yes -a -z "${ERROR_ON_WARNING}" ; then
+# Enable -Werror by default when using gcc.  Turn it off for releases.
+if test "${GCC}" = yes -a -z "${ERROR_ON_WARNING}" && $development; then
     ERROR_ON_WARNING=yes
 fi
 
diff --git a/opcodes/configure b/opcodes/configure
index dbfca48..f820379 100755
--- a/opcodes/configure
+++ b/opcodes/configure
@@ -4887,6 +4887,9 @@ $as_echo "$ac_cv_safe_to_define___extensions__" >&6; }
 
 
 
+  development=true
+
+
 if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
 set dummy ${ac_tool_prefix}ar; ac_word=$2
@@ -11134,7 +11137,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11137 "configure"
+#line 11140 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11240,7 +11243,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11243 "configure"
+#line 11246 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11486,9 +11489,16 @@ if test "${enable_targets+set}" = set; then :
   no)       enable_targets= ;;
   *)        enable_targets=$enableval ;;
 esac
+else
+  if $development; then
+   enable_targets=all
+ else
+   enable_targets=
+ fi
 fi
 
 
+
 GCC_WARN_CFLAGS="-W -Wall -Wstrict-prototypes -Wmissing-prototypes"
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [RFC patch] non-release srctrees: --enable-targets=all & 64bit & -lmcheck
  2012-05-18 21:14 [RFC patch] non-release srctrees: --enable-targets=all & 64bit & -lmcheck Jan Kratochvil
@ 2012-05-20 13:59 ` Alan Modra
  2012-05-20 14:10   ` Jan Kratochvil
  2012-06-01 16:12 ` Tom Tromey
  1 sibling, 1 reply; 7+ messages in thread
From: Alan Modra @ 2012-05-20 13:59 UTC (permalink / raw)
  To: Jan Kratochvil; +Cc: gdb-patches, binutils

On Fri, May 18, 2012 at 11:14:10PM +0200, Jan Kratochvil wrote:
> --enable-targets=all commonly discovers checked in regressions:
> 	http://sourceware.org/ml/binutils/2012-05/msg00271.html

Not in this particular case.  I built binutils for native x86_64-linux
--enable-targes=all.  In fact, I also built 115 different cross
targets (needed to test gas reasonably well).  I've now added one more
target. :)

> 	http://sourceware.org/ml/gdb-patches/2012-05/msg00548.html
> 	http://sourceware.org/ml/gdb-patches/2012-05/msg00003.html
> 	http://sourceware.org/ml/gdb-patches/2012-03/msg00279.html
> 	http://sourceware.org/ml/gdb-patches/2011-03/msg00600.html
> 	(many more, I did not search too thoroughly)

There are cases where building with --enable-targets=all hides bugs,
for example
http://sourceware.org/ml/binutils/2012-05/msg00219.html

> --enable-64-bit-bfd is required for full --enable-targets=all.

Always building with a 64-bit bfd hides another class of bug.

I'm not in favour of this patch.  Yes, it may help first-time
contributors in testing their patches, but means yet another change in
configure options for anyone past that stage.  (Hey, I tested my patch
on 32-bit i686-linux and 64-bit x86_64-linux and you say it's not
64-bit clean??)

-- 
Alan Modra
Australia Development Lab, IBM

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [RFC patch] non-release srctrees: --enable-targets=all & 64bit & -lmcheck
  2012-05-20 13:59 ` Alan Modra
@ 2012-05-20 14:10   ` Jan Kratochvil
  0 siblings, 0 replies; 7+ messages in thread
From: Jan Kratochvil @ 2012-05-20 14:10 UTC (permalink / raw)
  To: binutils; +Cc: gdb-patches

On Sun, 20 May 2012 15:59:16 +0200, Alan Modra wrote:
> > --enable-64-bit-bfd is required for full --enable-targets=all.
> 
> Always building with a 64-bit bfd hides another class of bug.

Yes, I run nightly build without --enable-64-bit-bfd here to test such bugs.

The goal of my proposal was to catch most of the bugs already by the
submitter.  We cannot want from all submitters to test too many combinations
(I do 3*17 = 46 runs; it equals a bit less due to some limitations).
So we should choose some best single catch-almost-all configuration.

While there are countercases I believe >90% of bugs get more caught by
--enable-targets=all --enable-64-bit-bfd than by any other settings.

After I know submitters run --enable-targets=all themselves I probably start
also runs without --enable-targets=all to test the other case, also I would
start new runs running -lmcheck.


> I'm not in favour of this patch.  Yes, it may help first-time
> contributors in testing their patches, but means yet another change in
> configure options for anyone past that stage.

I find the largest disadvantage that after switching to development=false for
the release the srctree becomes "untested".  Even -lmcheck may hide some bugs.
But there is also the pre-release gdb-x.y.90.z phase to catch those bugs.


I just find current regressions happenning almost daily without this patch to
be too boring.


Thanks,
Jan

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [RFC patch] non-release srctrees: --enable-targets=all & 64bit & -lmcheck
  2012-05-18 21:14 [RFC patch] non-release srctrees: --enable-targets=all & 64bit & -lmcheck Jan Kratochvil
  2012-05-20 13:59 ` Alan Modra
@ 2012-06-01 16:12 ` Tom Tromey
  2012-06-01 18:21   ` [gdb commit] " Jan Kratochvil
  1 sibling, 1 reply; 7+ messages in thread
From: Tom Tromey @ 2012-06-01 16:12 UTC (permalink / raw)
  To: Jan Kratochvil; +Cc: gdb-patches, binutils

>>>>> "Jan" == Jan Kratochvil <jan.kratochvil@redhat.com> writes:

Jan> --enable-targets=all commonly discovers checked in regressions:
[...]
Jan> --enable-64-bit-bfd is required for full --enable-targets=all.

Since Alan didn't want this, I think it would make sense to drop this
part of the patch, but request that gdb developers use these settings
anyway.

If there are still a lot of regressions after this, we can ask again.

Jan> -lmcheck is cheap enough to never be noticed and it also finds checked in
Jan> regressions:

I'm in favor of this part.  Could you separate out just the gdb part and
put it in?

Tom

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [gdb commit] [RFC patch] non-release srctrees: --enable-targets=all & 64bit & -lmcheck
  2012-06-01 16:12 ` Tom Tromey
@ 2012-06-01 18:21   ` Jan Kratochvil
  2012-07-20 14:01     ` H.J. Lu
  0 siblings, 1 reply; 7+ messages in thread
From: Jan Kratochvil @ 2012-06-01 18:21 UTC (permalink / raw)
  To: Tom Tromey; +Cc: gdb-patches, binutils

On Fri, 01 Jun 2012 18:11:43 +0200, Tom Tromey wrote:
> >>>>> "Jan" == Jan Kratochvil <jan.kratochvil@redhat.com> writes:
> Jan> -lmcheck is cheap enough to never be noticed and it also finds checked in
> Jan> regressions:
> 
> I'm in favor of this part.  Could you separate out just the gdb part and
> put it in?

Checked in only the gdb/ part.


Thanks,
Jan


http://sourceware.org/ml/gdb-cvs/2012-06/msg00005.html

--- src/gdb/ChangeLog	2012/06/01 16:37:56	1.14309
+++ src/gdb/ChangeLog	2012/06/01 18:20:16	1.14310
@@ -1,3 +1,11 @@
+2012-06-01  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+	* configure.ac (development): Define new variable.
+	Call AC_CHECK_LIB for mcheck if $development.
+	(ERROR_ON_WARNING): Enable it by default only if $development.
+	* config.in: Regenerate.
+	* configure: Regenerate.
+
 2012-06-01  Siddhesh Poyarekar  <siddhesh@redhat.com>
 
 	* target.c (target_read_memory): Make LEN argument as size_t.
--- src/gdb/config.in	2012/05/11 18:20:26	1.143
+++ src/gdb/config.in	2012/06/01 18:20:18	1.144
--- src/gdb/configure	2012/05/20 20:35:18	1.365
+++ src/gdb/configure	2012/06/01 18:20:18	1.366
--- src/gdb/configure.ac	2012/05/20 20:35:19	1.176
+++ src/gdb/configure.ac	2012/06/01 18:20:18	1.177
@@ -18,6 +18,11 @@
 
 dnl Process this file with autoconf to produce a configure script.
 
+dnl Provide more thorough testing by -lmcheck.
+dnl Set it to 'true' for development snapshots, 'false' for releases or
+dnl pre-releases.
+development=true
+
 AC_PREREQ(2.59)dnl
 AC_INIT(main.c)
 AC_CONFIG_HEADER(config.h:config.in)
@@ -640,6 +645,11 @@
 AC_SUBST(READLINE_CFLAGS)
 AC_SUBST(READLINE_TEXI_INCFLAG)
 
+dnl -lmcheck provides cheap enough memory mangling for debugging purposes.
+if $development; then
+  AC_CHECK_LIB(mcheck, main)
+fi
+
 # Generate jit-reader.h
 
 # This is typedeffed to GDB_CORE_ADDR in jit-reader.h
@@ -1822,8 +1832,8 @@
      *) AC_MSG_ERROR(bad value ${enableval} for --enable-werror) ;;
    esac])
 
-# Enable -Werror by default when using gcc
-if test "${GCC}" = yes -a -z "${ERROR_ON_WARNING}" ; then
+# Enable -Werror by default when using gcc.  Turn it off for releases.
+if test "${GCC}" = yes -a -z "${ERROR_ON_WARNING}" && $development; then
     ERROR_ON_WARNING=yes
 fi
 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [gdb commit] [RFC patch] non-release srctrees: --enable-targets=all & 64bit & -lmcheck
  2012-06-01 18:21   ` [gdb commit] " Jan Kratochvil
@ 2012-07-20 14:01     ` H.J. Lu
  2012-07-23 14:43       ` Tom Tromey
  0 siblings, 1 reply; 7+ messages in thread
From: H.J. Lu @ 2012-07-20 14:01 UTC (permalink / raw)
  To: Jan Kratochvil; +Cc: Tom Tromey, gdb-patches, binutils

On Fri, Jun 1, 2012 at 11:21 AM, Jan Kratochvil
<jan.kratochvil@redhat.com> wrote:
> On Fri, 01 Jun 2012 18:11:43 +0200, Tom Tromey wrote:
>> >>>>> "Jan" == Jan Kratochvil <jan.kratochvil@redhat.com> writes:
>> Jan> -lmcheck is cheap enough to never be noticed and it also finds checked in
>> Jan> regressions:
>>
>> I'm in favor of this part.  Could you separate out just the gdb part and
>> put it in?
>
> Checked in only the gdb/ part.
>
>
> Thanks,
> Jan
>
>
> http://sourceware.org/ml/gdb-cvs/2012-06/msg00005.html
>
> --- src/gdb/ChangeLog   2012/06/01 16:37:56     1.14309
> +++ src/gdb/ChangeLog   2012/06/01 18:20:16     1.14310
> @@ -1,3 +1,11 @@
> +2012-06-01  Jan Kratochvil  <jan.kratochvil@redhat.com>
> +
> +       * configure.ac (development): Define new variable.
> +       Call AC_CHECK_LIB for mcheck if $development.
> +       (ERROR_ON_WARNING): Enable it by default only if $development.
> +       * config.in: Regenerate.
> +       * configure: Regenerate.
> +
>  2012-06-01  Siddhesh Poyarekar  <siddhesh@redhat.com>
>
>         * target.c (target_read_memory): Make LEN argument as size_t.
> --- src/gdb/config.in   2012/05/11 18:20:26     1.143
> +++ src/gdb/config.in   2012/06/01 18:20:18     1.144
> --- src/gdb/configure   2012/05/20 20:35:18     1.365
> +++ src/gdb/configure   2012/06/01 18:20:18     1.366
> --- src/gdb/configure.ac        2012/05/20 20:35:19     1.176
> +++ src/gdb/configure.ac        2012/06/01 18:20:18     1.177
> @@ -18,6 +18,11 @@
>
>  dnl Process this file with autoconf to produce a configure script.
>
> +dnl Provide more thorough testing by -lmcheck.
> +dnl Set it to 'true' for development snapshots, 'false' for releases or
> +dnl pre-releases.
> +development=true
> +
>  AC_PREREQ(2.59)dnl
>  AC_INIT(main.c)
>  AC_CONFIG_HEADER(config.h:config.in)
> @@ -640,6 +645,11 @@
>  AC_SUBST(READLINE_CFLAGS)
>  AC_SUBST(READLINE_TEXI_INCFLAG)
>
> +dnl -lmcheck provides cheap enough memory mangling for debugging purposes.
> +if $development; then
> +  AC_CHECK_LIB(mcheck, main)
> +fi
> +
>  # Generate jit-reader.h
>
>  # This is typedeffed to GDB_CORE_ADDR in jit-reader.h
> @@ -1822,8 +1832,8 @@
>       *) AC_MSG_ERROR(bad value ${enableval} for --enable-werror) ;;
>     esac])
>
> -# Enable -Werror by default when using gcc
> -if test "${GCC}" = yes -a -z "${ERROR_ON_WARNING}" ; then
> +# Enable -Werror by default when using gcc.  Turn it off for releases.
> +if test "${GCC}" = yes -a -z "${ERROR_ON_WARNING}" && $development; then
>      ERROR_ON_WARNING=yes
>  fi
>

This caused:

http://sourceware.org/bugzilla/show_bug.cgi?id=14377

-- 
H.J.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [gdb commit] [RFC patch] non-release srctrees: --enable-targets=all & 64bit & -lmcheck
  2012-07-20 14:01     ` H.J. Lu
@ 2012-07-23 14:43       ` Tom Tromey
  0 siblings, 0 replies; 7+ messages in thread
From: Tom Tromey @ 2012-07-23 14:43 UTC (permalink / raw)
  To: H.J. Lu; +Cc: Jan Kratochvil, gdb-patches, binutils

HJ> http://sourceware.org/bugzilla/show_bug.cgi?id=14377

Please read comments #3 and #4 in the bug report.  This patch may have
exposed a latent bug; or it may be that the debuginfo in your program is
incorrect.  In any case it is unlikely that this problem is the direct
result of this patch.

Tom

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2012-07-23 14:43 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-18 21:14 [RFC patch] non-release srctrees: --enable-targets=all & 64bit & -lmcheck Jan Kratochvil
2012-05-20 13:59 ` Alan Modra
2012-05-20 14:10   ` Jan Kratochvil
2012-06-01 16:12 ` Tom Tromey
2012-06-01 18:21   ` [gdb commit] " Jan Kratochvil
2012-07-20 14:01     ` H.J. Lu
2012-07-23 14:43       ` Tom Tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).