sim: cris/m68hc11: move default endian/alignment to configure
authorMike Frysinger <vapier@gentoo.org>
Thu, 31 Dec 2015 02:01:58 +0000 (21:01 -0500)
committerMike Frysinger <vapier@gentoo.org>
Thu, 31 Dec 2015 02:01:58 +0000 (21:01 -0500)
sim/cris/ChangeLog
sim/cris/configure
sim/cris/configure.ac
sim/cris/sim-if.c
sim/m68hc11/ChangeLog
sim/m68hc11/configure
sim/m68hc11/configure.ac
sim/m68hc11/interp.c

index d6c6b4114d7f0c0298bc5ba25d6c37f798dad45c..9bf94f9709ff1b4d4bd9958f2cd74b45eb6e1477 100644 (file)
@@ -1,3 +1,9 @@
+2015-12-30  Mike Frysinger  <vapier@gentoo.org>
+
+       * sim-if.c (sim_open): Delete current_target_byte_order assignment.
+       * configure.ac: Call SIM_AC_OPTION_ENDIAN.
+       * configure: Regenerate.
+
 2015-12-27  Mike Frysinger  <vapier@gentoo.org>
 
        * sim-if.c (cris_program_offset_write, sim_load): Delete.
index eb1e7f4296de3299e11de4a80caea9e263cf7241..be7f6fc7739c4d0128ec1ba6833dd2d212ffe4ab 100755 (executable)
@@ -764,6 +764,7 @@ enable_sim_trace
 enable_sim_profile
 with_pkgversion
 with_bugurl
+enable_sim_endian
 enable_sim_alignment
 enable_sim_hostendian
 enable_sim_scache
@@ -1421,6 +1422,8 @@ Optional Features:
   --enable-sim-trace=opts Enable tracing of simulated programs
   --enable-sim-profile=opts
                           Enable profiling flags
+  --enable-sim-endian=endian
+                          Specify target byte endian orientation
   --enable-sim-alignment=align
                           Specify strict, nonstrict or forced alignment of
                           memory accesses
@@ -12326,7 +12329,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 12329 "configure"
+#line 12332 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -12432,7 +12435,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 12435 "configure"
+#line 12438 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
 done
 
 
+
+wire_endian="LITTLE_ENDIAN"
+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=BIG_ENDIAN";;
+  l*|L*) sim_endian="-DWITH_TARGET_BYTE_ORDER=LITTLE_ENDIAN";;
+  yes)  if test x"$wire_endian" != x; then
+          sim_endian="-DWITH_TARGET_BYTE_ORDER=${wire_endian}"
+        else
+           if test x"$default_endian" != x; then
+            sim_endian="-DWITH_TARGET_BYTE_ORDER=${default_endian}"
+          else
+            echo "No hard-wired endian for target $target" 1>&6
+            sim_endian="-DWITH_TARGET_BYTE_ORDER=0"
+          fi
+        fi;;
+  no)   if test x"$default_endian" != x; then
+          sim_endian="-DWITH_DEFAULT_TARGET_BYTE_ORDER=${default_endian}"
+        else
+          if test x"$wire_endian" != x; then
+            sim_endian="-DWITH_DEFAULT_TARGET_BYTE_ORDER=${wire_endian}"
+          else
+            echo "No default endian for target $target" 1>&6
+            sim_endian="-DWITH_DEFAULT_TARGET_BYTE_ORDER=0"
+          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=${default_endian}"
+else
+  if test x"$wire_endian" != x; then
+    sim_endian="-DWITH_TARGET_BYTE_ORDER=${wire_endian}"
+  else
+    sim_endian=
+  fi
+fi
+fi
+
 wire_alignment="NONSTRICT_ALIGNMENT"
 default_alignment=""
 
index 4543342a8046aa01f08a83a5623f317c6e6fde8c..4e6b1be7d2a5de1a4af8cc7fcb9acc8464756363 100644 (file)
@@ -8,6 +8,7 @@ SIM_AC_COMMON
 # For dv-rv and rvdummy.
 AC_CHECK_HEADERS(sys/socket.h sys/select.h limits.h sys/param.h)
 
+SIM_AC_OPTION_ENDIAN(LITTLE_ENDIAN)
 SIM_AC_OPTION_ALIGNMENT(NONSTRICT_ALIGNMENT)
 SIM_AC_OPTION_HOSTENDIAN
 SIM_AC_OPTION_SCACHE(16384)
index 142bc7b0d0228e2464ed5940b6a7f7b3725715cb..71afbff31df2a6bc88a5f95b4177e8dcc4eca5cb 100644 (file)
@@ -720,12 +720,6 @@ sim_open (SIM_OPEN_KIND kind, host_callback *callback, struct bfd *abfd,
       return 0;
     }
 
