aboutsummaryrefslogtreecommitdiff
path: root/sim/configure
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2021-06-15 19:51:52 -0400
committerMike Frysinger <vapier@gentoo.org>2021-06-17 23:20:13 -0400
commitf9a4d54332f9e1f75701ba43249a03cc631ec736 (patch)
tree2dd0b32c633005ac4378a2282d9726885e09a7b5 /sim/configure
parent4470708442cef1c818c4322f975d9017307f0243 (diff)
downloadgdb-f9a4d54332f9e1f75701ba43249a03cc631ec736.zip
gdb-f9a4d54332f9e1f75701ba43249a03cc631ec736.tar.gz
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/configure')
-rwxr-xr-xsim/configure23
1 files changed, 23 insertions, 0 deletions
diff --git a/sim/configure b/sim/configure
index 5bfbd60..959fa90 100755
--- a/sim/configure
+++ b/sim/configure
@@ -758,6 +758,7 @@ enable_targets
enable_sim_alignment
enable_sim_assert
enable_sim_debug
+enable_sim_endian
enable_sim_environment
enable_sim_profile
enable_sim_stdio
@@ -1440,6 +1441,8 @@ Optional Features:
--enable-sim-assert Specify whether to perform random assertions
--enable-sim-debug=opts Enable debugging flags (for developers of the sim
itself)
+ --enable-sim-endian=endian
+ Specify target byte endian orientation
--enable-sim-environment=environment
Specify mixed, user, virtual or operating
environment
@@ -6751,6 +6754,26 @@ _ACEOF
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $sim_debug" >&5
$as_echo "$sim_debug" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to force sim endianness" >&5
+$as_echo_n "checking whether to force sim endianness... " >&6; }
+sim_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="BFD_ENDIAN_BIG";;
+ l*|L*) sim_endian="BFD_ENDIAN_LITTLE";;
+ yes | no) ;;
+ *) as_fn_error $? "\"Unknown value $enableval for --enable-sim-endian\"" "$LINENO" 5;;
+esac
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define WITH_TARGET_BYTE_ORDER ${sim_endian:-BFD_ENDIAN_UNKNOWN}
+_ACEOF
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sim_alignment:-no}" >&5
+$as_echo "${sim_alignment:-no}" >&6; }
+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking default sim environment setting" >&5
$as_echo_n "checking default sim environment setting... " >&6; }