Make it easy to make --disable-werror the default for both binutils and gdb

The goal of this patch is to provide an easy way to make
--disable-werror the default when building binutils, or the parts
of binutils that need to get built when building GDB. In development
mode, we want to continue making -Werror the default with GCC.
But, when making releases, I think we want to make it as easy as
possible for regular users to successfully build from sources.

GDB already has this kind of feature to turn -Werror as well as
the use of the libmcheck library. As GDB Release Manager, I take
advantage of it to turn those off after having cut the branch.
I'd like to be able to do the same for the binutils bits. And
perhaps Tristan will want to do the same for his releases too
(not sure, binutils builders might be a little savvier than GDB
builders).

This patch introduces a new file, called development.sh, which
just sets a variable called $development. In our development branches
(Eg. "master"), it's set to true. But setting it to false would allow
us to change the default behavior of various development-related
features to be turned off; in this case, it turns off the use of
-Werror by default (use --enable-werror to turn it back on).

bfd/ChangeLog:

        * development.sh: New file.
        * warning.m4 (AM_BINUTILS_WARNINGS): Source bfd/development.sh.
        Make -Werror the default with GCC only if DEVELOPMENT is true.
        * Makefile.am (CONFIG_STATUS_DEPENDENCIES): Add
        $(srcdir)/development.sh.
        * Makefile.in, configure: Regenerate.

binutils/ChangeLog:

        * Makefile.am (CONFIG_STATUS_DEPENDENCIES): Add dependency on
        bfd's development.sh.
        * Makefile.in, configure: Regenerate.

gas/ChangeLog:

        * Makefile.am (CONFIG_STATUS_DEPENDENCIES): Add dependency on
        bfd's development.sh.
        * Makefile.in, configure: Regenerate.

gold/ChangeLog:

        * Makefile.am (CONFIG_STATUS_DEPENDENCIES): New.
        * Makefile.in, configure: Regenerate.

gprof/ChangeLog:

        * Makefile.am (CONFIG_STATUS_DEPENDENCIES): Add dependency on
        bfd's development.sh.
        * Makefile.in, configure: Regenerate.

ld/ChangeLog:

        * Makefile.am (CONFIG_STATUS_DEPENDENCIES): Add dependency on
        bfd's development.sh.
        * Makefile.in, configure: Regenerate.

opcodes/ChangeLog:

        * Makefile.am (CONFIG_STATUS_DEPENDENCIES): Add dependency on
        bfd's development.sh.
        * Makefile.in, configure: Regenerate.

gdb/ChangeLog:

        * development.sh: Delete.
        * Makefile.in (config.status): Adjust dependency on development.sh.
        * configure.ac: Adjust development.sh source call.
        * configure: Regenerate.

gdb/gdbserver/ChangeLog:

        * configure.ac: Adjust development.sh source call.
        * Makefile.in (config.status): Adjust dependency on development.sh.
        * configure: Regenerate.

Tested on x86_64-linux by building two ways: One with DEVELOPMENT
set to true, and one with DEVELOPMENT set to false. In the first
case, I could see the use of -Werror, while it disappeared in
the second case.
This commit is contained in:
Joel Brobecker 2014-05-19 14:46:01 -07:00
parent a872e241e2
commit 270c993744
38 changed files with 140 additions and 39 deletions

View File

@ -1,3 +1,12 @@
2014-06-05 Joel Brobecker <brobecker@adacore.com>
* development.sh: New file.
* warning.m4 (AM_BINUTILS_WARNINGS): Source bfd/development.sh.
Make -Werror the default with GCC only if DEVELOPMENT is true.
* Makefile.am (CONFIG_STATUS_DEPENDENCIES): Add
$(srcdir)/development.sh.
* Makefile.in, configure: Regenerate.
2014-06-04 Will Newton <will.newton@linaro.org>
* elfnn-aarch64.c (tpoff_base): Make test of tls_sec

View File

@ -741,7 +741,8 @@ OPTIONAL_BACKENDS_CFILES = \
CONFIG_STATUS_DEPENDENCIES = \
$(srcdir)/configure.in \
$(srcdir)/config.bfd \
$(srcdir)/configure.host
$(srcdir)/configure.host \
$(srcdir)/development.sh
# These are defined by configure.in:
WORDSIZE = @wordsize@

View File

