public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 1/5] sim: riscv: drop subdir configure logic
@ 2022-11-07 16:24 Mike Frysinger
  2022-11-07 16:24 ` [PATCH 2/5] sim: bpf: " Mike Frysinger
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Mike Frysinger @ 2022-11-07 16:24 UTC (permalink / raw)
  To: gdb-patches

We've been using this only to set the default word size to 32-vs-64
based on the $target.  We can easily merge this with the top-level
configure script to clean things up a bit.
---
 sim/Makefile.in        |   16 +-
 sim/configure          |   32 +-
 sim/configure.ac       |    3 +-
 sim/riscv/Makefile.in  |    2 +
 sim/riscv/acinclude.m4 |   21 +
 sim/riscv/aclocal.m4   |   16 -
 sim/riscv/configure    | 3096 ----------------------------------------
 sim/riscv/configure.ac |   17 -
 8 files changed, 65 insertions(+), 3138 deletions(-)
 create mode 100644 sim/riscv/acinclude.m4
 delete mode 100644 sim/riscv/aclocal.m4
 delete mode 100755 sim/riscv/configure
 delete mode 100644 sim/riscv/configure.ac

diff --git a/sim/configure.ac b/sim/configure.ac
index 8bde2a49fdfc..97cea4b6dd8b 100644
--- a/sim/configure.ac
+++ b/sim/configure.ac
@@ -150,7 +150,7 @@ if test "${enable_sim}" != no; then
     SIM_TARGET([or1k*-*-*], [or1k], [true])
     SIM_TARGET([powerpc*-*-*], [ppc], [true])
     SIM_TARGET([pru*-*-*], [pru])
-    SIM_TARGET([riscv*-*-*], [riscv], [true])
+    SIM_TARGET([riscv*-*-*], [riscv])
     SIM_TARGET([rl78-*-*], [rl78])
     SIM_TARGET([rx-*-*], [rx])
     SIM_TARGET([sh*-*-*], [sh])
@@ -203,6 +203,7 @@ AC_SUBST(sim_float)
 
 dnl Some arches have unique configure flags.
 m4_include([frv/acinclude.m4])
+m4_include([riscv/acinclude.m4])
 m4_include([rx/acinclude.m4])
 
 dnl Hack to output an "include" statement in the Makefile so automake doesn't
diff --git a/sim/riscv/Makefile.in b/sim/riscv/Makefile.in
index 9aa663b515a5..25a83f938982 100644
--- a/sim/riscv/Makefile.in
+++ b/sim/riscv/Makefile.in
@@ -24,4 +24,6 @@ SIM_OBJS = \
 	machs.o \
 	sim-main.o
 
+SIM_EXTRA_CFLAGS = -DWITH_TARGET_WORD_BITSIZE=@SIM_RISCV_BITSIZE@
+
 ## COMMON_POST_CONFIG_FRAG
diff --git a/sim/riscv/acinclude.m4 b/sim/riscv/acinclude.m4
new file mode 100644
index 000000000000..29dcaebc61d6
--- /dev/null
+++ b/sim/riscv/acinclude.m4
@@ -0,0 +1,21 @@
+dnl Copyright (C) 2022 Free Software Foundation, Inc.
+dnl
+dnl This program is free software; you can redistribute it and/or modify
+dnl it under the terms of the GNU General Public License as published by
+dnl the Free Software Foundation; either version 3 of the License, or
+dnl (at your option) any later version.
+dnl
+dnl This program is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+dnl GNU General Public License for more details.
+dnl
+dnl You should have received a copy of the GNU General Public License
+dnl along with this program.  If not, see <http://www.gnu.org/licenses/>.
+dnl
+dnl NB: This file is included in sim/configure, so keep settings namespaced.
+AC_MSG_CHECKING([riscv bitsize])
+SIM_RISCV_BITSIZE=64
+AS_CASE([$target],
+	[riscv32*], [SIM_RISCV_BITSIZE=32])
+AC_SUBST(SIM_RISCV_BITSIZE)
diff --git a/sim/riscv/configure.ac b/sim/riscv/configure.ac
deleted file mode 100644
index 0e74a1edda5c..000000000000
--- a/sim/riscv/configure.ac
+++ /dev/null
@@ -1,17 +0,0 @@
-dnl Process this file with autoconf to produce a configure script.
-AC_INIT(Makefile.in)
-AC_CONFIG_MACRO_DIRS([../m4 ../.. ../../config])
-
-dnl The sim shouldn't be checking $target and changing behavior.  But it is,
-dnl and until we clean that up, we need to expand --target for use below.
-AC_CANONICAL_SYSTEM
-
-# Select the bitsize of the target.
-riscv_addr_bitsize=
-case "${target}" in
-riscv32*) riscv_addr_bitsize=32 ;;
-riscv*) riscv_addr_bitsize=64 ;;
-esac
-SIM_AC_OPTION_BITSIZE($riscv_addr_bitsize)
-
-SIM_AC_OUTPUT
-- 
2.38.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 2/5] sim: bpf: drop subdir configure logic
  2022-11-07 16:24 [PATCH 1/5] sim: riscv: drop subdir configure logic Mike Frysinger
@ 2022-11-07 16:24 ` Mike Frysinger
  2022-11-07 16:24 ` [PATCH 3/5] sim: or1k: " Mike Frysinger
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Mike Frysinger @ 2022-11-07 16:24 UTC (permalink / raw)
  To: gdb-patches

We've been using this only to set the default word size to 64.  We
can easily move this into the makefile via a -D compiler flag and
clean up the build logic quite a bit.
---
 sim/Makefile.in      |   32 +-
 sim/bpf/Makefile.in  |    2 +
 sim/bpf/aclocal.m4   |   16 -
 sim/bpf/configure    | 2932 ------------------------------------------
 sim/bpf/configure.ac |    7 -
 sim/configure        |   32 +-
 sim/configure.ac     |    2 +-
 7 files changed, 44 insertions(+), 2979 deletions(-)
 delete mode 100644 sim/bpf/aclocal.m4
 delete mode 100755 sim/bpf/configure
 delete mode 100644 sim/bpf/configure.ac

diff --git a/sim/bpf/Makefile.in b/sim/bpf/Makefile.in
index 522484235357..3fa3b67f12d2 100644
--- a/sim/bpf/Makefile.in
+++ b/sim/bpf/Makefile.in
@@ -31,6 +31,8 @@ SIM_OBJS = \
 	$(BPF_GEN_OBJS) \
 	$(BPF_HAND_OBJS)
 
+SIM_EXTRA_CFLAGS = -DWITH_TARGET_WORD_BITSIZE=64
+
 SIM_EXTRA_CLEAN = bpf-clean
 
 ## COMMON_POST_CONFIG_FRAG
diff --git a/sim/bpf/configure.ac b/sim/bpf/configure.ac
deleted file mode 100644
index 87654ec6a919..000000000000
--- a/sim/bpf/configure.ac
+++ /dev/null
@@ -1,7 +0,0 @@
-dnl Process this file with autoconf to produce a configure script.
-AC_INIT(Makefile.in)
-AC_CONFIG_MACRO_DIRS([../m4 ../.. ../../config])
-
-SIM_AC_OPTION_BITSIZE([64])
-
-SIM_AC_OUTPUT
diff --git a/sim/configure.ac b/sim/configure.ac
index 97cea4b6dd8b..c179e636a226 100644
--- a/sim/configure.ac
+++ b/sim/configure.ac
@@ -129,7 +129,7 @@ if test "${enable_sim}" != no; then
     SIM_TARGET([arm*-*-*], [arm])
     SIM_TARGET([avr*-*-*], [avr])
     SIM_TARGET([bfin-*-*], [bfin])
-    SIM_TARGET([bpf-*-*], [bpf], [true])
+    SIM_TARGET([bpf-*-*], [bpf])
     SIM_TARGET([cr16*-*-*], [cr16])
     SIM_TARGET([cris-*-* | crisv32-*-*], [cris])
     SIM_TARGET([d10v-*-*], [d10v])
-- 
2.38.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 3/5] sim: or1k: drop subdir configure logic
  2022-11-07 16:24 [PATCH 1/5] sim: riscv: drop subdir configure logic Mike Frysinger
  2022-11-07 16:24 ` [PATCH 2/5] sim: bpf: " Mike Frysinger
