aboutsummaryrefslogtreecommitdiff
path: root/sim/frv
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2021-01-09 03:56:10 -0500
committerMike Frysinger <vapier@gentoo.org>2021-01-11 08:05:54 -0500
commit68ed2854284d415a71efd856a40343f550881ede (patch)
treef00f87cc7628c8e82de418bacc5d941db46c2481 /sim/frv
parenta8aa72b913e78407e5de4fefd22f9b98e4466f30 (diff)
downloadfsf-binutils-gdb-68ed2854284d415a71efd856a40343f550881ede.zip
fsf-binutils-gdb-68ed2854284d415a71efd856a40343f550881ede.tar.gz
fsf-binutils-gdb-68ed2854284d415a71efd856a40343f550881ede.tar.bz2
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.
Diffstat (limited to 'sim/frv')
-rw-r--r--sim/frv/ChangeLog6
-rw-r--r--sim/frv/config.in6
-rwxr-xr-xsim/frv/configure41
-rw-r--r--sim/frv/options.c8
-rw-r--r--sim/frv/sim-if.c2
5 files changed, 37 insertions, 26 deletions
diff --git a/sim/frv/ChangeLog b/sim/frv/ChangeLog
index c021f1c..9022879 100644
--- a/sim/frv/ChangeLog
+++ b/sim/frv/ChangeLog
@@ -1,3 +1,9 @@
+2021-01-11 Mike Frysinger <vapier@gentoo.org>
+
+ * config.in, configure: Regenerate.
+ * options.c, sim-if.c: Delete HAVE_STRING_H, HAVE_STRINGS_H,
+ HAVE_STDLIB_H, and strings.h include.
+
2021-01-09 Mike Frysinger <vapier@gentoo.org>
* configure: Regenerate.
diff --git a/sim/frv/config.in b/sim/frv/config.in
index ea6c08c..c60f7d8 100644
--- a/sim/frv/config.in
+++ b/sim/frv/config.in
@@ -16,9 +16,6 @@
/* Define if dv-sockser is usable. */
#undef HAVE_DV_SOCKSER
-/* Define to 1 if you have the <errno.h> header file. */
-#undef HAVE_ERRNO_H
-
/* Define to 1 if you have the <fcntl.h> header file. */
#undef HAVE_FCNTL_H
@@ -136,9 +133,6 @@
/* Define to 1 if you have the `time' function. */
#undef HAVE_TIME
-/* Define to 1 if you have the <time.h> header file. */
-#undef HAVE_TIME_H
-
/* Define to 1 if you have the `truncate' function. */
#undef HAVE_TRUNCATE
diff --git a/sim/frv/configure b/sim/frv/configure
index fb752cf..d10ca4b 100755
--- a/sim/frv/configure
+++ b/sim/frv/configure
@@ -6806,6 +6806,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
@@ -6899,6 +6912,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
@@ -7103,6 +7121,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
@@ -8939,15 +8962,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
@@ -8980,7 +9001,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"
@@ -12917,7 +12938,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 12920 "configure"
+#line 12941 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -13023,7 +13044,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 13026 "configure"
+#line 13047 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
diff --git a/sim/frv/options.c b/sim/frv/options.c
index d90984a..b5cc8de 100644
--- a/sim/frv/options.c
+++ b/sim/frv/options.c
@@ -24,16 +24,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "sim-assert.h"
#include "sim-options.h"
-#ifdef HAVE_STRING_H
#include <string.h>
-#else
-#ifdef HAVE_STRINGS_H
-#include <strings.h>
-#endif
-#endif
-#ifdef HAVE_STDLIB_H
#include <stdlib.h>
-#endif
/* FRV specific command line options. */
diff --git a/sim/frv/sim-if.c b/sim/frv/sim-if.c
index 2eb6e6d..636890b 100644
--- a/sim/frv/sim-if.c
+++ b/sim/frv/sim-if.c
@@ -20,9 +20,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
#define WANT_CPU
#define WANT_CPU_FRVBF
#include "sim-main.h"
-#ifdef HAVE_STDLIB_H
#include <stdlib.h>
-#endif
#include "sim-options.h"
#include "libiberty.h"
#include "bfd.h"