@ -1045,7 +1045,8 @@ OPTIONAL_BACKENDS_CFILES = \
CONFIG_STATUS_DEPENDENCIES = \
$(srcdir)/configure.in \
$(srcdir)/config.bfd \
$(srcdir)/configure.host
$(srcdir)/configure.host \
$(srcdir)/development.sh
# These are defined by configure.in:

7
bfd/configure vendored
View File

@ -12158,6 +12158,9 @@ fi
# Set the 'development' global.
. $srcdir/../bfd/development.sh
GCC_WARN_CFLAGS="-W -Wall -Wstrict-prototypes -Wmissing-prototypes"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@ -12192,8 +12195,8 @@ case "${host}" in
*) ;;
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}" -a "$development" = true ; then
ERROR_ON_WARNING=yes
fi

View File

@ -15,7 +15,5 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# Set to 'true' for development snapshots, 'false' for releases and
# pre-releases. When true, provide more thorough testing with
# -lmcheck.
# Controls whether to enable development-mode features by default.
development=true

View File

@ -18,6 +18,9 @@ dnl <http://www.gnu.org/licenses/>.
dnl
AC_DEFUN([AM_BINUTILS_WARNINGS],[
# Set the 'development' global.
. $srcdir/../bfd/development.sh
GCC_WARN_CFLAGS="-W -Wall -Wstrict-prototypes -Wmissing-prototypes"
AC_EGREP_CPP([^[0-3]$],[__GNUC__],,GCC_WARN_CFLAGS="$GCC_WARN_CFLAGS -Wshadow")
@ -39,8 +42,8 @@ case "${host}" in
*) ;;
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}" -a "$development" = true ; then
ERROR_ON_WARNING=yes
fi

View File

@ -1,3 +1,9 @@
2014-06-05 Joel Brobecker <brobecker@adacore.com>
* Makefile.am (CONFIG_STATUS_DEPENDENCIES): Add dependency on
bfd's development.sh.
* Makefile.in, configure: Regenerate.
2014-05-16 Jon Turney <jon.turney@dronecode.org.uk>
* objcopy.c (is_nondebug_keep_contents_section): New function.

View File

@ -514,7 +514,8 @@ all: info
# We extract version from bfd/configure.in, make sure to rerun configure
# when BFD's version changes.
CONFIG_STATUS_DEPENDENCIES = $(BFDDIR)/configure.in
CONFIG_STATUS_DEPENDENCIES = $(BFDDIR)/configure.in \
$(BFDDIR)/development.sh
DISTCLEANFILES = sysroff.c sysroff.h site.exp site.bak embedspu

View File

@ -616,7 +616,9 @@ EXTRA_DIST = arparse.c arparse.h arlex.c nlmheader.c sysinfo.c sysinfo.h \
# We extract version from bfd/configure.in, make sure to rerun configure
# when BFD's version changes.
CONFIG_STATUS_DEPENDENCIES = $(BFDDIR)/configure.in
CONFIG_STATUS_DEPENDENCIES = $(BFDDIR)/configure.in \
$(BFDDIR)/development.sh
DISTCLEANFILES = sysroff.c sysroff.h site.exp site.bak embedspu
MOSTLYCLEANFILES = sysinfo$(EXEEXT_FOR_BUILD) bin2c$(EXEEXT_FOR_BUILD) \
binutils.log binutils.sum abcdefgh*

7
binutils/configure vendored
View File

@ -11592,6 +11592,9 @@ _ACEOF
# Set the 'development' global.
. $srcdir/../bfd/development.sh
GCC_WARN_CFLAGS="-W -Wall -Wstrict-prototypes -Wmissing-prototypes"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@ -11626,8 +11629,8 @@ case "${host}" in
*) ;;
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}" -a "$development" = true ; then
ERROR_ON_WARNING=yes
fi

View File

@ -1,3 +1,9 @@
2014-06-05 Joel Brobecker <brobecker@adacore.com>
* Makefile.am (CONFIG_STATUS_DEPENDENCIES): Add dependency on
bfd's development.sh.
* Makefile.in, configure: Regenerate.
2014-06-03 Nick Clifton <nickc@redhat.com>
* config/tc-msp430.c (OPTION_WARN_INTR_NOPS): Use y instead of z.

View File

