public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Mike Frysinger <vapier@gentoo.org>
To: gdb-patches@sourceware.org
Subject: [PATCH 9/9] sim: smp: plumb igen flag down to all users
Date: Sun, 25 Dec 2022 02:14:34 -0500	[thread overview]
Message-ID: <20221225071434.30014-9-vapier@gentoo.org> (raw)
In-Reply-To: <20221225071434.30014-1-vapier@gentoo.org>

While mips has respected sim_igen_smp at configure time (which was
always empty since it defaulted smp to off), no other igen port did.
Move this to a makefile variable and plumb it through the common
IGEN_RUN variable instead so everyone gets it by default.  We also
clean up some redundant -N0 setting with multirun mips.
---
 sim/Makefile.in             |  3 ++-
 sim/arch-subdir.mk.in       |  3 +++
 sim/common/Make-common.in   |  2 +-
 sim/configure               | 16 +++++++++-------
 sim/igen/local.mk           |  2 +-
 sim/m4/sim_ac_option_smp.m4 |  3 ++-
 sim/mips/Makefile.in        |  2 --
 sim/mips/acinclude.m4       |  8 ++++----
 8 files changed, 22 insertions(+), 17 deletions(-)

diff --git a/sim/arch-subdir.mk.in b/sim/arch-subdir.mk.in
index cfde3f3fb785..e6c779a20d57 100644
--- a/sim/arch-subdir.mk.in
+++ b/sim/arch-subdir.mk.in
@@ -73,3 +73,6 @@ SIM_INLINE = @SIM_INLINE@
 SIM_HW_CFLAGS = @SIM_HW_CFLAGS@
 SIM_HW_OBJS = $(SIM_HW_DEVICES:%=dv-%.o)
 @SIM_ENABLE_HW_FALSE@SIM_HW_OBJS =
+
+# TODO: Delete this once mips/Makefile.in igen moves to mips/local.mk.
+IGEN_FLAGS_SMP = @IGEN_FLAGS_SMP@
diff --git a/sim/common/Make-common.in b/sim/common/Make-common.in
index 52cc3c926f7f..7b1caa0781f1 100644
--- a/sim/common/Make-common.in
+++ b/sim/common/Make-common.in
@@ -82,7 +82,7 @@ POSTCOMPILE = @true
 # igen leaks memory, and therefore makes AddressSanitizer unhappy.  Disable
 # leak detection while running it.
 IGEN = ../igen/igen$(EXEEXT)
-IGEN_RUN = ASAN_OPTIONS=detect_leaks=0 $(IGEN)
+IGEN_RUN = ASAN_OPTIONS=detect_leaks=0 $(IGEN) $(IGEN_FLAGS_SMP)
 
 # Each simulator's Makefile.in defines one or more of these variables
 # to override our settings as necessary.  There is no need to define these
diff --git a/sim/igen/local.mk b/sim/igen/local.mk
index bf984db5edfc..5d552952b990 100644
--- a/sim/igen/local.mk
+++ b/sim/igen/local.mk
@@ -22,7 +22,7 @@
 # igen leaks memory, and therefore makes AddressSanitizer unhappy.  Disable
 # leak detection while running it.
 IGEN = %D%/igen$(EXEEXT)
-IGEN_RUN = ASAN_OPTIONS=detect_leaks=0 $(IGEN)
+IGEN_RUN = ASAN_OPTIONS=detect_leaks=0 $(IGEN) $(IGEN_FLAGS_SMP)
 
 ## This makes sure igen is available before building the arch-subdirs which
 ## need to run the igen tool.
diff --git a/sim/m4/sim_ac_option_smp.m4 b/sim/m4/sim_ac_option_smp.m4
index 5c2b35f9d846..47ddabd05f4a 100644
--- a/sim/m4/sim_ac_option_smp.m4
+++ b/sim/m4/sim_ac_option_smp.m4
@@ -27,7 +27,8 @@ AC_ARG_ENABLE(sim-smp,
   no)	sim_smp="0";;
   *)	sim_smp="$enableval";;
 esac])dnl
-sim_igen_smp="-N ${sim_smp}"
+IGEN_FLAGS_SMP="-N ${sim_smp}"
+AC_SUBST(IGEN_FLAGS_SMP)
 dnl NB: The ppc code uses a diff default because its smp works.  That is why
 dnl we don't unconditionally enable WITH_SMP here.  Once we unify ppc, we can
 dnl make this unconditional.
