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.
This commit is contained in:
Mike Frysinger
2021-06-15 19:51:52 -04:00
parent 4470708442
commit f9a4d54332
151 changed files with 348 additions and 1721 deletions

View File

@@ -1,3 +1,7 @@
2021-06-17 Mike Frysinger <vapier@gentoo.org>
* configure: Regenerate.
2021-06-16 Mike Frysinger <vapier@gentoo.org>
* configure: Regenerate.

8
sim/m32c/configure vendored
View File

@@ -635,9 +635,7 @@ sim_reserved_bits
sim_default_model
sim_scache
sim_float
sim_endian
sim_bitsize
sim_alignment
cgen_breaks
MAINT
MAINTAINER_MODE_FALSE
@@ -10739,7 +10737,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
#line 10742 "configure"
#line 10740 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -10845,7 +10843,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
#line 10848 "configure"
#line 10846 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -11363,8 +11361,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