From: Mike Frysinger Date: Tue, 15 Jun 2021 03:16:49 +0000 (-0400) Subject: sim: drop redundant SIM_AC_OPTION_WARNINGS X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=82e6d6bf900e9c1929cc2d4e64a16ab4e1abe4e9;p=binutils-gdb.git sim: drop redundant SIM_AC_OPTION_WARNINGS The common code already calls this, so no need to do so in arch dirs. We leave the calls that disable -Werror. This will help unify the configure scripts. --- diff --git a/sim/aarch64/ChangeLog b/sim/aarch64/ChangeLog index 939ea29d1ff..20167487c07 100644 --- a/sim/aarch64/ChangeLog +++ b/sim/aarch64/ChangeLog @@ -1,3 +1,8 @@ +2021-06-14 Mike Frysinger + + * configure.ac: Delete call to SIM_AC_OPTION_WARNINGS. + * configure: Regenerate. + 2021-06-12 Mike Frysinger * configure.ac: Delete call to SIM_AC_OPTION_ALIGNMENT. diff --git a/sim/aarch64/configure b/sim/aarch64/configure index 5408aad16f2..017c6c0068f 100755 --- a/sim/aarch64/configure +++ b/sim/aarch64/configure @@ -11193,6 +11193,7 @@ fi fi + # Check whether --enable-werror was given. if test "${enable_werror+set}" = set; then : enableval=$enable_werror; case "${enableval}" in @@ -11293,7 +11294,6 @@ $as_echo "${WARN_CFLAGS} ${WERROR_CFLAGS}" >&6; } fi - hardware="cfi core pal glue " sim_hw_cflags="-DWITH_HW=1" sim_hw="$hardware" diff --git a/sim/aarch64/configure.ac b/sim/aarch64/configure.ac index 381682fb5f0..7ac149a5f9d 100644 --- a/sim/aarch64/configure.ac +++ b/sim/aarch64/configure.ac @@ -25,6 +25,5 @@ AC_CONFIG_MACRO_DIRS([../m4 ../.. ../../config]) SIM_AC_COMMON SIM_AC_OPTION_ENDIAN -SIM_AC_OPTION_WARNINGS SIM_AC_OUTPUT diff --git a/sim/arm/ChangeLog b/sim/arm/ChangeLog index 4d3632e7426..0926ea9bae3 100644 --- a/sim/arm/ChangeLog +++ b/sim/arm/ChangeLog @@ -1,3 +1,8 @@ +2021-06-14 Mike Frysinger + + * configure.ac: Delete call to SIM_AC_OPTION_WARNINGS. + * configure: Regenerate. + 2021-06-12 Mike Frysinger * configure.ac: Delete call to SIM_AC_OPTION_ALIGNMENT. diff --git a/sim/arm/configure b/sim/arm/configure index 5408aad16f2..017c6c0068f 100755 --- a/sim/arm/configure +++ b/sim/arm/configure @@ -11193,6 +11193,7 @@ fi fi + # Check whether --enable-werror was given. if test "${enable_werror+set}" = set; then : enableval=$enable_werror; case "${enableval}" in @@ -11293,7 +11294,6 @@ $as_echo "${WARN_CFLAGS} ${WERROR_CFLAGS}" >&6; } fi - hardware="cfi core pal glue " sim_hw_cflags="-DWITH_HW=1" sim_hw="$hardware" diff --git a/sim/arm/configure.ac b/sim/arm/configure.ac index 7638b6d8e11..ec8a87e7d39 100644 --- a/sim/arm/configure.ac +++ b/sim/arm/configure.ac @@ -5,6 +5,5 @@ AC_CONFIG_MACRO_DIRS([../m4 ../.. ../../config]) SIM_AC_COMMON SIM_AC_OPTION_ENDIAN -SIM_AC_OPTION_WARNINGS SIM_AC_OUTPUT diff --git a/sim/avr/ChangeLog b/sim/avr/ChangeLog index 1a18e995478..4d6e1b05b0b 100644 --- a/sim/avr/ChangeLog +++ b/sim/avr/ChangeLog @@ -1,3 +1,8 @@ +2021-06-14 Mike Frysinger + + * configure.ac: Delete call to SIM_AC_OPTION_WARNINGS. + * configure: Regenerate. + 2021-06-12 Mike Frysinger * configure.ac: Delete call to SIM_AC_OPTION_ALIGNMENT. diff --git a/sim/avr/configure b/sim/avr/configure index 32b83276196..7cdfa3edcac 100755 --- a/sim/avr/configure +++ b/sim/avr/configure @@ -11193,6 +11193,7 @@ fi fi + # Check whether --enable-werror was given. if test "${enable_werror+set}" = set; then : enableval=$enable_werror; case "${enableval}" in @@ -11293,7 +11294,6 @@ $as_echo "${WARN_CFLAGS} ${WERROR_CFLAGS}" >&6; } fi - hardware="cfi core pal glue " sim_hw_cflags="-DWITH_HW=1" sim_hw="$hardware" diff --git a/sim/avr/configure.ac b/sim/avr/configure.ac index 9d6e1e6ded7..8cd4d23a479 100644 --- a/sim/avr/configure.ac +++ b/sim/avr/configure.ac @@ -5,6 +5,5 @@ AC_CONFIG_MACRO_DIRS([../m4 ../.. ../../config]) SIM_AC_COMMON SIM_AC_OPTION_ENDIAN(LITTLE) -SIM_AC_OPTION_WARNINGS SIM_AC_OUTPUT diff --git a/sim/bfin/ChangeLog b/sim/bfin/ChangeLog index 9a8777de776..541eab6351f 100644 --- a/sim/bfin/ChangeLog +++ b/sim/bfin/ChangeLog @@ -1,3 +1,8 @@ +2021-06-14 Mike Frysinger + + * configure.ac: Delete call to SIM_AC_OPTION_WARNINGS. + * configure: Regenerate. + 2021-06-12 Mike Frysinger * interp.c: Include portability.h. diff --git a/sim/bfin/configure b/sim/bfin/configure index 26366a4179d..1c9893303ae 100755 --- a/sim/bfin/configure +++ b/sim/bfin/configure @@ -775,10 +775,10 @@ enable_maintainer_mode enable_sim_inline enable_sim_endian enable_sim_default_model +enable_sim_hardware enable_werror enable_build_warnings enable_sim_build_warnings -enable_sim_hardware ' ac_precious_vars='build_alias host_alias @@ -1426,13 +1426,13 @@ Optional Features: Specify target byte endian orientation --enable-sim-default-model=model Specify default model to simulate + --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 - --enable-sim-hardware=LIST - Specify the hardware to be included in the build. Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] @@ -11229,106 +11229,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="" - 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 - - hardware="cfi core pal glue \ bfin_cec \ bfin_ctimer \ @@ -11727,6 +11627,106 @@ 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="" + 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/bfin/configure.ac b/sim/bfin/configure.ac index e2d53bcc7ca..ddc7bc6e039 100644 --- a/sim/bfin/configure.ac +++ b/sim/bfin/configure.ac @@ -6,7 +6,6 @@ SIM_AC_COMMON SIM_AC_OPTION_ENDIAN(LITTLE) SIM_AC_OPTION_DEFAULT_MODEL(bf537) -SIM_AC_OPTION_WARNINGS SIM_AC_OPTION_HARDWARE(\ bfin_cec \ bfin_ctimer \ diff --git a/sim/ft32/ChangeLog b/sim/ft32/ChangeLog index 57889b6b98f..a193dc376c3 100644 --- a/sim/ft32/ChangeLog +++ b/sim/ft32/ChangeLog @@ -1,3 +1,8 @@ +2021-06-14 Mike Frysinger + + * configure.ac: Delete call to SIM_AC_OPTION_WARNINGS. + * configure: Regenerate. + 2021-06-12 Mike Frysinger * configure.ac: Delete call to SIM_AC_OPTION_ALIGNMENT. diff --git a/sim/ft32/configure b/sim/ft32/configure index 32b83276196..7cdfa3edcac 100755 --- a/sim/ft32/configure +++ b/sim/ft32/configure @@ -11193,6 +11193,7 @@ fi fi + # Check whether --enable-werror was given. if test "${enable_werror+set}" = set; then : enableval=$enable_werror; case "${enableval}" in @@ -11293,7 +11294,6 @@ $as_echo "${WARN_CFLAGS} ${WERROR_CFLAGS}" >&6; } fi - hardware="cfi core pal glue " sim_hw_cflags="-DWITH_HW=1" sim_hw="$hardware" diff --git a/sim/ft32/configure.ac b/sim/ft32/configure.ac index 9d6e1e6ded7..8cd4d23a479 100644 --- a/sim/ft32/configure.ac +++ b/sim/ft32/configure.ac @@ -5,6 +5,5 @@ AC_CONFIG_MACRO_DIRS([../m4 ../.. ../../config]) SIM_AC_COMMON SIM_AC_OPTION_ENDIAN(LITTLE) -SIM_AC_OPTION_WARNINGS SIM_AC_OUTPUT diff --git a/sim/microblaze/ChangeLog b/sim/microblaze/ChangeLog index 9ec4802ba31..892922f7ed3 100644 --- a/sim/microblaze/ChangeLog +++ b/sim/microblaze/ChangeLog @@ -1,3 +1,8 @@ +2021-06-14 Mike Frysinger + + * configure.ac: Delete call to SIM_AC_OPTION_WARNINGS. + * configure: Regenerate. + 2021-06-12 Mike Frysinger * configure.ac: Delete call to SIM_AC_OPTION_ALIGNMENT. diff --git a/sim/microblaze/configure b/sim/microblaze/configure index 5408aad16f2..017c6c0068f 100755 --- a/sim/microblaze/configure +++ b/sim/microblaze/configure @@ -11193,6 +11193,7 @@ fi fi + # Check whether --enable-werror was given. if test "${enable_werror+set}" = set; then : enableval=$enable_werror; case "${enableval}" in @@ -11293,7 +11294,6 @@ $as_echo "${WARN_CFLAGS} ${WERROR_CFLAGS}" >&6; } fi - hardware="cfi core pal glue " sim_hw_cflags="-DWITH_HW=1" sim_hw="$hardware" diff --git a/sim/microblaze/configure.ac b/sim/microblaze/configure.ac index 7638b6d8e11..ec8a87e7d39 100644 --- a/sim/microblaze/configure.ac +++ b/sim/microblaze/configure.ac @@ -5,6 +5,5 @@ AC_CONFIG_MACRO_DIRS([../m4 ../.. ../../config]) SIM_AC_COMMON SIM_AC_OPTION_ENDIAN -SIM_AC_OPTION_WARNINGS SIM_AC_OUTPUT diff --git a/sim/msp430/ChangeLog b/sim/msp430/ChangeLog index 24298e65861..b00046fcd47 100644 --- a/sim/msp430/ChangeLog +++ b/sim/msp430/ChangeLog @@ -1,3 +1,8 @@ +2021-06-14 Mike Frysinger + + * configure.ac: Delete call to SIM_AC_OPTION_WARNINGS. + * configure: Regenerate. + 2021-06-12 Mike Frysinger * configure.ac: Delete call to SIM_AC_OPTION_ALIGNMENT. diff --git a/sim/msp430/configure b/sim/msp430/configure index 32b83276196..7cdfa3edcac 100755 --- a/sim/msp430/configure +++ b/sim/msp430/configure @@ -11193,6 +11193,7 @@ fi fi + # Check whether --enable-werror was given. if test "${enable_werror+set}" = set; then : enableval=$enable_werror; case "${enableval}" in @@ -11293,7 +11294,6 @@ $as_echo "${WARN_CFLAGS} ${WERROR_CFLAGS}" >&6; } fi - hardware="cfi core pal glue " sim_hw_cflags="-DWITH_HW=1" sim_hw="$hardware" diff --git a/sim/msp430/configure.ac b/sim/msp430/configure.ac index 19839d11822..9cab54296b6 100644 --- a/sim/msp430/configure.ac +++ b/sim/msp430/configure.ac @@ -24,6 +24,5 @@ AC_CONFIG_MACRO_DIRS([../m4 ../.. ../../config]) SIM_AC_COMMON SIM_AC_OPTION_ENDIAN(LITTLE) -SIM_AC_OPTION_WARNINGS SIM_AC_OUTPUT diff --git a/sim/pru/ChangeLog b/sim/pru/ChangeLog index bb7ff9fb035..87bbac49bb7 100644 --- a/sim/pru/ChangeLog +++ b/sim/pru/ChangeLog @@ -1,3 +1,8 @@ +2021-06-14 Mike Frysinger + + * configure.ac: Delete call to SIM_AC_OPTION_WARNINGS. + * configure: Regenerate. + 2021-06-12 Mike Frysinger * configure.ac: Delete call to SIM_AC_OPTION_ALIGNMENT. diff --git a/sim/pru/configure b/sim/pru/configure index 32b83276196..7cdfa3edcac 100755 --- a/sim/pru/configure +++ b/sim/pru/configure @@ -11193,6 +11193,7 @@ fi fi + # Check whether --enable-werror was given. if test "${enable_werror+set}" = set; then : enableval=$enable_werror; case "${enableval}" in @@ -11293,7 +11294,6 @@ $as_echo "${WARN_CFLAGS} ${WERROR_CFLAGS}" >&6; } fi - hardware="cfi core pal glue " sim_hw_cflags="-DWITH_HW=1" sim_hw="$hardware" diff --git a/sim/pru/configure.ac b/sim/pru/configure.ac index 79dab8b2403..1846b26e14b 100644 --- a/sim/pru/configure.ac +++ b/sim/pru/configure.ac @@ -24,6 +24,5 @@ AC_CONFIG_MACRO_DIRS([../m4 ../.. ../../config]) SIM_AC_COMMON SIM_AC_OPTION_ENDIAN(LITTLE) -SIM_AC_OPTION_WARNINGS SIM_AC_OUTPUT diff --git a/sim/riscv/ChangeLog b/sim/riscv/ChangeLog index 04cc234f1b3..9e856b2dce1 100644 --- a/sim/riscv/ChangeLog +++ b/sim/riscv/ChangeLog @@ -1,3 +1,8 @@ +2021-06-14 Mike Frysinger + + * configure.ac: Delete call to SIM_AC_OPTION_WARNINGS. + * configure: Regenerate. + 2021-06-12 Mike Frysinger * configure.ac: Delete call to SIM_AC_OPTION_ALIGNMENT. diff --git a/sim/riscv/configure b/sim/riscv/configure index 36a39e6c375..62d524e556b 100755 --- a/sim/riscv/configure +++ b/sim/riscv/configure @@ -769,11 +769,11 @@ enable_libtool_lock enable_maintainer_mode enable_sim_inline enable_sim_endian +enable_sim_default_model +enable_sim_bitsize enable_werror enable_build_warnings enable_sim_build_warnings -enable_sim_default_model -enable_sim_bitsize enable_sim_hardware ' ac_precious_vars='build_alias @@ -1415,14 +1415,14 @@ Optional Features: Specify which functions should be inlined --enable-sim-endian=endian Specify target byte endian orientation + --enable-sim-default-model=model + Specify default model to simulate + --enable-sim-bitsize=N Specify target bitsize (32 or 64) --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-default-model=model - Specify default model to simulate - --enable-sim-bitsize=N Specify target bitsize (32 or 64) --enable-sim-hardware=LIST Specify the hardware to be included in the build. @@ -11198,6 +11198,96 @@ fi fi +# Select the default model for the target. +riscv_model= +case "${target}" in +riscv32*) riscv_model="RV32G" ;; +riscv*) riscv_model="RV64G" ;; +esac + +default_sim_default_model="${riscv_model}" +# Check whether --enable-sim-default-model was given. +if test "${enable_sim_default_model+set}" = set; then : + enableval=$enable_sim_default_model; case "${enableval}" in + yes|no) as_fn_error $? "\"Missing argument to --enable-sim-default-model\"" "$LINENO" 5;; + *) sim_default_model="-DWITH_DEFAULT_MODEL='\"${enableval}\"'";; +esac +if test x"$silent" != x"yes" && test x"$sim_default_model" != x""; then + echo "Setting default model = $sim_default_model" 6>&1 +fi +else + sim_default_model="-DWITH_DEFAULT_MODEL='\"${default_sim_default_model}\"'" +fi + + + +# Select the bitsize of the target. +riscv_addr_bitsize= +case "${target}" in +riscv32*) riscv_addr_bitsize=32 ;; +riscv*) riscv_addr_bitsize=64 ;; +esac +wire_word_bitsize="$riscv_addr_bitsize" +wire_word_msb="" +wire_address_bitsize="" +wire_cell_bitsize="" +# Check whether --enable-sim-bitsize was given. +if test "${enable_sim_bitsize+set}" = set; then : + enableval=$enable_sim_bitsize; sim_bitsize= +case "${enableval}" in + 64,63 | 64,63,* ) sim_bitsize="-DWITH_TARGET_WORD_BITSIZE=64 -DWITH_TARGET_WORD_MSB=63";; + 32,31 | 32,31,* ) sim_bitsize="-DWITH_TARGET_WORD_BITSIZE=32 -DWITH_TARGET_WORD_MSB=31";; + 64,0 | 64,0,* ) sim_bitsize="-DWITH_TARGET_WORD_BITSIZE=32 -DWITH_TARGET_WORD_MSB=0";; + 32,0 | 64,0,* ) sim_bitsize="-DWITH_TARGET_WORD_BITSIZE=32 -DWITH_TARGET_WORD_MSB=0";; + 32) if test x"$wire_word_msb" != x -a x"$wire_word_msb" != x0; then + sim_bitsize="-DWITH_TARGET_WORD_BITSIZE=32 -DWITH_TARGET_WORD_MSB=31" + else + sim_bitsize="-DWITH_TARGET_WORD_BITSIZE=32 -DWITH_TARGET_WORD_MSB=0" + fi ;; + 64) if test x"$wire_word_msb" != x -a x"$wire_word_msb" != x0; then + sim_bitsize="-DWITH_TARGET_WORD_BITSIZE=64 -DWITH_TARGET_WORD_MSB=63" + else + sim_bitsize="-DWITH_TARGET_WORD_BITSIZE=64 -DWITH_TARGET_WORD_MSB=0" + fi ;; + *) as_fn_error $? "\"--enable-sim-bitsize was given $enableval. Expected 32 or 64\"" "$LINENO" 5 ;; +esac +# address bitsize +tmp=`echo "${enableval}" | sed -e "s/^[0-9]*,*[0-9]*,*//"` +case x"${tmp}" in + x ) ;; + x32 | x32,* ) sim_bitsize="${sim_bitsize} -DWITH_TARGET_ADDRESS_BITSIZE=32" ;; + x64 | x64,* ) sim_bitsize="${sim_bitsize} -DWITH_TARGET_ADDRESS_BITSIZE=64" ;; + * ) as_fn_error $? "\"--enable-sim-bitsize was given address size $enableval. Expected 32 or 64\"" "$LINENO" 5 ;; +esac +# cell bitsize +tmp=`echo "${enableval}" | sed -e "s/^[0-9]*,*[0-9*]*,*[0-9]*,*//"` +case x"${tmp}" in + x ) ;; + x32 | x32,* ) sim_bitsize="${sim_bitsize} -DWITH_TARGET_CELL_BITSIZE=32" ;; + x64 | x64,* ) sim_bitsize="${sim_bitsize} -DWITH_TARGET_CELL_BITSIZE=64" ;; + * ) as_fn_error $? "\"--enable-sim-bitsize was given cell size $enableval. Expected 32 or 64\"" "$LINENO" 5 ;; +esac +if test x"$silent" != x"yes" && test x"$sim_bitsize" != x""; then + echo "Setting bitsize flags = $sim_bitsize" 6>&1 +fi +else + sim_bitsize="" +if test x"$wire_word_bitsize" != x; then + sim_bitsize="$sim_bitsize -DWITH_TARGET_WORD_BITSIZE=$wire_word_bitsize" +fi +if test x"$wire_word_msb" != x; then + sim_bitsize="$sim_bitsize -DWITH_TARGET_WORD_MSB=$wire_word_msb" +fi +if test x"$wire_address_bitsize" != x; then + sim_bitsize="$sim_bitsize -DWITH_TARGET_ADDRESS_BITSIZE=$wire_address_bitsize" +fi +if test x"$wire_cell_bitsize" != x; then + sim_bitsize="$sim_bitsize -DWITH_TARGET_CELL_BITSIZE=$wire_cell_bitsize" +fi +fi + + + # Check whether --enable-werror was given. if test "${enable_werror+set}" = set; then : enableval=$enable_werror; case "${enableval}" in @@ -11298,96 +11388,6 @@ $as_echo "${WARN_CFLAGS} ${WERROR_CFLAGS}" >&6; } fi -# Select the default model for the target. -riscv_model= -case "${target}" in -riscv32*) riscv_model="RV32G" ;; -riscv*) riscv_model="RV64G" ;; -esac - -default_sim_default_model="${riscv_model}" -# Check whether --enable-sim-default-model was given. -if test "${enable_sim_default_model+set}" = set; then : - enableval=$enable_sim_default_model; case "${enableval}" in - yes|no) as_fn_error $? "\"Missing argument to --enable-sim-default-model\"" "$LINENO" 5;; - *) sim_default_model="-DWITH_DEFAULT_MODEL='\"${enableval}\"'";; -esac -if test x"$silent" != x"yes" && test x"$sim_default_model" != x""; then - echo "Setting default model = $sim_default_model" 6>&1 -fi -else - sim_default_model="-DWITH_DEFAULT_MODEL='\"${default_sim_default_model}\"'" -fi - - - -# Select the bitsize of the target. -riscv_addr_bitsize= -case "${target}" in -riscv32*) riscv_addr_bitsize=32 ;; -riscv*) riscv_addr_bitsize=64 ;; -esac -wire_word_bitsize="$riscv_addr_bitsize" -wire_word_msb="" -wire_address_bitsize="" -wire_cell_bitsize="" -# Check whether --enable-sim-bitsize was given. -if test "${enable_sim_bitsize+set}" = set; then : - enableval=$enable_sim_bitsize; sim_bitsize= -case "${enableval}" in - 64,63 | 64,63,* ) sim_bitsize="-DWITH_TARGET_WORD_BITSIZE=64 -DWITH_TARGET_WORD_MSB=63";; - 32,31 | 32,31,* ) sim_bitsize="-DWITH_TARGET_WORD_BITSIZE=32 -DWITH_TARGET_WORD_MSB=31";; - 64,0 | 64,0,* ) sim_bitsize="-DWITH_TARGET_WORD_BITSIZE=32 -DWITH_TARGET_WORD_MSB=0";; - 32,0 | 64,0,* ) sim_bitsize="-DWITH_TARGET_WORD_BITSIZE=32 -DWITH_TARGET_WORD_MSB=0";; - 32) if test x"$wire_word_msb" != x -a x"$wire_word_msb" != x0; then - sim_bitsize="-DWITH_TARGET_WORD_BITSIZE=32 -DWITH_TARGET_WORD_MSB=31" - else - sim_bitsize="-DWITH_TARGET_WORD_BITSIZE=32 -DWITH_TARGET_WORD_MSB=0" - fi ;; - 64) if test x"$wire_word_msb" != x -a x"$wire_word_msb" != x0; then - sim_bitsize="-DWITH_TARGET_WORD_BITSIZE=64 -DWITH_TARGET_WORD_MSB=63" - else - sim_bitsize="-DWITH_TARGET_WORD_BITSIZE=64 -DWITH_TARGET_WORD_MSB=0" - fi ;; - *) as_fn_error $? "\"--enable-sim-bitsize was given $enableval. Expected 32 or 64\"" "$LINENO" 5 ;; -esac -# address bitsize -tmp=`echo "${enableval}" | sed -e "s/^[0-9]*,*[0-9]*,*//"` -case x"${tmp}" in - x ) ;; - x32 | x32,* ) sim_bitsize="${sim_bitsize} -DWITH_TARGET_ADDRESS_BITSIZE=32" ;; - x64 | x64,* ) sim_bitsize="${sim_bitsize} -DWITH_TARGET_ADDRESS_BITSIZE=64" ;; - * ) as_fn_error $? "\"--enable-sim-bitsize was given address size $enableval. Expected 32 or 64\"" "$LINENO" 5 ;; -esac -# cell bitsize -tmp=`echo "${enableval}" | sed -e "s/^[0-9]*,*[0-9*]*,*[0-9]*,*//"` -case x"${tmp}" in - x ) ;; - x32 | x32,* ) sim_bitsize="${sim_bitsize} -DWITH_TARGET_CELL_BITSIZE=32" ;; - x64 | x64,* ) sim_bitsize="${sim_bitsize} -DWITH_TARGET_CELL_BITSIZE=64" ;; - * ) as_fn_error $? "\"--enable-sim-bitsize was given cell size $enableval. Expected 32 or 64\"" "$LINENO" 5 ;; -esac -if test x"$silent" != x"yes" && test x"$sim_bitsize" != x""; then - echo "Setting bitsize flags = $sim_bitsize" 6>&1 -fi -else - sim_bitsize="" -if test x"$wire_word_bitsize" != x; then - sim_bitsize="$sim_bitsize -DWITH_TARGET_WORD_BITSIZE=$wire_word_bitsize" -fi -if test x"$wire_word_msb" != x; then - sim_bitsize="$sim_bitsize -DWITH_TARGET_WORD_MSB=$wire_word_msb" -fi -if test x"$wire_address_bitsize" != x; then - sim_bitsize="$sim_bitsize -DWITH_TARGET_ADDRESS_BITSIZE=$wire_address_bitsize" -fi -if test x"$wire_cell_bitsize" != x; then - sim_bitsize="$sim_bitsize -DWITH_TARGET_CELL_BITSIZE=$wire_cell_bitsize" -fi -fi - - - hardware="cfi core pal glue " sim_hw_cflags="-DWITH_HW=1" sim_hw="$hardware" diff --git a/sim/riscv/configure.ac b/sim/riscv/configure.ac index 3d678acb47b..421b5ba7ef5 100644 --- a/sim/riscv/configure.ac +++ b/sim/riscv/configure.ac @@ -5,7 +5,6 @@ AC_CONFIG_MACRO_DIRS([../m4 ../.. ../../config]) SIM_AC_COMMON SIM_AC_OPTION_ENDIAN(LITTLE) -SIM_AC_OPTION_WARNINGS # Select the default model for the target. riscv_model=