@ -693,4 +693,6 @@ de-stage3:
- (cd stage3 ; rm -f as$(EXEEXT) ; mv -f * ..)
- rmdir stage3
CONFIG_STATUS_DEPENDENCIES = $(BFDDIR)/configure.in $(srcdir)/configure.tgt
CONFIG_STATUS_DEPENDENCIES = $(BFDDIR)/configure.in \
$(srcdir)/configure.tgt \
$(BFDDIR)/development.sh

View File

@ -677,7 +677,10 @@ MOSTLYCLEANFILES = $(STAGESTUFF) core \
testsuite/site.exp site.bak site.exp stage stage1 stage2
against = stage2
CONFIG_STATUS_DEPENDENCIES = $(BFDDIR)/configure.in $(srcdir)/configure.tgt
CONFIG_STATUS_DEPENDENCIES = $(BFDDIR)/configure.in \
$(srcdir)/configure.tgt \
$(BFDDIR)/development.sh
all: config.h
$(MAKE) $(AM_MAKEFLAGS) all-recursive

7
gas/configure vendored
View File

@ -11575,6 +11575,9 @@ fi
using_cgen=no
# Set the 'development' global.
. $srcdir/../bfd/development.sh
GCC_WARN_CFLAGS="-W -Wall -Wstrict-prototypes -Wmissing-prototypes"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@ -11609,8 +11612,8 @@ case "${host}" in
*) ;;
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}" -a "$development" = true ; then
ERROR_ON_WARNING=yes
fi

View File

@ -1,3 +1,10 @@
2014-06-05 Joel Brobecker <brobecker@adacore.com>
* development.sh: Delete.
* Makefile.in (config.status): Adjust dependency on development.sh.
* configure.ac: Adjust development.sh source call.
* configure: Regenerate.
2014-06-04 Doug Evans <xdje42@gmail.com>
* guile/scm-breakpoint.c (struct gdbscm_breakpoint_object): New members

View File

@ -1476,7 +1476,7 @@ stamp-h: $(srcdir)/config.in config.status
CONFIG_LINKS= \
$(SHELL) config.status
config.status: $(srcdir)/configure configure.tgt configure.host development.sh
config.status: $(srcdir)/configure configure.tgt configure.host ../bfd/development.sh
$(SHELL) config.status --recheck
ACLOCAL = aclocal

2
gdb/configure vendored
View File

@ -2714,7 +2714,7 @@ fi
# Set the 'development' global.
. $srcdir/development.sh
. $srcdir/../bfd/development.sh
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'

View File

@ -24,7 +24,7 @@ AC_CONFIG_HEADER(config.h:config.in)
AM_MAINTAINER_MODE
# Set the 'development' global.
. $srcdir/development.sh
. $srcdir/../bfd/development.sh
AC_PROG_CC
AC_USE_SYSTEM_EXTENSIONS

View File

@ -1,3 +1,10 @@
2014-06-05 Joel Brobecker <brobecker@adacore.com>
* development.sh: Delete.
* Makefile.in (config.status): Adjust dependency on development.sh.
* configure.ac: Adjust development.sh source call.
* configure: Regenerate.
2014-06-02 Pedro Alves <palves@redhat.com>
* ax.c (gdb_free_agent_expr): New function.

View File

@ -390,7 +390,7 @@ $(GNULIB_BUILDDIR)/Makefile: $(srcdir)/../gnulib/Makefile.in config.status
CONFIG_LINKS= \
$(SHELL) config.status
config.status: configure configure.srv $(srcdir)/../development.sh
config.status: configure configure.srv $(srcdir)/../../bfd/development.sh
$(SHELL) ./config.status --recheck
# automatic rebuilding in automake-generated Makefiles requires

View File

@ -4324,7 +4324,7 @@ fi
# Set the 'development' global.
. $srcdir/../development.sh
. $srcdir/../../bfd/development.sh
# Enable -lmcheck by default (it provides cheap-enough memory
# mangling), but turn it off for releases.

View File

@ -41,7 +41,7 @@ AC_HEADER_STDC
AC_FUNC_ALLOCA
# Set the 'development' global.
. $srcdir/../development.sh
. $srcdir/../../bfd/development.sh
# Enable -lmcheck by default (it provides cheap-enough memory
# mangling), but turn it off for releases.

View File

@ -1,3 +1,8 @@
2014-06-05 Joel Brobecker <brobecker@adacore.com>
* Makefile.am (CONFIG_STATUS_DEPENDENCIES): New.
* Makefile.in, configure: Regenerate.
2014-06-03 Alan Modra <amodra@gmail.com>
* powerpc.cc (addis_12_2): Define.