@ 2022-11-07 16:24 ` Mike Frysinger
  2022-11-07 16:24 ` [PATCH 4/5] sim: mn10300: " Mike Frysinger
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Mike Frysinger @ 2022-11-07 16:24 UTC (permalink / raw)
  To: gdb-patches

We've been using this only to set the default word size to 32.  We
can easily move this into the makefile via a -D compiler flag and
clean up the build logic quite a bit.
---
 sim/Makefile.in       |   15 +-
 sim/configure         |   24 +-
 sim/configure.ac      |    2 +-
 sim/or1k/Makefile.in  |    2 +
 sim/or1k/aclocal.m4   |   16 -
 sim/or1k/configure    | 2932 -----------------------------------------
 sim/or1k/configure.ac |    7 -
 7 files changed, 32 insertions(+), 2966 deletions(-)
 delete mode 100644 sim/or1k/aclocal.m4
 delete mode 100755 sim/or1k/configure
 delete mode 100644 sim/or1k/configure.ac

diff --git a/sim/configure.ac b/sim/configure.ac
index c179e636a226..48bf75e88085 100644
--- a/sim/configure.ac
+++ b/sim/configure.ac
@@ -147,7 +147,7 @@ if test "${enable_sim}" != no; then
     SIM_TARGET([mn10300*-*-*], [mn10300], [true], [sim_igen=yes])
     SIM_TARGET([moxie-*-*], [moxie])
     SIM_TARGET([msp430*-*-*], [msp430])
