From 68ed2854284d415a71efd856a40343f550881ede Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Sat, 9 Jan 2021 03:56:10 -0500 Subject: sim: clean up C11 header includes Since we require C11 now, we can assume many headers exist, and clean up all of the conditional includes. It's not like any of this code actually accounted for the headers not existing, just whether we could include them. The strings.h cleanup is a little nuanced: it isn't in C11, but every use of it in the codebase will include strings.h only if string.h doesn't exist. Since we now assume the C11 string.h exists, we'll never include strings.h, so we can delete it. --- sim/cris/ChangeLog | 7 +++++++ sim/cris/config.in | 9 --------- sim/cris/configure | 43 ++++++++++++++++++++++++++++++++----------- sim/cris/configure.ac | 2 +- sim/cris/dv-rv.c | 14 -------------- sim/cris/rvdummy.c | 7 ------- sim/cris/sim-if.c | 2 -- sim/cris/traps.c | 2 -- 8 files changed, 40 insertions(+), 46 deletions(-) (limited to 'sim/cris') diff --git a/sim/cris/ChangeLog b/sim/cris/ChangeLog index 2af85ec..df6db41 100644 --- a/sim/cris/ChangeLog +++ b/sim/cris/ChangeLog @@ -1,3 +1,10 @@ +2021-01-11 Mike Frysinger + + * config.in, configure: Regenerate. + * dv-rv.c, rvdummy.c, sim-if.c, traps.c: Delete HAVE_ERRNO_H, + HAVE_STRING_H, HAVE_STRINGS_H, HAVE_STDLIB_H, and strings.h + include. + 2021-01-09 Mike Frysinger * configure: Regenerate. diff --git a/sim/cris/config.in b/sim/cris/config.in index 789d412..aa4d649 100644 --- a/sim/cris/config.in +++ b/sim/cris/config.in @@ -16,9 +16,6 @@ /* Define if dv-sockser is usable. */ #undef HAVE_DV_SOCKSER -/* Define to 1 if you have the header file. */ -#undef HAVE_ERRNO_H - /* Define to 1 if you have the header file. */ #undef HAVE_FCNTL_H @@ -43,9 +40,6 @@ /* Define to 1 if you have the `socket' library (-lsocket). */ #undef HAVE_LIBSOCKET -/* Define to 1 if you have the header file. */ -#undef HAVE_LIMITS_H - /* Define to 1 if you have the `lstat' function. */ #undef HAVE_LSTAT @@ -148,9 +142,6 @@ /* Define to 1 if you have the `time' function. */ #undef HAVE_TIME -/* Define to 1 if you have the header file. */ -#undef HAVE_TIME_H - /* Define to 1 if you have the `truncate' function. */ #undef HAVE_TRUNCATE diff --git a/sim/cris/configure b/sim/cris/configure index 267e9d3..b40c756 100755 --- a/sim/cris/configure +++ b/sim/cris/configure @@ -6811,6 +6811,19 @@ test -z "$deplibs_check_method" && deplibs_check_method=unknown +plugin_option= +plugin_names="liblto_plugin.so liblto_plugin-0.dll cyglto_plugin-0.dll" +for plugin in $plugin_names; do + plugin_so=`${CC} ${CFLAGS} --print-prog-name $plugin` + if test x$plugin_so = x$plugin; then + plugin_so=`${CC} ${CFLAGS} --print-file-name $plugin` + fi + if test x$plugin_so != x$plugin; then + plugin_option="--plugin $plugin_so" + break + fi +done + 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 @@ -6904,6 +6917,11 @@ else fi test -z "$AR" && AR=ar +if test -n "$plugin_option"; then + if $AR --help 2>&1 | grep -q "\--plugin"; then + AR="$AR $plugin_option" + fi +fi test -z "$AR_FLAGS" && AR_FLAGS=cru @@ -7108,6 +7126,11 @@ else fi test -z "$RANLIB" && RANLIB=: +if test -n "$plugin_option" && test "$RANLIB" != ":"; then + if $RANLIB --help 2>&1 | grep -q "\--plugin"; then + RANLIB="$RANLIB $plugin_option" + fi +fi @@ -8944,15 +8967,13 @@ $as_echo "$LINGUAS" >&6; } fi # Check for common headers. -# FIXME: Seems to me this can cause problems for i386-windows hosts. -# At one point there were hardcoded AC_DEFINE's if ${host} = i386-*-windows*. -for ac_header in stdlib.h string.h strings.h unistd.h time.h +# NB: You can assume C11 headers exist. +for ac_header in unistd.h do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + ac_fn_c_check_header_mongrel "$LINENO" "unistd.h" "ac_cv_header_unistd_h" "$ac_includes_default" +if test "x$ac_cv_header_unistd_h" = xyes; then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define HAVE_UNISTD_H 1 _ACEOF fi @@ -8985,7 +9006,7 @@ fi done -for ac_header in dlfcn.h errno.h sys/stat.h +for ac_header in dlfcn.h sys/stat.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" @@ -12922,7 +12943,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 12925 "configure" +#line 12946 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -13028,7 +13049,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 13031 "configure" +#line 13052 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -13580,7 +13601,7 @@ _ACEOF # For dv-rv and rvdummy. -for ac_header in sys/socket.h sys/select.h limits.h sys/param.h +for ac_header in sys/socket.h sys/select.h sys/param.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" diff --git a/sim/cris/configure.ac b/sim/cris/configure.ac index 12e0023..a2b08a9 100644 --- a/sim/cris/configure.ac +++ b/sim/cris/configure.ac @@ -5,7 +5,7 @@ sinclude(../common/acinclude.m4) SIM_AC_COMMON # For dv-rv and rvdummy. -AC_CHECK_HEADERS(sys/socket.h sys/select.h limits.h sys/param.h) +AC_CHECK_HEADERS(sys/socket.h sys/select.h sys/param.h) SIM_AC_OPTION_ENDIAN(LITTLE) SIM_AC_OPTION_ALIGNMENT(NONSTRICT_ALIGNMENT) diff --git a/sim/cris/dv-rv.c b/sim/cris/dv-rv.c index d22bf06..612eff4 100644 --- a/sim/cris/dv-rv.c +++ b/sim/cris/dv-rv.c @@ -25,26 +25,12 @@ #include "hw-tree.h" #include - -#ifdef HAVE_ERRNO_H #include -#endif - -#ifdef HAVE_STRING_H #include -#else -#ifdef HAVE_STRINGS_H -#include -#endif -#endif - #ifdef HAVE_UNISTD_H #include #endif -#ifdef HAVE_STDLIB_H #include -#endif - #ifdef HAVE_SYS_TYPES_H #include #endif diff --git a/sim/cris/rvdummy.c b/sim/cris/rvdummy.c index cb16410..f147ea9 100644 --- a/sim/cris/rvdummy.c +++ b/sim/cris/rvdummy.c @@ -41,13 +41,8 @@ main (int argc, char *argv[]) #ifdef HAVE_UNISTD_H #include #endif -#ifdef HAVE_STDLIB_H #include -#endif -#ifdef HAVE_STRING_H #include -#endif - #ifdef HAVE_SYS_TYPES_H #include #endif @@ -60,9 +55,7 @@ main (int argc, char *argv[]) #include #endif -#ifdef HAVE_ERRNO_H #include -#endif /* Not guarded in dv-sockser.c, so why here. */ #include diff --git a/sim/cris/sim-if.c b/sim/cris/sim-if.c index b8c7cb2..787896c 100644 --- a/sim/cris/sim-if.c +++ b/sim/cris/sim-if.c @@ -26,9 +26,7 @@ along with this program. If not, see . */ #include "elf-bfd.h" #include "sim-main.h" -#ifdef HAVE_STDLIB_H #include -#endif #include #include "sim-options.h" #include "dis-asm.h" diff --git a/sim/cris/traps.c b/sim/cris/traps.c index 03429e1..2aaa1f4 100644 --- a/sim/cris/traps.c +++ b/sim/cris/traps.c @@ -24,9 +24,7 @@ along with this program. If not, see . */ /* FIXME: get rid of targ-vals.h usage everywhere else. */ #include -#ifdef HAVE_ERRNO_H #include -#endif #ifdef HAVE_UNISTD_H #include #endif -- cgit v1.1