View File

@ -197,6 +197,8 @@ dwp_LDADD = libgold.a $(LIBIBERTY) $(GOLD_LDADD) $(LIBINTL) $(THREADSLIB) \
$(LIBDL)
dwp_LDFLAGS = $(GOLD_LDFLAGS)
CONFIG_STATUS_DEPENDENCIES = $(srcdir)/../bfd/development.sh
# Use an explicit dependency for the bison generated header file.
expression.$(OBJEXT): yyscript.h
script-sections.$(OBJEXT): yyscript.h

View File

@ -564,6 +564,7 @@ dwp_LDADD = libgold.a $(LIBIBERTY) $(GOLD_LDADD) $(LIBINTL) $(THREADSLIB) \
$(LIBDL)
dwp_LDFLAGS = $(GOLD_LDFLAGS)
CONFIG_STATUS_DEPENDENCIES = $(srcdir)/../bfd/development.sh
POTFILES = $(CCFILES) $(HFILES) $(TARGETSOURCES)
@GCC_TRUE@@NATIVE_LINKER_TRUE@ld1_SOURCES = $(sources_var)
@GCC_TRUE@@NATIVE_LINKER_TRUE@ld1_DEPENDENCIES = $(deps_var) gcctestdir1/ld

7
gold/configure vendored
View File

@ -6630,6 +6630,9 @@ fi
# Set the 'development' global.
. $srcdir/../bfd/development.sh
GCC_WARN_CFLAGS="-W -Wall -Wstrict-prototypes -Wmissing-prototypes"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@ -6664,8 +6667,8 @@ case "${host}" in
*) ;;
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}" -a "$development" = true ; then
ERROR_ON_WARNING=yes
fi

View File

@ -1,3 +1,9 @@
2014-06-05 Joel Brobecker <brobecker@adacore.com>
* Makefile.am (CONFIG_STATUS_DEPENDENCIES): Add dependency on
bfd's development.sh.
* Makefile.in, configure: Regenerate.
2014-03-12 Alan Modra <amodra@gmail.com>
* Makefile.in: Regenerate.

View File

@ -60,7 +60,8 @@ diststuff: $(BUILT_SOURCES) info $(man_MANS)
# We extract version from bfd/configure.in, make sure to rerun configure
# when BFD's version changes.
CONFIG_STATUS_DEPENDENCIES = $(BFDDIR)/configure.in
CONFIG_STATUS_DEPENDENCIES = $(BFDDIR)/configure.in \
$(BFDDIR)/development.sh
# This empty rule is a hack against gmake patched by Apple.
%.o:%.m

View File

@ -325,7 +325,9 @@ EXTRA_DIST = $(BUILT_SOURCES) bbconv.pl $(man_MANS)
# We extract version from bfd/configure.in, make sure to rerun configure
# when BFD's version changes.
CONFIG_STATUS_DEPENDENCIES = $(BFDDIR)/configure.in
CONFIG_STATUS_DEPENDENCIES = $(BFDDIR)/configure.in \
$(BFDDIR)/development.sh
POTFILES = $(sources) $(noinst_HEADERS)
MANCONF = -Dman
TEXI2POD = perl $(srcdir)/../etc/texi2pod.pl $(AM_MAKEINFOFLAGS)

7
gprof/configure vendored
View File

@ -12004,6 +12004,9 @@ fi
# Set the 'development' global.
. $srcdir/../bfd/development.sh
GCC_WARN_CFLAGS="-W -Wall -Wstrict-prototypes -Wmissing-prototypes"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@ -12038,8 +12041,8 @@ case "${host}" in
*) ;;
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}" -a "$development" = true ; then
ERROR_ON_WARNING=yes
fi

View File

@ -1,3 +1,9 @@
2014-06-05 Joel Brobecker <brobecker@adacore.com>
* Makefile.am (CONFIG_STATUS_DEPENDENCIES): Add dependency on
bfd's development.sh.
* Makefile.in, configure: Regenerate.
2014-06-02 Alan Modra <amodra@gmail.com>
* emulparams/elf32bfin.sh: Rename from bfin.sh.

View File