-    SIM_TARGET([or1k*-*-*], [or1k], [true])
+    SIM_TARGET([or1k*-*-*], [or1k])
     SIM_TARGET([powerpc*-*-*], [ppc], [true])
     SIM_TARGET([pru*-*-*], [pru])
     SIM_TARGET([riscv*-*-*], [riscv])
diff --git a/sim/or1k/Makefile.in b/sim/or1k/Makefile.in
index fdf49835c7b8..17c40bcdc544 100644
--- a/sim/or1k/Makefile.in
+++ b/sim/or1k/Makefile.in
@@ -40,6 +40,8 @@ SIM_OBJS = \
 
 SIM_OBJS += $(OR1K_OBJS)
 
+SIM_EXTRA_CFLAGS = -DWITH_TARGET_WORD_BITSIZE=32 -DWITH_TARGET_WORD_MSB=31
+
 ## COMMON_POST_CONFIG_FRAG
 
 arch = or1k
diff --git a/sim/or1k/configure.ac b/sim/or1k/configure.ac
deleted file mode 100644
index a0fe51c897bc..000000000000
--- a/sim/or1k/configure.ac
+++ /dev/null
@@ -1,7 +0,0 @@
-dnl Process this file with autoconf to produce a configure script.
-AC_INIT(Makefile.in)
-AC_CONFIG_MACRO_DIRS([../m4 ../.. ../../config])
-
-SIM_AC_OPTION_BITSIZE([32], [31])
-
-SIM_AC_OUTPUT
-- 
2.38.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 4/5] sim: mn10300: drop subdir configure logic
  2022-11-07 16:24 [PATCH 1/5] sim: riscv: drop subdir configure logic Mike Frysinger
  2022-11-07 16:24 ` [PATCH 2/5] sim: bpf: " Mike Frysinger
  2022-11-07 16:24 ` [PATCH 3/5] sim: or1k: " Mike Frysinger
