diff options
author | Mike Frysinger <vapier@gentoo.org> | 2021-06-18 02:14:52 -0400 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2021-06-18 10:15:15 -0400 |
commit | 982c3a65ca5dbea8d6de3afd934f0a06fef54383 (patch) | |
tree | 416ece9ed53e3350c23a09b381139bdc4cc9c6d7 /sim/mips | |
parent | 3f8414df7a533cccd39bf19c0e311975d9ededde (diff) | |
download | gdb-982c3a65ca5dbea8d6de3afd934f0a06fef54383.zip gdb-982c3a65ca5dbea8d6de3afd934f0a06fef54383.tar.gz gdb-982c3a65ca5dbea8d6de3afd934f0a06fef54383.tar.bz2 |
sim: move -Werror disabling to Makefile
For the ports that still don't build with -Werror, rather than disable
the flag at configure time, do it at make time. This will allow us to
unify these tests in the common sim configure script.
Diffstat (limited to 'sim/mips')
-rw-r--r-- | sim/mips/ChangeLog | 6 | ||||
-rw-r--r-- | sim/mips/Makefile.in | 2 | ||||
-rwxr-xr-x | sim/mips/configure | 212 | ||||
-rw-r--r-- | sim/mips/configure.ac | 1 |
4 files changed, 115 insertions, 106 deletions
diff --git a/sim/mips/ChangeLog b/sim/mips/ChangeLog index 2ad72ef..3308173 100644 --- a/sim/mips/ChangeLog +++ b/sim/mips/ChangeLog @@ -1,5 +1,11 @@ 2021-06-18 Mike Frysinger <vapier@gentoo.org> + * Makefile.in (SIM_WERROR_CFLAGS): New variable. + * configure.ac: Delete call to SIM_AC_OPTION_WARNINGS. + * configure: Regenerate. + +2021-06-18 Mike Frysinger <vapier@gentoo.org> + * interp.c: Include sim-signal.h. 2021-06-17 Mike Frysinger <vapier@gentoo.org> diff --git a/sim/mips/Makefile.in b/sim/mips/Makefile.in index 7e1356c..2f79c56 100644 --- a/sim/mips/Makefile.in +++ b/sim/mips/Makefile.in @@ -81,6 +81,8 @@ all: $(SIM_@sim_gen@_ALL) SIM_EXTRA_DEPS = itable.h +# Code doesn't build cleanly yet. +SIM_WERROR_CFLAGS = ## COMMON_POST_CONFIG_FRAG diff --git a/sim/mips/configure b/sim/mips/configure index 55041fd..db16388 100755 --- a/sim/mips/configure +++ b/sim/mips/configure @@ -777,14 +777,14 @@ with_gnu_ld enable_libtool_lock enable_maintainer_mode enable_sim_inline -enable_werror -enable_build_warnings -enable_sim_build_warnings enable_sim_reserved_bits enable_sim_bitsize enable_sim_float enable_sim_hardware with_x +enable_werror +enable_build_warnings +enable_sim_build_warnings ' ac_precious_vars='build_alias host_alias @@ -1428,11 +1428,6 @@ Optional Features: sometimes confusing) to the casual installer --enable-sim-inline=inlines Specify which functions should be inlined - --enable-werror treat compile warnings as errors - --enable-build-warnings enable build-time compiler warnings if gcc is used - --enable-sim-build-warnings - enable SIM specific build-time compiler warnings if - gcc is used --enable-sim-reserved-bits Specify whether to check reserved bits in instruction @@ -1441,6 +1436,11 @@ Optional Features: hardware --enable-sim-hardware=LIST Specify the hardware to be included in the build. + --enable-werror treat compile warnings as errors + --enable-build-warnings enable build-time compiler warnings if gcc is used + --enable-sim-build-warnings + enable SIM specific build-time compiler warnings if + gcc is used Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] @@ -11167,103 +11167,6 @@ fi -# Check whether --enable-werror was given. -if test "${enable_werror+set}" = set; then : - enableval=$enable_werror; case "${enableval}" in - yes | y) ERROR_ON_WARNING="yes" ;; - no | n) ERROR_ON_WARNING="no" ;; - *) as_fn_error $? "bad value ${enableval} for --enable-werror" "$LINENO" 5 ;; - esac -fi - - -# Enable -Werror by default when using gcc -if test "${GCC}" = yes -a -z "${ERROR_ON_WARNING}" ; then - ERROR_ON_WARNING=yes -fi - -WERROR_CFLAGS="" - -build_warnings="-Wall -Wdeclaration-after-statement -Wpointer-arith \ --Wpointer-sign \ --Wno-unused -Wunused-value -Wunused-function \ --Wno-switch -Wno-char-subscripts -Wmissing-prototypes --Wdeclaration-after-statement -Wempty-body -Wmissing-parameter-type \ --Wold-style-declaration -Wold-style-definition" - -# Enable -Wno-format by default when using gcc on mingw since many -# GCC versions complain about %I64. -case "${host}" in - *-*-mingw32*) build_warnings="$build_warnings -Wno-format" ;; - *) build_warnings="$build_warnings -Wformat-nonliteral" ;; -esac - -# Check whether --enable-build-warnings was given. -if test "${enable_build_warnings+set}" = set; then : - enableval=$enable_build_warnings; case "${enableval}" in - yes) ;; - no) build_warnings="-w";; - ,*) t=`echo "${enableval}" | sed -e "s/,/ /g"` - build_warnings="${build_warnings} ${t}";; - *,) t=`echo "${enableval}" | sed -e "s/,/ /g"` - build_warnings="${t} ${build_warnings}";; - *) build_warnings=`echo "${enableval}" | sed -e "s/,/ /g"`;; -esac -if test x"$silent" != x"yes" && test x"$build_warnings" != x""; then - echo "Setting compiler warning flags = $build_warnings" 6>&1 -fi -fi -# Check whether --enable-sim-build-warnings was given. -if test "${enable_sim_build_warnings+set}" = set; then : - enableval=$enable_sim_build_warnings; case "${enableval}" in - yes) ;; - no) build_warnings="-w";; - ,*) t=`echo "${enableval}" | sed -e "s/,/ /g"` - build_warnings="${build_warnings} ${t}";; - *,) t=`echo "${enableval}" | sed -e "s/,/ /g"` - build_warnings="${t} ${build_warnings}";; - *) build_warnings=`echo "${enableval}" | sed -e "s/,/ /g"`;; -esac -if test x"$silent" != x"yes" && test x"$build_warnings" != x""; then - echo "Setting GDB specific compiler warning flags = $build_warnings" 6>&1 -fi -fi -WARN_CFLAGS="" -if test "x${build_warnings}" != x -a "x$GCC" = xyes -then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking compiler warning flags" >&5 -$as_echo_n "checking compiler warning flags... " >&6; } - # Separate out the -Werror flag as some files just cannot be - # compiled with it enabled. - for w in ${build_warnings}; do - case $w in - -Werr*) WERROR_CFLAGS=-Werror ;; - *) # Check that GCC accepts it - saved_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -Werror $w" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - WARN_CFLAGS="${WARN_CFLAGS} $w" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - CFLAGS="$saved_CFLAGS" - esac - done - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${WARN_CFLAGS} ${WERROR_CFLAGS}" >&5 -$as_echo "${WARN_CFLAGS} ${WERROR_CFLAGS}" >&6; } -fi - - default_sim_reserved_bits="1" # Check whether --enable-sim-reserved-bits was given. if test "${enable_sim_reserved_bits+set}" = set; then : @@ -12102,6 +12005,105 @@ fi +# Check whether --enable-werror was given. +if test "${enable_werror+set}" = set; then : + enableval=$enable_werror; case "${enableval}" in + yes | y) ERROR_ON_WARNING="yes" ;; + no | n) ERROR_ON_WARNING="no" ;; + *) as_fn_error $? "bad value ${enableval} for --enable-werror" "$LINENO" 5 ;; + esac +fi + + +if test "${GCC}" = yes -a -z "${ERROR_ON_WARNING}" ; then + ERROR_ON_WARNING=yes +fi + +WERROR_CFLAGS="" +if test "${ERROR_ON_WARNING}" = yes ; then + WERROR_CFLAGS="-Werror" +fi + +build_warnings="-Wall -Wdeclaration-after-statement -Wpointer-arith \ +-Wpointer-sign \ +-Wno-unused -Wunused-value -Wunused-function \ +-Wno-switch -Wno-char-subscripts -Wmissing-prototypes +-Wdeclaration-after-statement -Wempty-body -Wmissing-parameter-type \ +-Wold-style-declaration -Wold-style-definition" + +# Enable -Wno-format by default when using gcc on mingw since many +# GCC versions complain about %I64. +case "${host}" in + *-*-mingw32*) build_warnings="$build_warnings -Wno-format" ;; + *) build_warnings="$build_warnings -Wformat-nonliteral" ;; +esac + +# Check whether --enable-build-warnings was given. +if test "${enable_build_warnings+set}" = set; then : + enableval=$enable_build_warnings; case "${enableval}" in + yes) ;; + no) build_warnings="-w";; + ,*) t=`echo "${enableval}" | sed -e "s/,/ /g"` + build_warnings="${build_warnings} ${t}";; + *,) t=`echo "${enableval}" | sed -e "s/,/ /g"` + build_warnings="${t} ${build_warnings}";; + *) build_warnings=`echo "${enableval}" | sed -e "s/,/ /g"`;; +esac +if test x"$silent" != x"yes" && test x"$build_warnings" != x""; then + echo "Setting compiler warning flags = $build_warnings" 6>&1 +fi +fi +# Check whether --enable-sim-build-warnings was given. +if test "${enable_sim_build_warnings+set}" = set; then : + enableval=$enable_sim_build_warnings; case "${enableval}" in + yes) ;; + no) build_warnings="-w";; + ,*) t=`echo "${enableval}" | sed -e "s/,/ /g"` + build_warnings="${build_warnings} ${t}";; + *,) t=`echo "${enableval}" | sed -e "s/,/ /g"` + build_warnings="${t} ${build_warnings}";; + *) build_warnings=`echo "${enableval}" | sed -e "s/,/ /g"`;; +esac +if test x"$silent" != x"yes" && test x"$build_warnings" != x""; then + echo "Setting GDB specific compiler warning flags = $build_warnings" 6>&1 +fi +fi +WARN_CFLAGS="" +if test "x${build_warnings}" != x -a "x$GCC" = xyes +then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking compiler warning flags" >&5 +$as_echo_n "checking compiler warning flags... " >&6; } + # Separate out the -Werror flag as some files just cannot be + # compiled with it enabled. + for w in ${build_warnings}; do + case $w in + -Werr*) WERROR_CFLAGS=-Werror ;; + *) # Check that GCC accepts it + saved_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -Werror $w" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + WARN_CFLAGS="${WARN_CFLAGS} $w" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + CFLAGS="$saved_CFLAGS" + esac + done + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${WARN_CFLAGS} ${WERROR_CFLAGS}" >&5 +$as_echo "${WARN_CFLAGS} ${WERROR_CFLAGS}" >&6; } +fi + + cgen_breaks="" if grep CGEN_MAINT $srcdir/Makefile.in >/dev/null; then cgen_breaks="break cgen_rtx_error"; diff --git a/sim/mips/configure.ac b/sim/mips/configure.ac index 03d8f51..88f06ee 100644 --- a/sim/mips/configure.ac +++ b/sim/mips/configure.ac @@ -5,7 +5,6 @@ AC_CONFIG_MACRO_DIRS([../m4 ../.. ../../config]) SIM_AC_COMMON dnl Options available in this module -SIM_AC_OPTION_WARNINGS(no) SIM_AC_OPTION_RESERVED_BITS(1) # DEPRECATED |