diff options
author | Mike Frysinger <vapier@gentoo.org> | 2021-06-15 19:51:52 -0400 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2021-06-17 23:20:13 -0400 |
commit | f9a4d54332f9e1f75701ba43249a03cc631ec736 (patch) | |
tree | 2dd0b32c633005ac4378a2282d9726885e09a7b5 /sim/bfin | |
parent | 4470708442cef1c818c4322f975d9017307f0243 (diff) | |
download | fsf-binutils-gdb-f9a4d54332f9e1f75701ba43249a03cc631ec736.zip fsf-binutils-gdb-f9a4d54332f9e1f75701ba43249a03cc631ec736.tar.gz fsf-binutils-gdb-f9a4d54332f9e1f75701ba43249a03cc631ec736.tar.bz2 |
sim: overhaul & unify endian settings management
The m4 macro has 2 args: the "wire" settings (which represents the
hardwired port behavior), and the default settings (which are used
if nothing else is specified). If none are specified, the arch is
expected to support both, and the value will be probed based on the
user runtime options or the input program.
Only two arches today set the default value (bpf & mips). We can
probably let this go as it only shows up in one scenario: the sim
is invoked, but with no inputs, and no user endian selection. This
means bpf will not behave like the other arches: an error is shown
and forces the user to make a choice. If an input program is used
though, we'll still switch the default to that. This allows us to
remove the WITH_DEFAULT_TARGET_BYTE_ORDER setting.
For the ports that set a "wire" endian, move it to the runtime init
of the respective sim_open calls. This allows us to change the
WITH_TARGET_BYTE_ORDER to purely a user-selected configure setting
if they want to force a specific endianness.
With all the endian logic moved to runtime selection, we can move
the configure call up to the common dir so we only process it once
across all ports.
The ppc arch was picking the wire endian based on the target used,
but since we weren't doing that for other biendian arches, we can
let this go too. We'll rely on the input selecting the endian, or
make the user decide.
Diffstat (limited to 'sim/bfin')
-rw-r--r-- | sim/bfin/ChangeLog | 6 | ||||
-rw-r--r-- | sim/bfin/aclocal.m4 | 1 | ||||
-rwxr-xr-x | sim/bfin/configure | 56 | ||||
-rw-r--r-- | sim/bfin/configure.ac | 1 | ||||
-rw-r--r-- | sim/bfin/interp.c | 1 |
5 files changed, 9 insertions, 56 deletions
diff --git a/sim/bfin/ChangeLog b/sim/bfin/ChangeLog index da2ef6e..fa97d8e 100644 --- a/sim/bfin/ChangeLog +++ b/sim/bfin/ChangeLog @@ -1,3 +1,9 @@ +2021-06-17 Mike Frysinger <vapier@gentoo.org> + + * configure.ac: Delete SIM_AC_OPTION_ENDIAN call. + * interp.c (sim_open): Set current_target_byte_order. + * aclocal.m4, configure: Regenerate. + 2021-06-16 Mike Frysinger <vapier@gentoo.org> * configure: Regenerate. diff --git a/sim/bfin/aclocal.m4 b/sim/bfin/aclocal.m4 index 529d860..4957db8 100644 --- a/sim/bfin/aclocal.m4 +++ b/sim/bfin/aclocal.m4 @@ -112,7 +112,6 @@ m4_include([../../ltversion.m4]) m4_include([../../lt~obsolete.m4]) m4_include([../m4/sim_ac_common.m4]) m4_include([../m4/sim_ac_option_default_model.m4]) -m4_include([../m4/sim_ac_option_endian.m4]) m4_include([../m4/sim_ac_option_hardware.m4]) m4_include([../m4/sim_ac_option_inline.m4]) m4_include([../m4/sim_ac_option_warnings.m4]) diff --git a/sim/bfin/configure b/sim/bfin/configure index b19f154..d4aa3a2 100755 --- a/sim/bfin/configure +++ b/sim/bfin/configure @@ -635,7 +635,6 @@ sim_reserved_bits sim_scache sim_float sim_bitsize -sim_alignment cgen_breaks SDL_LIBS SDL_CFLAGS @@ -758,7 +757,6 @@ sim_inline sim_hw sim_hw_objs sim_hw_cflags -sim_endian sim_default_model' ac_subst_files='' ac_user_opts=' @@ -773,7 +771,6 @@ with_gnu_ld enable_libtool_lock enable_maintainer_mode enable_sim_inline -enable_sim_endian enable_sim_default_model enable_sim_hardware enable_werror @@ -1422,8 +1419,6 @@ Optional Features: sometimes confusing) to the casual installer --enable-sim-inline=inlines 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-hardware=LIST @@ -10762,7 +10757,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 10765 "configure" +#line 10760 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -10868,7 +10863,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 10871 "configure" +#line 10866 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -11164,51 +11159,6 @@ fi -wire_endian="LITTLE" -default_endian="" -# Check whether --enable-sim-endian was given. -if test "${enable_sim_endian+set}" = set; then : - enableval=$enable_sim_endian; case "${enableval}" in - b*|B*) sim_endian="-DWITH_TARGET_BYTE_ORDER=BFD_ENDIAN_BIG";; - l*|L*) sim_endian="-DWITH_TARGET_BYTE_ORDER=BFD_ENDIAN_LITTLE";; - yes) if test x"$wire_endian" != x; then - sim_endian="-DWITH_TARGET_BYTE_ORDER=BFD_ENDIAN_${wire_endian}" - else - if test x"$default_endian" != x; then - sim_endian="-DWITH_TARGET_BYTE_ORDER=BFD_ENDIAN_${default_endian}" - else - echo "No hard-wired endian for target $target" 1>&6 - sim_endian="-DWITH_TARGET_BYTE_ORDER=BFD_ENDIAN_UNKNOWN" - fi - fi;; - no) if test x"$default_endian" != x; then - sim_endian="-DWITH_DEFAULT_TARGET_BYTE_ORDER=BFD_ENDIAN_${default_endian}" - else - if test x"$wire_endian" != x; then - sim_endian="-DWITH_DEFAULT_TARGET_BYTE_ORDER=BFD_ENDIAN_${wire_endian}" - else - echo "No default endian for target $target" 1>&6 - sim_endian="-DWITH_DEFAULT_TARGET_BYTE_ORDER=BFD_ENDIAN_UNKNOWN" - fi - fi;; - *) as_fn_error $? "\"Unknown value $enableval for --enable-sim-endian\"" "$LINENO" 5; sim_endian="";; -esac -if test x"$silent" != x"yes" && test x"$sim_endian" != x""; then - echo "Setting endian flags = $sim_endian" 6>&1 -fi -else - if test x"$default_endian" != x; then - sim_endian="-DWITH_DEFAULT_TARGET_BYTE_ORDER=BFD_ENDIAN_${default_endian}" -else - if test x"$wire_endian" != x; then - sim_endian="-DWITH_TARGET_BYTE_ORDER=BFD_ENDIAN_${wire_endian}" - else - sim_endian= - fi -fi -fi - - default_sim_default_model="bf537" # Check whether --enable-sim-default-model was given. if test "${enable_sim_default_model+set}" = set; then : @@ -11744,8 +11694,6 @@ ac_config_commands="$ac_config_commands stamp-h" - - cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure diff --git a/sim/bfin/configure.ac b/sim/bfin/configure.ac index ddc7bc6..9b17dc4 100644 --- a/sim/bfin/configure.ac +++ b/sim/bfin/configure.ac @@ -4,7 +4,6 @@ AC_CONFIG_MACRO_DIRS([../m4 ../.. ../../config]) SIM_AC_COMMON -SIM_AC_OPTION_ENDIAN(LITTLE) SIM_AC_OPTION_DEFAULT_MODEL(bf537) SIM_AC_OPTION_HARDWARE(\ bfin_cec \ diff --git a/sim/bfin/interp.c b/sim/bfin/interp.c index 10de001..216cefe 100644 --- a/sim/bfin/interp.c +++ b/sim/bfin/interp.c @@ -704,6 +704,7 @@ sim_open (SIM_OPEN_KIND kind, host_callback *callback, /* Set default options before parsing user options. */ current_alignment = STRICT_ALIGNMENT; + current_target_byte_order = BFD_ENDIAN_LITTLE; /* The cpu data is kept in a separately allocated chunk of memory. */ if (sim_cpu_alloc_all (sd, 1) != SIM_RC_OK) |