@ 2022-11-07 16:24 ` Mike Frysinger
  2022-11-07 16:24 ` [PATCH 5/5] sim: v850: " Mike Frysinger
  2022-11-07 16:45 ` [PATCH] sim: riscv: add missing AC_MSG_RESULT call Mike Frysinger
  4 siblings, 0 replies; 6+ messages in thread
From: Mike Frysinger @ 2022-11-07 16:24 UTC (permalink / raw)
  To: gdb-patches

We've been using this only to set the default word size to 32.  We
can easily move this into the makefile via a -D compiler flag and
clean up the build logic quite a bit.
---
 sim/Makefile.in          |   18 +-
 sim/configure            |   24 +-
 sim/configure.ac         |    2 +-
 sim/mn10300/Makefile.in  |    4 +-
 sim/mn10300/aclocal.m4   |   16 -
 sim/mn10300/configure    | 2932 --------------------------------------
 sim/mn10300/configure.ac |    7 -
 7 files changed, 34 insertions(+), 2969 deletions(-)
 delete mode 100644 sim/mn10300/aclocal.m4
 delete mode 100755 sim/mn10300/configure
 delete mode 100644 sim/mn10300/configure.ac

diff --git a/sim/configure.ac b/sim/configure.ac
index 48bf75e88085..cec89bb94812 100644
--- a/sim/configure.ac
+++ b/sim/configure.ac
@@ -144,7 +144,7 @@ if test "${enable_sim}" != no; then
     SIM_TARGET([mcore-*-*], [mcore])
     SIM_TARGET([microblaze*-*-*], [microblaze])
     SIM_TARGET([mips*-*-*], [mips], [true], [sim_igen=yes])
-    SIM_TARGET([mn10300*-*-*], [mn10300], [true], [sim_igen=yes])
+    SIM_TARGET([mn10300*-*-*], [mn10300], [], [sim_igen=yes])
     SIM_TARGET([moxie-*-*], [moxie])
     SIM_TARGET([msp430*-*-*], [msp430])
     SIM_TARGET([or1k*-*-*], [or1k])
diff --git a/sim/mn10300/Makefile.in b/sim/mn10300/Makefile.in
index f8ac93cdd56e..521f86c644be 100644
--- a/sim/mn10300/Makefile.in
+++ b/sim/mn10300/Makefile.in
@@ -28,6 +28,8 @@ SIM_OBJS = $(MN10300_OBJS) interp.o
 SIM_EXTRA_HW_DEVICES = mn103cpu mn103int mn103tim mn103ser mn103iop
 
 # List of extra flags to always pass to $(CC).
-SIM_EXTRA_CFLAGS = -DPOLL_QUIT_INTERVAL=0x20
+SIM_EXTRA_CFLAGS = \
+	-DPOLL_QUIT_INTERVAL=0x20 \
+	-DWITH_TARGET_WORD_BITSIZE=32 -DWITH_TARGET_WORD_MSB=31
 
 ## COMMON_POST_CONFIG_FRAG
diff --git a/sim/mn10300/configure.ac b/sim/mn10300/configure.ac
deleted file mode 100644
index 1fa7c0ef7c9f..000000000000
--- a/sim/mn10300/configure.ac
+++ /dev/null
@@ -1,7 +0,0 @@
-dnl Process this file with autoconf to produce a configure script.
-AC_INIT(Makefile.in)
-AC_CONFIG_MACRO_DIRS([../m4 ../.. ../../config])
-
-SIM_AC_OPTION_BITSIZE(32,31)
-
-SIM_AC_OUTPUT
-- 
2.38.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 5/5] sim: v850: drop subdir configure logic
  2022-11-07 16:24 [PATCH 1/5] sim: riscv: drop subdir configure logic Mike Frysinger
                   ` (2 preceding siblings ...)
  2022-11-07 16:24 ` [PATCH 4/5] sim: mn10300: " Mike Frysinger
@ 2022-11-07 16:24 ` Mike Frysinger
  2022-11-07 16:45 ` [PATCH] sim: riscv: add missing AC_MSG_RESULT call Mike Frysinger
  4 siblings, 0 replies; 6+ messages in thread
From: Mike Frysinger @ 2022-11-07 16:24 UTC (permalink / raw)
  To: gdb-patches

We've been using this only to set the default word size to 32.  We
can easily move this into the makefile via a -D compiler flag and
clean up the build logic quite a bit.
---
 sim/Makefile.in       |    4 +-
 sim/configure         |   26 +-
 sim/configure.ac      |    2 +-
 sim/v850/Makefile.in  |    2 +
 sim/v850/aclocal.m4   |   16 -
 sim/v850/configure    | 2932 -----------------------------------------
 sim/v850/configure.ac |    7 -
 7 files changed, 27 insertions(+), 2962 deletions(-)
 delete mode 100644 sim/v850/aclocal.m4
 delete mode 100755 sim/v850/configure
 delete mode 100644 sim/v850/configure.ac

diff --git a/sim/configure.ac b/sim/configure.ac
index cec89bb94812..675fa1bb44d6 100644
--- a/sim/configure.ac
+++ b/sim/configure.ac
@@ -155,7 +155,7 @@ if test "${enable_sim}" != no; then
     SIM_TARGET([rx-*-*], [rx])
     SIM_TARGET([sh*-*-*], [sh])
     SIM_TARGET([sparc-*-*], [erc32])
-    SIM_TARGET([v850*-*-*], [v850], [true], [sim_igen=yes])
+    SIM_TARGET([v850*-*-*], [v850], [], [sim_igen=yes])
   done
 
   if test "x${enable_example_sims}" = xyes; then
diff --git a/sim/v850/Makefile.in b/sim/v850/Makefile.in
index ec70b0bb15a5..c71ccf080e9b 100644
--- a/sim/v850/Makefile.in
+++ b/sim/v850/Makefile.in
@@ -23,4 +23,6 @@ SIM_OBJS = \
 	itable.o semantics.o idecode.o icache.o engine.o irun.o support.o \
 	sim-resume.o
 
+SIM_EXTRA_CFLAGS = -DWITH_TARGET_WORD_BITSIZE=32 -DWITH_TARGET_WORD_MSB=31
+
 ## COMMON_POST_CONFIG_FRAG
diff --git a/sim/v850/configure.ac b/sim/v850/configure.ac
deleted file mode 100644
index 1fa7c0ef7c9f..000000000000
--- a/sim/v850/configure.ac
+++ /dev/null
@@ -1,7 +0,0 @@
-dnl Process this file with autoconf to produce a configure script.
-AC_INIT(Makefile.in)
-AC_CONFIG_MACRO_DIRS([../m4 ../.. ../../config])
-
-SIM_AC_OPTION_BITSIZE(32,31)
-
-SIM_AC_OUTPUT
-- 
2.38.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH] sim: riscv: add missing AC_MSG_RESULT call
  2022-11-07 16:24 [PATCH 1/5] sim: riscv: drop subdir configure logic Mike Frysinger
                   ` (3 preceding siblings ...)
  2022-11-07 16:24 ` [PATCH 5/5] sim: v850: " Mike Frysinger
@ 2022-11-07 16:45 ` Mike Frysinger
  4 siblings, 0 replies; 6+ messages in thread