@ -2057,7 +2057,8 @@ MAINTAINERCLEANFILES = configdoc.texi ld.1
# We want to reconfigure if configure.host or configure.tgt changes. We
# extract version from bfd/configure.in, so we must depend on that also.
CONFIG_STATUS_DEPENDENCIES = $(srcdir)/configure.host $(srcdir)/configure.tgt \
$(srcdir)/../bfd/configure.in
$(srcdir)/../bfd/configure.in \
$(srcdir)/../bfd/development.sh
MOSTLYCLEANFILES = $(STAGESTUFF) ld1$(EXEEXT) ld2$(EXEEXT) ld3$(EXEEXT) \
ldemul-list.h crtbegin.@OBJEXT@ crtend.@OBJEXT@ ld.log ld.sum

View File

@ -888,7 +888,8 @@ MAINTAINERCLEANFILES = configdoc.texi ld.1 ld.info
# We want to reconfigure if configure.host or configure.tgt changes. We
# extract version from bfd/configure.in, so we must depend on that also.
CONFIG_STATUS_DEPENDENCIES = $(srcdir)/configure.host $(srcdir)/configure.tgt \
$(srcdir)/../bfd/configure.in
$(srcdir)/../bfd/configure.in \
$(srcdir)/../bfd/development.sh
MOSTLYCLEANFILES = $(STAGESTUFF) ld1$(EXEEXT) ld2$(EXEEXT) ld3$(EXEEXT) \
ldemul-list.h crtbegin.@OBJEXT@ crtend.@OBJEXT@ ld.log ld.sum

11
ld/configure vendored
View File

@ -4642,6 +4642,9 @@ $as_echo "$ac_cv_path_EGREP" >&6; }
# Set the 'development' global.
. $srcdir/../bfd/development.sh
GCC_WARN_CFLAGS="-W -Wall -Wstrict-prototypes -Wmissing-prototypes"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@ -4676,8 +4679,8 @@ case "${host}" in
*) ;;
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}" -a "$development" = true ; then
ERROR_ON_WARNING=yes
fi
@ -12193,7 +12196,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
#line 12196 "configure"
#line 12199 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@ -12299,7 +12302,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
#line 12302 "configure"
#line 12305 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H

View File

@ -1,3 +1,9 @@
2014-06-05 Joel Brobecker <brobecker@adacore.com>
* Makefile.am (CONFIG_STATUS_DEPENDENCIES): Add dependency on
bfd's development.sh.
* Makefile.in, configure: Regenerate.
2014-06-03 Nick Clifton <nickc@redhat.com>
* msp430-dis.c (msp430_doubleoperand): Use extension_word to

View File

@ -296,7 +296,8 @@ OFILES = @BFD_MACHINES@
# We should reconfigure whenever bfd/configure.in changes, because
# that's where the version number in Makefile comes from.
CONFIG_STATUS_DEPENDENCIES = $(BFDDIR)/configure.in
CONFIG_STATUS_DEPENDENCIES = $(BFDDIR)/configure.in \
$(BFDDIR)/development.sh
AM_CPPFLAGS = -I. -I$(srcdir) -I../bfd -I$(INCDIR) -I$(BFDDIR) @HDEFINES@ @INCINTL@

View File

@ -569,7 +569,9 @@ OFILES = @BFD_MACHINES@
# We should reconfigure whenever bfd/configure.in changes, because
# that's where the version number in Makefile comes from.
CONFIG_STATUS_DEPENDENCIES = $(BFDDIR)/configure.in
CONFIG_STATUS_DEPENDENCIES = $(BFDDIR)/configure.in \
$(BFDDIR)/development.sh
AM_CPPFLAGS = -I. -I$(srcdir) -I../bfd -I$(INCDIR) -I$(BFDDIR) @HDEFINES@ @INCINTL@
libopcodes_la_SOURCES = dis-buf.c disassemble.c dis-init.c
# It's desirable to list ../bfd/libbfd.la in DEPENDENCIES and LIBADD.

7
opcodes/configure vendored
View File

@ -11504,6 +11504,9 @@ esac
fi
# Set the 'development' global.
. $srcdir/../bfd/development.sh
GCC_WARN_CFLAGS="-W -Wall -Wstrict-prototypes -Wmissing-prototypes"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@ -11538,8 +11541,8 @@ case "${host}" in
*) ;;
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}" -a "$development" = true ; then
ERROR_ON_WARNING=yes
fi