diff --git a/sim/mips/Makefile.in b/sim/mips/Makefile.in
index c287a632ae73..8493f8780dc3 100644
--- a/sim/mips/Makefile.in
+++ b/sim/mips/Makefile.in
@@ -422,7 +422,6 @@ tmp-mach-multi: $(IGEN_INSN) $(IGEN_DC) $(IGEN) $(IGEN_INCLUDE)
 		-I $(srcdir) \
 		-Werror \
 		-Wnodiscard \
-		-N 0 \
 		-M $${m} \
 		-G gen-direct-access \
 		-G gen-zero-r0 \
@@ -451,7 +450,6 @@ tmp-itable-multi: $(IGEN_INSN) $(IGEN_DC) $(IGEN) $(IGEN_INCLUDE)
 		-Werror \
 		-Wnodiscard \
 		-Wnowidth \
-		-N 0 \
 		$(SIM_MIPS_MULTI_FLAGS) \
 		-G gen-direct-access \
 		-G gen-zero-r0 \
diff --git a/sim/mips/acinclude.m4 b/sim/mips/acinclude.m4
index 0a8bf97ba854..ae5cc294a031 100644
--- a/sim/mips/acinclude.m4
+++ b/sim/mips/acinclude.m4
@@ -322,10 +322,10 @@ __EOF__
   dnl For clean-extra target.
   SIM_MIPS_MULTI_SRC=doesnt-exist.c
 ])
-SIM_MIPS_IGEN_FLAGS="-F ${sim_mips_igen_filter} ${sim_mips_igen_machine} ${sim_igen_smp}"
-SIM_MIPS_M16_FLAGS="-F ${sim_mips_m16_filter} ${sim_mips_m16_machine} ${sim_igen_smp}"
-SIM_MIPS_MICROMIPS16_FLAGS="-F ${sim_mips_micromips16_filter} ${sim_mips_micromips16_machine} ${sim_igen_smp}"
-SIM_MIPS_MICROMIPS_FLAGS="-F ${sim_mips_micromips_filter} ${sim_mips_micromips_machine} ${sim_igen_smp}"
+SIM_MIPS_IGEN_FLAGS="-F ${sim_mips_igen_filter} ${sim_mips_igen_machine}"
+SIM_MIPS_M16_FLAGS="-F ${sim_mips_m16_filter} ${sim_mips_m16_machine}"
+SIM_MIPS_MICROMIPS16_FLAGS="-F ${sim_mips_micromips16_filter} ${sim_mips_micromips16_machine}"
+SIM_MIPS_MICROMIPS_FLAGS="-F ${sim_mips_micromips_filter} ${sim_mips_micromips_machine}"
 AC_SUBST(SIM_MIPS_IGEN_FLAGS)
 AC_SUBST(SIM_MIPS_M16_FLAGS)
 AC_SUBST(SIM_MIPS_MICROMIPS_FLAGS)
-- 
2.39.0


      parent reply	other threads:[~2022-12-25  7:14 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-25  7:14 [PATCH 1/9] sim: cpu: fix SMP msg prefix helper Mike Frysinger
2022-12-25  7:14 ` [PATCH 2/9] sim: mn10300: fix SMP compile Mike Frysinger
2022-12-25  7:14 ` [PATCH 3/9] sim: or1k: fix iterator typo when setting up cpus Mike Frysinger
2022-12-25  7:14 ` [PATCH 4/9] sim: v850: fix SMP compile Mike Frysinger
2022-12-25  7:14 ` [PATCH 5/9] sim: m32r: fix iterator typo when setting up cpus Mike Frysinger
2022-12-25  7:14 ` [PATCH 6/9] sim: msp430: add basic SMP cpu init Mike Frysinger
2022-12-25  7:14 ` [PATCH 7/9] sim: cpu: change default init to handle all cpus Mike Frysinger
2022-12-25  7:14 ` [PATCH 8/9] sim: smp: make option available again Mike Frysinger
2022-12-25  7:14 ` Mike Frysinger [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221225071434.30014-9-vapier@gentoo.org \
    --to=vapier@gentoo.org \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).