diff options
Diffstat (limited to 'sim')
-rw-r--r-- | sim/Makefile.in | 3 | ||||
-rw-r--r-- | sim/aclocal.m4 | 2 | ||||
-rw-r--r-- | sim/common/dv-sockser.c | 2 | ||||
-rw-r--r-- | sim/common/nrun.c | 4 | ||||
-rw-r--r-- | sim/config.h.in | 15 | ||||
-rwxr-xr-x | sim/configure | 486 | ||||
-rw-r--r-- | sim/d10v/gencode.c | 2 | ||||
-rw-r--r-- | sim/m4/sim_ac_option_warnings.m4 | 2 | ||||
-rw-r--r-- | sim/m4/sim_ac_platform.m4 | 42 | ||||
-rw-r--r-- | sim/m4/sim_ac_toolchain.m4 | 2 | ||||
-rw-r--r-- | sim/or1k/cpu.c | 32 | ||||
-rw-r--r-- | sim/or1k/cpu.h | 14 | ||||
-rw-r--r-- | sim/or1k/or1k.c | 4 | ||||
-rw-r--r-- | sim/or1k/traps.c | 2 | ||||
-rw-r--r-- | sim/ppc/emul_netbsd.c | 6 | ||||
-rw-r--r-- | sim/ppc/emul_unix.c | 12 | ||||
-rw-r--r-- | sim/ppc/main.c | 4 | ||||
-rw-r--r-- | sim/riscv/sim-main.c | 2 | ||||
-rw-r--r-- | sim/testsuite/common/bits-tst.c | 5 |
19 files changed, 487 insertions, 154 deletions
diff --git a/sim/Makefile.in b/sim/Makefile.in index f99f155..7403e90 100644 --- a/sim/Makefile.in +++ b/sim/Makefile.in @@ -328,7 +328,9 @@ TESTS = testsuite/common/bits32m0$(EXEEXT) \ subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/../config/acx.m4 \ + $(top_srcdir)/../config/clang-plugin.m4 \ $(top_srcdir)/../config/depstand.m4 \ + $(top_srcdir)/../config/gcc-plugin.m4 \ $(top_srcdir)/../config/lead-dot.m4 \ $(top_srcdir)/../config/override.m4 \ $(top_srcdir)/../config/pkg.m4 $(top_srcdir)/../libtool.m4 \ @@ -1686,6 +1688,7 @@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ +LLVM_CONFIG = @LLVM_CONFIG@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ diff --git a/sim/aclocal.m4 b/sim/aclocal.m4 index d7db9e4..e6e62f7 100644 --- a/sim/aclocal.m4 +++ b/sim/aclocal.m4 @@ -1168,7 +1168,9 @@ AC_SUBST([am__untar]) ]) # _AM_PROG_TAR m4_include([../config/acx.m4]) +m4_include([../config/clang-plugin.m4]) m4_include([../config/depstand.m4]) +m4_include([../config/gcc-plugin.m4]) m4_include([../config/lead-dot.m4]) m4_include([../config/override.m4]) m4_include([../config/pkg.m4]) diff --git a/sim/common/dv-sockser.c b/sim/common/dv-sockser.c index c46bafe..04111fb 100644 --- a/sim/common/dv-sockser.c +++ b/sim/common/dv-sockser.c @@ -175,7 +175,7 @@ dv_sockser_init (SIM_DESC sd) ??? Need a central signal management module. */ #ifdef SIGPIPE { - RETSIGTYPE (*orig) (int); + void (*orig) (int); orig = signal (SIGPIPE, SIG_IGN); /* If a handler is already set up, don't mess with it. */ if (orig != SIG_DFL && orig != SIG_IGN) diff --git a/sim/common/nrun.c b/sim/common/nrun.c index 22d420e..d52e53d 100644 --- a/sim/common/nrun.c +++ b/sim/common/nrun.c @@ -44,7 +44,7 @@ static const char *myname; static SIM_DESC sd; -static RETSIGTYPE +static void cntrl_c (int sig) { if (! sim_stop (sd)) @@ -64,7 +64,7 @@ main (int argc, char **argv) enum sim_stop reason; int sigrc = 0; int single_step = 0; - RETSIGTYPE (*prev_sigint) (int); + void (*prev_sigint) (int); myname = lbasename (argv[0]); diff --git a/sim/config.h.in b/sim/config.h.in index f5742a9..44ff515 100644 --- a/sim/config.h.in +++ b/sim/config.h.in @@ -307,18 +307,6 @@ /* Define to 1 if `tm_zone' is a member of `struct tm'. */ #undef HAVE_STRUCT_TM_TM_ZONE -/* Define to 1 if your `struct stat' has `st_blksize'. Deprecated, use - `HAVE_STRUCT_STAT_ST_BLKSIZE' instead. */ -#undef HAVE_ST_BLKSIZE - -/* Define to 1 if your `struct stat' has `st_blocks'. Deprecated, use - `HAVE_STRUCT_STAT_ST_BLOCKS' instead. */ -#undef HAVE_ST_BLOCKS - -/* Define to 1 if your `struct stat' has `st_rdev'. Deprecated, use - `HAVE_STRUCT_STAT_ST_RDEV' instead. */ -#undef HAVE_ST_RDEV - /* Define to 1 if you have the `symlink' function. */ #undef HAVE_SYMLINK @@ -483,9 +471,6 @@ /* Bug reporting address */ #undef REPORT_BUGS_TO -/* Define as the return type of signal handlers (`int' or `void'). */ -#undef RETSIGTYPE - /* The size of `long long', as computed by sizeof. */ #undef SIZEOF_LONG_LONG diff --git a/sim/configure b/sim/configure index 365a12d..b6c6d65 100755 --- a/sim/configure +++ b/sim/configure @@ -637,6 +637,7 @@ ac_func_list= ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS +LIBOBJS SIM_RX_CYCLE_ACCURATE_FLAGS SIM_RISCV_BITSIZE sim_ppc_model_issue @@ -896,6 +897,7 @@ NMEDIT DSYMUTIL AWK STRIP +LLVM_CONFIG OBJDUMP LN_S NM @@ -905,7 +907,6 @@ LD FGREP SED LIBTOOL -LIBOBJS C_DIALECT PKG_CONFIG_LIBDIR PKG_CONFIG_PATH @@ -6864,8 +6865,266 @@ test -z "$deplibs_check_method" && deplibs_check_method=unknown -plugin_option= + +# Try CLANG_PLUGIN_FILE first since GCC_PLUGIN_OPTION may return the +# wrong plugin_option with clang. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for clang" >&5 +$as_echo_n "checking for clang... " >&6; } +if ${clang_cv_is_clang+:} false; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#ifdef __clang__ + yes +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "yes" >/dev/null 2>&1; then : + clang_cv_is_clang=yes +else + clang_cv_is_clang=no +fi +rm -f conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $clang_cv_is_clang" >&5 +$as_echo "$clang_cv_is_clang" >&6; } + plugin_file= + if test $clang_cv_is_clang = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for clang plugin file" >&5 +$as_echo_n "checking for clang plugin file... " >&6; } + plugin_names="LLVMgold.so" + for plugin in $plugin_names; do + plugin_file=`${CC} ${CFLAGS} --print-file-name $plugin` + if test x$plugin_file = x$plugin; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}llvm-config", so it can be a program name with args. +set dummy ${ac_tool_prefix}llvm-config; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_LLVM_CONFIG+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$LLVM_CONFIG"; then + ac_cv_prog_LLVM_CONFIG="$LLVM_CONFIG" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_LLVM_CONFIG="${ac_tool_prefix}llvm-config" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +LLVM_CONFIG=$ac_cv_prog_LLVM_CONFIG +if test -n "$LLVM_CONFIG"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LLVM_CONFIG" >&5 +$as_echo "$LLVM_CONFIG" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_LLVM_CONFIG"; then + ac_ct_LLVM_CONFIG=$LLVM_CONFIG + # Extract the first word of "llvm-config", so it can be a program name with args. +set dummy llvm-config; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_LLVM_CONFIG+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_LLVM_CONFIG"; then + ac_cv_prog_ac_ct_LLVM_CONFIG="$ac_ct_LLVM_CONFIG" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_LLVM_CONFIG="llvm-config" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_LLVM_CONFIG=$ac_cv_prog_ac_ct_LLVM_CONFIG +if test -n "$ac_ct_LLVM_CONFIG"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LLVM_CONFIG" >&5 +$as_echo "$ac_ct_LLVM_CONFIG" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_LLVM_CONFIG" = x; then + LLVM_CONFIG="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + LLVM_CONFIG=$ac_ct_LLVM_CONFIG + fi +else + LLVM_CONFIG="$ac_cv_prog_LLVM_CONFIG" +fi + + if test "$?" != 0; then + as_fn_error $? "Required tool 'llvm-config' not found on PATH." "$LINENO" 5 + fi + clang_lib_dir=`$LLVM_CONFIG --libdir` + if test -f $clang_lib_dir/$plugin; then + plugin_file=$clang_lib_dir/$plugin + fi + if test x$plugin_file != x$plugin; then + break; + fi + fi + done + if test -z $plugin_file; then + as_fn_error $? "Couldn't find clang plugin file for $CC." "$LINENO" 5 + fi + 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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_AR+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AR="${ac_tool_prefix}ar" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AR=$ac_cv_prog_AR +if test -n "$AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 +$as_echo "$AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_AR"; then + ac_ct_AR=$AR + # Extract the first word of "ar", so it can be a program name with args. +set dummy ar; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_AR+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_AR"; then + ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_AR="ar" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_AR=$ac_cv_prog_ac_ct_AR +if test -n "$ac_ct_AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 +$as_echo "$ac_ct_AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_AR" = x; then + AR="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + AR=$ac_ct_AR + fi +else + AR="$ac_cv_prog_AR" +fi + + if test "${AR}" = "" ; then + as_fn_error $? "Required archive tool 'ar' not found on PATH." "$LINENO" 5 + fi + plugin_option="--plugin $plugin_file" + touch conftest.c + ${AR} $plugin_option rc conftest.a conftest.c + if test "$?" != 0; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Failed: $AR $plugin_option rc" >&5 +$as_echo "$as_me: WARNING: Failed: $AR $plugin_option rc" >&2;} + plugin_file= + fi + rm -f conftest.* + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $plugin_file" >&5 +$as_echo "$plugin_file" >&6; } + fi + plugin_file="$plugin_file" + +if test -n "$plugin_file"; then + plugin_option="--plugin $plugin_file" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -plugin option" >&5 +$as_echo_n "checking for -plugin option... " >&6; } + plugin_names="liblto_plugin.so liblto_plugin-0.dll cyglto_plugin-0.dll" +plugin_option= for plugin in $plugin_names; do plugin_so=`${CC} ${CFLAGS} --print-prog-name $plugin` if test x$plugin_so = x$plugin; then @@ -6876,7 +7135,119 @@ for plugin in $plugin_names; do 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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_AR+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AR="${ac_tool_prefix}ar" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AR=$ac_cv_prog_AR +if test -n "$AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 +$as_echo "$AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_AR"; then + ac_ct_AR=$AR + # Extract the first word of "ar", so it can be a program name with args. +set dummy ar; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_AR+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_AR"; then + ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_AR="ar" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_AR=$ac_cv_prog_ac_ct_AR +if test -n "$ac_ct_AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 +$as_echo "$ac_ct_AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_AR" = x; then + AR="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + AR=$ac_ct_AR + fi +else + AR="$ac_cv_prog_AR" +fi + +if test "${AR}" = "" ; then + as_fn_error $? "Required archive tool 'ar' not found on PATH." "$LINENO" 5 +fi +touch conftest.c +${AR} $plugin_option rc conftest.a conftest.c +if test "$?" != 0; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Failed: $AR $plugin_option rc" >&5 +$as_echo "$as_me: WARNING: Failed: $AR $plugin_option rc" >&2;} + plugin_option= +fi +rm -f conftest.* +if test -n "$plugin_option"; then + plugin_option="$plugin_option" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $plugin_option" >&5 +$as_echo "$plugin_option" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +fi 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 @@ -6971,17 +7342,15 @@ fi test -z "$AR" && AR=ar if test -n "$plugin_option"; then - if $AR --help 2>&1 | grep -q "\--plugin"; then - touch conftest.c - $AR $plugin_option rc conftest.a conftest.c - if test "$?" != 0; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Failed: $AR $plugin_option rc" >&5 -$as_echo "$as_me: WARNING: Failed: $AR $plugin_option rc" >&2;} - else + case "$AR" in + *"$plugin_option"*) + ;; + *) + if $AR --help 2>&1 | grep -q "\--plugin"; then AR="$AR $plugin_option" fi - rm -f conftest.* - fi + ;; + esac fi test -z "$AR_FLAGS" && AR_FLAGS=cru @@ -7188,9 +7557,15 @@ 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 + case "$RANLIB" in + *"$plugin_option"*) + ;; + *) + if $RANLIB --help 2>&1 | grep -q "\--plugin"; then + RANLIB="$RANLIB $plugin_option" + fi + ;; + esac fi @@ -8559,52 +8934,6 @@ fi -ac_fn_c_check_member "$LINENO" "struct stat" "st_blksize" "ac_cv_member_struct_stat_st_blksize" "$ac_includes_default" -if test "x$ac_cv_member_struct_stat_st_blksize" = xyes; then : - -cat >>confdefs.h <<_ACEOF -#define HAVE_STRUCT_STAT_ST_BLKSIZE 1 -_ACEOF - - -$as_echo "#define HAVE_ST_BLKSIZE 1" >>confdefs.h - -fi - - -ac_fn_c_check_member "$LINENO" "struct stat" "st_blocks" "ac_cv_member_struct_stat_st_blocks" "$ac_includes_default" -if test "x$ac_cv_member_struct_stat_st_blocks" = xyes; then : - -cat >>confdefs.h <<_ACEOF -#define HAVE_STRUCT_STAT_ST_BLOCKS 1 -_ACEOF - - -$as_echo "#define HAVE_ST_BLOCKS 1" >>confdefs.h - -else - case " $LIBOBJS " in - *" fileblocks.$ac_objext "* ) ;; - *) LIBOBJS="$LIBOBJS fileblocks.$ac_objext" - ;; -esac - -fi - - -ac_fn_c_check_member "$LINENO" "struct stat" "st_rdev" "ac_cv_member_struct_stat_st_rdev" "$ac_includes_default" -if test "x$ac_cv_member_struct_stat_st_rdev" = xyes; then : - -cat >>confdefs.h <<_ACEOF -#define HAVE_STRUCT_STAT_ST_RDEV 1 -_ACEOF - - -$as_echo "#define HAVE_ST_RDEV 1" >>confdefs.h - -fi - - ac_fn_c_check_member "$LINENO" "struct tm" "tm_zone" "ac_cv_member_struct_tm_tm_zone" "#include <sys/types.h> #include <$ac_cv_struct_tm> @@ -9311,39 +9640,6 @@ _ACEOF fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking return type of signal handlers" >&5 -$as_echo_n "checking return type of signal handlers... " >&6; } -if ${ac_cv_type_signal+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <sys/types.h> -#include <signal.h> - -int -main () -{ -return *(signal (0, 0)) (0) == 1; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_type_signal=int -else - ac_cv_type_signal=void -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_signal" >&5 -$as_echo "$ac_cv_type_signal" >&6; } - -cat >>confdefs.h <<_ACEOF -#define RETSIGTYPE $ac_cv_type_signal -_ACEOF - - ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" if test "x$ac_cv_type_size_t" = xyes; then : @@ -12878,7 +13174,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 12881 "configure" +#line 13177 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -12984,7 +13280,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 12987 "configure" +#line 13283 "configure" #include "confdefs.h" #if HAVE_DLFCN_H diff --git a/sim/d10v/gencode.c b/sim/d10v/gencode.c index 3a37bac..763e2f5 100644 --- a/sim/d10v/gencode.c +++ b/sim/d10v/gencode.c @@ -150,5 +150,5 @@ write_opcodes (void) printf ("},\n"); } } - printf ("{ 0,0,0,0,0,0,0,(void (*)())0,0,{0,0,0}},\n};\n"); + printf ("{ 0,0,0,0,0,0,0,0,0,{0,0,0}},\n};\n"); } diff --git a/sim/m4/sim_ac_option_warnings.m4 b/sim/m4/sim_ac_option_warnings.m4 index 8860222..f105832 100644 --- a/sim/m4/sim_ac_option_warnings.m4 +++ b/sim/m4/sim_ac_option_warnings.m4 @@ -189,7 +189,7 @@ AC_DEFUN([_SIM_TEST_WARNING_FLAG], [dnl dnl Check whether GCC accepts it. saved_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -Werror $wtest" - AC_TRY_COMPILE([],[],$2,$3) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],[$2],[$3]) CFLAGS="$saved_CFLAGS" ]) dnl Export variable $1 to $2 for use in makefiles. diff --git a/sim/m4/sim_ac_platform.m4 b/sim/m4/sim_ac_platform.m4 index 3b22615..79de2a4 100644 --- a/sim/m4/sim_ac_platform.m4 +++ b/sim/m4/sim_ac_platform.m4 @@ -112,9 +112,6 @@ AC_CHECK_FUNCS_ONCE(m4_flatten([ utime ])) -AC_STRUCT_ST_BLKSIZE -AC_STRUCT_ST_BLOCKS -AC_STRUCT_ST_RDEV AC_STRUCT_TIMEZONE AC_CHECK_MEMBERS([[struct stat.st_dev], [struct stat.st_ino], @@ -138,7 +135,7 @@ AC_CHECK_SIZEOF([void *]) dnl Check for struct statfs. AC_CACHE_CHECK([for struct statfs], [sim_cv_struct_statfs], - [AC_TRY_COMPILE([ + [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/types.h> #ifdef HAVE_SYS_PARAM_H #include <sys/param.h> @@ -151,9 +148,9 @@ AC_CACHE_CHECK([for struct statfs], #endif #ifdef HAVE_SYS_STATFS_H #include <sys/statfs.h> -#endif], [ +#endif]], [[ struct statfs s; -], [sim_cv_struct_statfs="yes"], [sim_cv_struct_statfs="no"])]) +]])],[sim_cv_struct_statfs="yes"],[sim_cv_struct_statfs="no"])]) AS_IF([test x"sim_cv_struct_statfs" = x"yes"], [dnl AC_DEFINE(HAVE_STRUCT_STATFS, 1, [Define if struct statfs is defined in <sys/mount.h>]) @@ -162,12 +159,12 @@ AS_IF([test x"sim_cv_struct_statfs" = x"yes"], [dnl dnl Some System V related checks. AC_CACHE_CHECK([if union semun defined], [sim_cv_has_union_semun], - [AC_TRY_COMPILE([ + [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/types.h> #include <sys/ipc.h> -#include <sys/sem.h>], [ +#include <sys/sem.h>]], [[ union semun arg; -], [sim_cv_has_union_semun="yes"], [sim_cv_has_union_semun="no"])]) +]])],[sim_cv_has_union_semun="yes"],[sim_cv_has_union_semun="no"])]) AS_IF([test x"$sim_cv_has_union_semun" = x"yes"], [dnl AC_DEFINE(HAVE_UNION_SEMUN, 1, [Define if union semun is defined in <sys/sem.h>]) @@ -175,7 +172,7 @@ AS_IF([test x"$sim_cv_has_union_semun" = x"yes"], [dnl AC_CACHE_CHECK([whether System V semaphores are supported], [sim_cv_sysv_sem], - [AC_TRY_COMPILE([ + [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/types.h> #include <sys/ipc.h> #include <sys/sem.h> @@ -185,7 +182,7 @@ AC_CACHE_CHECK([whether System V semaphores are supported], struct semid_ds *buf; ushort *array; }; -#endif], [ +#endif]], [[ union semun arg; int id = semget(IPC_PRIVATE, 1, IPC_CREAT|0400); if (id == -1) @@ -193,23 +190,23 @@ AC_CACHE_CHECK([whether System V semaphores are supported], arg.val = 0; /* avoid implicit type cast to union */ if (semctl(id, 0, IPC_RMID, arg) == -1) return 1; -], [sim_cv_sysv_sem="yes"], [sim_cv_sysv_sem="no"])]) +]])],[sim_cv_sysv_sem="yes"],[sim_cv_sysv_sem="no"])]) AS_IF([test x"$sim_cv_sysv_sem" = x"yes"], [dnl AC_DEFINE(HAVE_SYSV_SEM, 1, [Define if System V semaphores are supported]) ]) AC_CACHE_CHECK([whether System V shared memory is supported], [sim_cv_sysv_shm], - [AC_TRY_COMPILE([ + [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/types.h> #include <sys/ipc.h> -#include <sys/shm.h>], [ +#include <sys/shm.h>]], [[ int id = shmget(IPC_PRIVATE, 1, IPC_CREAT|0400); if (id == -1) return 1; if (shmctl(id, IPC_RMID, 0) == -1) return 1; -], [sim_cv_sysv_shm="yes"], [sim_cv_sysv_shm="no"])]) +]])],[sim_cv_sysv_shm="yes"],[sim_cv_sysv_shm="no"])]) AS_IF([test x"$sim_cv_sysv_shm" = x"yes"], [dnl AC_DEFINE(HAVE_SYSV_SHM, 1, [Define if System V shared memory is supported]) ]) @@ -217,16 +214,16 @@ AS_IF([test x"$sim_cv_sysv_shm" = x"yes"], [dnl dnl Figure out what type of termio/termios support there is AC_CACHE_CHECK([for struct termios], [sim_cv_termios_struct], - [AC_TRY_COMPILE([ + [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/types.h> -#include <sys/termios.h>], [ +#include <sys/termios.h>]], [[ static struct termios x; x.c_iflag = 0; x.c_oflag = 0; x.c_cflag = 0; x.c_lflag = 0; x.c_cc[NCCS] = 0; -], [sim_cv_termios_struct="yes"], [sim_cv_termios_struct="no"])]) +]])],[sim_cv_termios_struct="yes"],[sim_cv_termios_struct="no"])]) if test $sim_cv_termios_struct = yes; then AC_DEFINE([HAVE_TERMIOS_STRUCTURE], 1, [Define if struct termios exists.]) fi @@ -250,16 +247,16 @@ fi if test "$sim_cv_termios_struct" != "yes"; then AC_CACHE_CHECK([for struct termio], [sim_cv_termio_struct], - [AC_TRY_COMPILE([ + [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/types.h> -#include <sys/termio.h>], [ +#include <sys/termio.h>]], [[ static struct termio x; x.c_iflag = 0; x.c_oflag = 0; x.c_cflag = 0; x.c_lflag = 0; x.c_cc[NCC] = 0; -], [sim_cv_termio_struct="yes"], [sim_cv_termio_struct="no"])]) +]])],[sim_cv_termio_struct="yes"],[sim_cv_termio_struct="no"])]) if test $sim_cv_termio_struct = yes; then AC_DEFINE([HAVE_TERMIO_STRUCTURE], 1, [Define if struct termio exists.]) fi @@ -288,7 +285,6 @@ AC_TYPE_GETGROUPS AC_TYPE_MODE_T AC_TYPE_OFF_T AC_TYPE_PID_T -AC_TYPE_SIGNAL AC_TYPE_SIZE_T AC_TYPE_UID_T @@ -344,7 +340,7 @@ if test -r ../readline/Makefile; then READLINE_CFLAGS='-I$(READLINE_SRC)/..' else AC_CHECK_LIB(readline, readline, READLINE_LIB=-lreadline, - AC_ERROR([the required "readline" library is missing]), $TERMCAP_LIB) + AC_MSG_ERROR(the required "readline" library is missing), $TERMCAP_LIB) READLINE_CFLAGS= fi AC_SUBST(READLINE_LIB) diff --git a/sim/m4/sim_ac_toolchain.m4 b/sim/m4/sim_ac_toolchain.m4 index 8e6f6f1..6fd4ab5 100644 --- a/sim/m4/sim_ac_toolchain.m4 +++ b/sim/m4/sim_ac_toolchain.m4 @@ -16,7 +16,7 @@ dnl dnl Setup the toolchain variables. AC_DEFUN([SIM_AC_TOOLCHAIN], [dnl -AC_CANONICAL_SYSTEM +AC_CANONICAL_TARGET AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([AC_PROG_CPP]) AC_C_BIGENDIAN diff --git a/sim/or1k/cpu.c b/sim/or1k/cpu.c index c75e2a0..14e43cc 100644 --- a/sim/or1k/cpu.c +++ b/sim/or1k/cpu.c @@ -1100,6 +1100,38 @@ or1k32bf_h_sys_esr15_set (SIM_CPU *current_cpu, USI newval) SET_H_SYS_ESR15 (newval); } +/* Get the value of h-sys-coreid. */ + +USI +or1k32bf_h_sys_coreid_get (SIM_CPU *current_cpu) +{ + return GET_H_SYS_COREID (); +} + +/* Set a value for h-sys-coreid. */ + +void +or1k32bf_h_sys_coreid_set (SIM_CPU *current_cpu, USI newval) +{ + SET_H_SYS_COREID (newval); +} + +/* Get the value of h-sys-numcores. */ + +USI +or1k32bf_h_sys_numcores_get (SIM_CPU *current_cpu) +{ + return GET_H_SYS_NUMCORES (); +} + +/* Set a value for h-sys-numcores. */ + +void +or1k32bf_h_sys_numcores_set (SIM_CPU *current_cpu, USI newval) +{ + SET_H_SYS_NUMCORES (newval); +} + /* Get the value of h-sys-gpr0. */ USI diff --git a/sim/or1k/cpu.h b/sim/or1k/cpu.h index 7f8a340..ab2c062 100644 --- a/sim/or1k/cpu.h +++ b/sim/or1k/cpu.h @@ -408,6 +408,16 @@ SET_H_SPR (ORSI (SLLSI (SPR_GROUP_SYS, 11), SPR_INDEX_SYS_ESR14), (x));\ do { \ SET_H_SPR (ORSI (SLLSI (SPR_GROUP_SYS, 11), SPR_INDEX_SYS_ESR15), (x));\ ;} while (0) +#define GET_H_SYS_COREID() GET_H_SPR (ORSI (SLLSI (SPR_GROUP_SYS, 11), SPR_INDEX_SYS_COREID)) +#define SET_H_SYS_COREID(x) \ +do { \ +SET_H_SPR (ORSI (SLLSI (SPR_GROUP_SYS, 11), SPR_INDEX_SYS_COREID), (x));\ +;} while (0) +#define GET_H_SYS_NUMCORES() GET_H_SPR (ORSI (SLLSI (SPR_GROUP_SYS, 11), SPR_INDEX_SYS_NUMCORES)) +#define SET_H_SYS_NUMCORES(x) \ +do { \ +SET_H_SPR (ORSI (SLLSI (SPR_GROUP_SYS, 11), SPR_INDEX_SYS_NUMCORES), (x));\ +;} while (0) #define GET_H_SYS_GPR0() GET_H_SPR (ORSI (SLLSI (SPR_GROUP_SYS, 11), SPR_INDEX_SYS_GPR0)) #define SET_H_SYS_GPR0(x) \ do { \ @@ -3379,6 +3389,10 @@ USI or1k32bf_h_sys_esr14_get (SIM_CPU *); void or1k32bf_h_sys_esr14_set (SIM_CPU *, USI); USI or1k32bf_h_sys_esr15_get (SIM_CPU *); void or1k32bf_h_sys_esr15_set (SIM_CPU *, USI); +USI or1k32bf_h_sys_coreid_get (SIM_CPU *); +void or1k32bf_h_sys_coreid_set (SIM_CPU *, USI); +USI or1k32bf_h_sys_numcores_get (SIM_CPU *); +void or1k32bf_h_sys_numcores_set (SIM_CPU *, USI); USI or1k32bf_h_sys_gpr0_get (SIM_CPU *); void or1k32bf_h_sys_gpr0_set (SIM_CPU *, USI); USI or1k32bf_h_sys_gpr1_get (SIM_CPU *); diff --git a/sim/or1k/or1k.c b/sim/or1k/or1k.c index 2d1f7f8..73ab6f0 100644 --- a/sim/or1k/or1k.c +++ b/sim/or1k/or1k.c @@ -206,6 +206,10 @@ or1k_cpu_init (SIM_DESC sd, sim_cpu *current_cpu, const USI or1k_vr, /* Clear the floating point control status register. */ SET_H_SYS_FPCSR (0); + + /* Set this as the one and only core. */ + SET_H_SYS_NUMCORES (1); + SET_H_SYS_COREID (0); } void diff --git a/sim/or1k/traps.c b/sim/or1k/traps.c index 753bfff..d1113ac 100644 --- a/sim/or1k/traps.c +++ b/sim/or1k/traps.c @@ -224,6 +224,8 @@ or1k32bf_mfspr (sim_cpu *current_cpu, USI addr) case SPR_ADDR (SYS, PPC): case SPR_ADDR (SYS, FPCSR): case SPR_ADDR (SYS, EPCR0): + case SPR_ADDR (SYS, COREID): + case SPR_ADDR (SYS, NUMCORES): case SPR_ADDR (MAC, MACLO): case SPR_ADDR (MAC, MACHI): break; diff --git a/sim/ppc/emul_netbsd.c b/sim/ppc/emul_netbsd.c index 950f1f4..37e6c08 100644 --- a/sim/ppc/emul_netbsd.c +++ b/sim/ppc/emul_netbsd.c @@ -146,13 +146,13 @@ write_stat(unsigned_word addr, /* H2T(buf.st_spare2); */ H2T(buf.st_ctime); /* H2T(buf.st_spare3); */ -#ifdef AC_STRUCT_ST_RDEV +#ifdef HAVE_STRUCT_STAT_ST_RDEV H2T(buf.st_rdev); #endif -#ifdef AC_STRUCT_ST_BLKSIZE +#ifdef HAVE_STRUCT_STAT_ST_BLKSIZE H2T(buf.st_blksize); #endif -#ifdef AC_STRUCT_ST_BLOCKS +#ifdef HAVE_STRUCT_STAT_ST_BLOCKS H2T(buf.st_blocks); #endif #if WITH_NetBSD_HOST diff --git a/sim/ppc/emul_unix.c b/sim/ppc/emul_unix.c index 88f6e3a..e63a930 100644 --- a/sim/ppc/emul_unix.c +++ b/sim/ppc/emul_unix.c @@ -1094,19 +1094,19 @@ convert_to_solaris_stat(unsigned_word addr, target.st_gid = H2T_4(host->st_gid); target.st_size = H2T_4(host->st_size); -#ifdef HAVE_ST_RDEV +#ifdef HAVE_STRUCT_STAT_ST_RDEV target.st_rdev = H2T_4(host->st_rdev); #else target.st_rdev = 0; #endif -#ifdef HAVE_ST_BLKSIZE +#ifdef HAVE_STRUCT_STAT_ST_BLKSIZE target.st_blksize = H2T_4(host->st_blksize); #else target.st_blksize = 0; #endif -#ifdef HAVE_ST_BLOCKS +#ifdef HAVE_STRUCT_STAT_ST_BLOCKS target.st_blocks = H2T_4(host->st_blocks); #else target.st_blocks = 0; @@ -2043,19 +2043,19 @@ convert_to_linux_stat(unsigned_word addr, target.st_gid = H2T_4(host->st_gid); target.st_size = H2T_4(host->st_size); -#ifdef HAVE_ST_RDEV +#ifdef HAVE_STRUCT_STAT_ST_RDEV target.st_rdev = H2T_4(host->st_rdev); #else target.st_rdev = 0; #endif -#ifdef HAVE_ST_BLKSIZE +#ifdef HAVE_STRUCT_STAT_ST_BLKSIZE target.st_blksize = H2T_4(host->st_blksize); #else target.st_blksize = 0; #endif -#ifdef HAVE_ST_BLOCKS +#ifdef HAVE_STRUCT_STAT_ST_BLOCKS target.st_blocks = H2T_4(host->st_blocks); #else target.st_blocks = 0; diff --git a/sim/ppc/main.c b/sim/ppc/main.c index 987e89e..afce983 100644 --- a/sim/ppc/main.c +++ b/sim/ppc/main.c @@ -245,7 +245,7 @@ zalloc(long size) /* When a CNTRL-C occures, queue an event to shut down the simulation */ -static RETSIGTYPE +static void cntrl_c(int sig) { psim_stop (simulation); @@ -289,7 +289,7 @@ main(int argc, char * const *argv) psim_stack(simulation, argv, environ); { - RETSIGTYPE (*prev) (int); + void (*prev) (int); prev = signal(SIGINT, cntrl_c); psim_run(simulation); signal(SIGINT, prev); diff --git a/sim/riscv/sim-main.c b/sim/riscv/sim-main.c index 4c949c4..172c593 100644 --- a/sim/riscv/sim-main.c +++ b/sim/riscv/sim-main.c @@ -1302,7 +1302,7 @@ execute_one (SIM_CPU *cpu, unsigned_word iw, const struct riscv_opcode *op) case INSN_CLASS_ZAAMO: case INSN_CLASS_ZALRSC: return execute_a (cpu, iw, op); - case INSN_CLASS_C: + case INSN_CLASS_ZCA: /* Check whether model with C extension is selected. */ if (riscv_cpu->csr.misa & 4) return execute_c (cpu, iw, op); diff --git a/sim/testsuite/common/bits-tst.c b/sim/testsuite/common/bits-tst.c index a30753e..95ca450 100644 --- a/sim/testsuite/common/bits-tst.c +++ b/sim/testsuite/common/bits-tst.c @@ -1,4 +1,5 @@ # 2 "bits-tst.c" +#include <string.h> /* Drive the bit test routines */ @@ -320,9 +321,7 @@ check_bits (int call, int -main (argc, argv) - int argc; - char **argv; +main (int argc, char **argv) { int errors = 0; |