From: Mike Frysinger @ 2022-11-07 16:45 UTC (permalink / raw)
  To: gdb-patches

Previous commit in here forgot to include this.
---
 sim/configure          | 2 ++
 sim/riscv/acinclude.m4 | 1 +
 2 files changed, 3 insertions(+)

diff --git a/sim/riscv/acinclude.m4 b/sim/riscv/acinclude.m4
index 29dcaebc61d6..0a421f4d4d53 100644
--- a/sim/riscv/acinclude.m4
+++ b/sim/riscv/acinclude.m4
@@ -18,4 +18,5 @@ AC_MSG_CHECKING([riscv bitsize])
 SIM_RISCV_BITSIZE=64
 AS_CASE([$target],
 	[riscv32*], [SIM_RISCV_BITSIZE=32])
+AC_MSG_RESULT([$SIM_RISCV_BITSIZE])
 AC_SUBST(SIM_RISCV_BITSIZE)
-- 
2.38.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-11-07 16:45 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-07 16:24 [PATCH 1/5] sim: riscv: drop subdir configure logic Mike Frysinger
2022-11-07 16:24 ` [PATCH 2/5] sim: bpf: " Mike Frysinger
2022-11-07 16:24 ` [PATCH 3/5] sim: or1k: " Mike Frysinger
2022-11-07 16:24 ` [PATCH 4/5] sim: mn10300: " Mike Frysinger
2022-11-07 16:24 ` [PATCH 5/5] sim: v850: " Mike Frysinger
2022-11-07 16:45 ` [PATCH] sim: riscv: add missing AC_MSG_RESULT call Mike Frysinger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).