-  /* If we have a binary program, endianness-setting would not be taken
-     from elsewhere unfortunately, so set it here.  At the time of this
-     writing, it isn't used until sim_config, but that might change so
-     set it here before memory is defined or touched.  */
-  current_target_byte_order = LITTLE_ENDIAN;
-
   /* check for/establish the reference program image */
   if (sim_analyze_program (sd,
                           (STATE_PROG_ARGV (sd) != NULL
index ad83c37a6e3a6158038141bad0309a068dd3d863..ee8263e5e5a8207163559d98f9c77ecf24398bf9 100644 (file)
@@ -1,3 +1,10 @@
+2015-12-30  Mike Frysinger  <vapier@gentoo.org>
+
+       * imterp.c (sim_open): Delete current_alignment and
+       current_target_byte_order assignments.
+       * configure.ac: Call SIM_AC_OPTION_ENDIAN.
+       * configure: Regenerate.
+
 2015-12-30  Mike Frysinger  <vapier@gentoo.org>
 
        * wrapper.c (m68hc11_reg_store, m68hc11_reg_fetch): Define.
index 6870e8cf6414dfd585e0eb670fb2f48618e05dd6..d7926d66ed55f09f81100404c78c693cbab108c5 100755 (executable)
@@ -762,6 +762,7 @@ enable_sim_profile
 with_pkgversion
 with_bugurl
 enable_sim_inline
+enable_sim_endian
 enable_sim_alignment
 enable_sim_hostendian
 enable_werror
@@ -1416,6 +1417,8 @@ Optional Features:
                           Enable profiling flags
   --enable-sim-inline=inlines
                           Specify which functions should be inlined
+  --enable-sim-endian=endian
+                          Specify target byte endian orientation
   --enable-sim-alignment=align
                           Specify strict, nonstrict or forced alignment of
                           memory accesses
@@ -12311,7 +12314,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 12314 "configure"
+#line 12317 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -12417,7 +12420,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 12420 "configure"
+#line 12423 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -12951,6 +12954,51 @@ else
 fi
 fi
 
+
+wire_endian="LITTLE_ENDIAN"
+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=BIG_ENDIAN";;
+  l*|L*) sim_endian="-DWITH_TARGET_BYTE_ORDER=LITTLE_ENDIAN";;
+  yes)  if test x"$wire_endian" != x; then
+          sim_endian="-DWITH_TARGET_BYTE_ORDER=${wire_endian}"
+        else
+           if test x"$default_endian" != x; then
+            sim_endian="-DWITH_TARGET_BYTE_ORDER=${default_endian}"
+          else
+            echo "No hard-wired endian for target $target" 1>&6
+            sim_endian="-DWITH_TARGET_BYTE_ORDER=0"
+          fi
+        fi;;
+  no)   if test x"$default_endian" != x; then
+          sim_endian="-DWITH_DEFAULT_TARGET_BYTE_ORDER=${default_endian}"
+        else
+          if test x"$wire_endian" != x; then
+            sim_endian="-DWITH_DEFAULT_TARGET_BYTE_ORDER=${wire_endian}"
+          else
+            echo "No default endian for target $target" 1>&6
+            sim_endian="-DWITH_DEFAULT_TARGET_BYTE_ORDER=0"
+          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=${default_endian}"
+else
+  if test x"$wire_endian" != x; then
+    sim_endian="-DWITH_TARGET_BYTE_ORDER=${wire_endian}"
+  else
+    sim_endian=
+  fi
+fi
+fi
+
 wire_alignment="NONSTRICT_ALIGNMENT"
 default_alignment=""
 
index 5aefda54d8bd4c1c9aecd7521053d28942e4cf16..a368b0c4e2a0ba86cd762b86bb8bda5bae6bee66 100644 (file)
@@ -7,6 +7,7 @@ SIM_AC_COMMON
 
 dnl Options available in this module
 SIM_AC_OPTION_INLINE()
+SIM_AC_OPTION_ENDIAN(LITTLE_ENDIAN)
 SIM_AC_OPTION_ALIGNMENT(NONSTRICT_ALIGNMENT)
 SIM_AC_OPTION_HOSTENDIAN
 SIM_AC_OPTION_WARNINGS
index 7fb7005e94af673fef6130bfd49b05a72b4cc1b8..f1303b487bb7b963364c324cd03e3ae2c0833ac1 100644 (file)
@@ -437,10 +437,6 @@ sim_open (SIM_OPEN_KIND kind, host_callback *callback,
 
   cpu = STATE_CPU (sd, 0);
 
-  /* for compatibility */
-  current_alignment = NONSTRICT_ALIGNMENT;
-  current_target_byte_order = BIG_ENDIAN;
-
   cpu_initialize (sd, cpu);
 
   if (sim_pre_argv_init (sd, argv[0]) != SIM_RC_OK)