From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.gentoo.org (mail.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) by sourceware.org (Postfix) with ESMTP id 8FA3A385840D for ; Wed, 3 Nov 2021 03:37:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 8FA3A385840D Received: by smtp.gentoo.org (Postfix, from userid 559) id 195D1342F65; Wed, 3 Nov 2021 03:37:47 +0000 (UTC) From: Mike Frysinger To: gdb-patches@sourceware.org Subject: [PATCH 2/3] sim: hoist mn10300 & v850 igen rules up to common builds Date: Tue, 2 Nov 2021 23:37:39 -0400 Message-Id: <20211103033740.6025-2-vapier@gentoo.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211103033740.6025-1-vapier@gentoo.org> References: <20211103033740.6025-1-vapier@gentoo.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-11.4 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, KAM_SHORT, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Nov 2021 03:37:50 -0000 These rules don't depend on the target compiler settings, so hoist the build logic up to the common builds for better parallelization. We leave the mips rules in place as they depend on complicated arch-specific configure logic that needs to be untangled first. --- sim/Makefile.am | 6 ++ sim/Makefile.in | 207 +++++++++++++++++++++++++++++++++++++--- sim/igen/local.mk | 11 ++- sim/mn10300/Makefile.in | 71 -------------- sim/mn10300/local.mk | 90 +++++++++++++++++ sim/v850/Makefile.in | 67 ------------- sim/v850/local.mk | 87 +++++++++++++++++ 7 files changed, 386 insertions(+), 153 deletions(-) create mode 100644 sim/mn10300/local.mk create mode 100644 sim/v850/local.mk diff --git a/sim/Makefile.am b/sim/Makefile.am index 6fa3b62de224..c04f94817e4f 100644 --- a/sim/Makefile.am +++ b/sim/Makefile.am @@ -79,8 +79,14 @@ endif if SIM_ENABLE_ARCH_m68hc11 include m68hc11/local.mk endif +if SIM_ENABLE_ARCH_mn10300 +include mn10300/local.mk +endif if SIM_ENABLE_ARCH_sh include sh/local.mk endif +if SIM_ENABLE_ARCH_v850 +include v850/local.mk +endif all-recursive: $(SIM_ALL_RECURSIVE_DEPS) diff --git a/sim/igen/local.mk b/sim/igen/local.mk index a7e278661b7b..3e3219cdfa91 100644 --- a/sim/igen/local.mk +++ b/sim/igen/local.mk @@ -19,12 +19,17 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . +# 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) + # This makes sure igen is available before building the arch-subdirs which # need to run the igen tool. -SIM_ALL_RECURSIVE_DEPS += igen/igen$(EXEEXT) +SIM_ALL_RECURSIVE_DEPS += $(IGEN) # Alias for developers. -igen: %D%/igen$(EXEEXT) +igen: $(IGEN) noinst_LIBRARIES += %D%/libigen.a %C%_libigen_a_SOURCES = \ @@ -84,7 +89,7 @@ igen/libigen.a: $(igen_libigen_a_OBJECTS) $(igen_libigen_a_DEPENDENCIES) $(EXTRA %C%_table_LDADD = %D%/table-main.o %D%/libigen.a %C%_IGEN_TOOLS = \ - %D%/igen \ + $(IGEN) \ %D%/filter \ %D%/gen \ %D%/ld-cache \ diff --git a/sim/mn10300/Makefile.in b/sim/mn10300/Makefile.in index a68dd43f1a69..e9df3ef46407 100644 --- a/sim/mn10300/Makefile.in +++ b/sim/mn10300/Makefile.in @@ -27,7 +27,6 @@ SIM_OBJS = $(MN10300_OBJS) interp.o SIM_EXTRA_HW_DEVICES = mn103cpu mn103int mn103tim mn103ser mn103iop -SIM_EXTRA_CLEAN = clean-igen # Extra dependencies for "sim-main.h" SIM_EXTRA_DEPS = mn10300_sim.h itable.h idecode.h @@ -35,73 +34,3 @@ SIM_EXTRA_DEPS = mn10300_sim.h itable.h idecode.h SIM_EXTRA_CFLAGS = -DPOLL_QUIT_INTERVAL=0x20 ## COMMON_POST_CONFIG_FRAG - -BUILT_SRC_FROM_IGEN = \ - icache.h \ - icache.c \ - idecode.h \ - idecode.c \ - semantics.h \ - semantics.c \ - model.h \ - model.c \ - support.h \ - support.c \ - itable.h \ - itable.c \ - engine.h \ - engine.c \ - irun.c -$(BUILT_SRC_FROM_IGEN): tmp-igen - - -.PHONY: clean-igen -clean-igen: - rm -f $(BUILT_SRC_FROM_IGEN) - rm -f tmp-igen tmp-insns - -IGEN_TRACE= # -G omit-line-numbers # -G trace-rule-selection -G trace-rule-rejection -G trace-entries -IGEN_INSN=$(srcdir)/mn10300.igen -IGEN_INSN_INC=$(srcdir)/am33.igen $(srcdir)/am33-2.igen -IGEN_DC=$(srcdir)/mn10300.dc -tmp-igen: $(IGEN_INSN) $(IGEN_INSN_INC) $(IGEN_DC) $(IGEN) - $(ECHO_IGEN) $(IGEN_RUN) \ - $(IGEN_TRACE) \ - -G gen-direct-access \ - -M mn10300,am33 -G gen-multi-sim=am33 \ - -M am33_2 \ - -I $(srcdir) \ - -i $(IGEN_INSN) \ - -o $(IGEN_DC) \ - -x \ - -n icache.h -hc tmp-icache.h \ - -n icache.c -c tmp-icache.c \ - -n semantics.h -hs tmp-semantics.h \ - -n semantics.c -s tmp-semantics.c \ - -n idecode.h -hd tmp-idecode.h \ - -n idecode.c -d tmp-idecode.c \ - -n model.h -hm tmp-model.h \ - -n model.c -m tmp-model.c \ - -n support.h -hf tmp-support.h \ - -n support.c -f tmp-support.c \ - -n itable.h -ht tmp-itable.h \ - -n itable.c -t tmp-itable.c \ - -n engine.h -he tmp-engine.h \ - -n engine.c -e tmp-engine.c \ - -n irun.c -r tmp-irun.c - $(SILENCE) $(SHELL) $(srcroot)/move-if-change tmp-icache.h icache.h - $(SILENCE) $(SHELL) $(srcroot)/move-if-change tmp-icache.c icache.c - $(SILENCE) $(SHELL) $(srcroot)/move-if-change tmp-idecode.h idecode.h - $(SILENCE) $(SHELL) $(srcroot)/move-if-change tmp-idecode.c idecode.c - $(SILENCE) $(SHELL) $(srcroot)/move-if-change tmp-semantics.h semantics.h - $(SILENCE) $(SHELL) $(srcroot)/move-if-change tmp-semantics.c semantics.c - $(SILENCE) $(SHELL) $(srcroot)/move-if-change tmp-model.h model.h - $(SILENCE) $(SHELL) $(srcroot)/move-if-change tmp-model.c model.c - $(SILENCE) $(SHELL) $(srcroot)/move-if-change tmp-support.h support.h - $(SILENCE) $(SHELL) $(srcroot)/move-if-change tmp-support.c support.c - $(SILENCE) $(SHELL) $(srcroot)/move-if-change tmp-itable.h itable.h - $(SILENCE) $(SHELL) $(srcroot)/move-if-change tmp-itable.c itable.c - $(SILENCE) $(SHELL) $(srcroot)/move-if-change tmp-engine.h engine.h - $(SILENCE) $(SHELL) $(srcroot)/move-if-change tmp-engine.c engine.c - $(SILENCE) $(SHELL) $(srcroot)/move-if-change tmp-irun.c irun.c - $(SILENCE) touch $@ diff --git a/sim/mn10300/local.mk b/sim/mn10300/local.mk new file mode 100644 index 000000000000..6c70ffe27b11 --- /dev/null +++ b/sim/mn10300/local.mk @@ -0,0 +1,90 @@ +# See sim/Makefile.am +# +# Copyright (C) 1996-2021 Free Software Foundation, Inc. +# Written by Cygnus Support. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +%C%_BUILT_SRC_FROM_IGEN = \ + %D%/icache.h \ + %D%/icache.c \ + %D%/idecode.h \ + %D%/idecode.c \ + %D%/semantics.h \ + %D%/semantics.c \ + %D%/model.h \ + %D%/model.c \ + %D%/support.h \ + %D%/support.c \ + %D%/itable.h \ + %D%/itable.c \ + %D%/engine.h \ + %D%/engine.c \ + %D%/irun.c +%C%_BUILD_OUTPUTS = \ + $(%C%_BUILT_SRC_FROM_IGEN) \ + %D%/stamp-igen + +# This makes sure build tools are available before building the arch-subdirs. +SIM_ALL_RECURSIVE_DEPS += $(%C%_BUILD_OUTPUTS) + +$(%C%_BUILT_SRC_FROM_IGEN): %D%/stamp-igen + +%C%_IGEN_TRACE = # -G omit-line-numbers # -G trace-rule-selection -G trace-rule-rejection -G trace-entries +%C%_IGEN_INSN = $(srcdir)/%D%/mn10300.igen +%C%_IGEN_INSN_INC = %D%/am33.igen %D%/am33-2.igen +%C%_IGEN_DC = $(srcdir)/%D%/mn10300.dc +%D%/stamp-igen: $(%C%_IGEN_INSN) $(%C%_IGEN_INSN_INC) $(%C%_IGEN_DC) $(IGEN) + $(AM_V_GEN)$(IGEN_RUN) \ + $(%C%_IGEN_TRACE) \ + -G gen-direct-access \ + -M mn10300,am33 -G gen-multi-sim=am33 \ + -M am33_2 \ + -I $(srcdir)/%D% \ + -i $(%C%_IGEN_INSN) \ + -o $(%C%_IGEN_DC) \ + -x \ + -n icache.h -hc %D%/tmp-icache.h \ + -n icache.c -c %D%/tmp-icache.c \ + -n semantics.h -hs %D%/tmp-semantics.h \ + -n semantics.c -s %D%/tmp-semantics.c \ + -n idecode.h -hd %D%/tmp-idecode.h \ + -n idecode.c -d %D%/tmp-idecode.c \ + -n model.h -hm %D%/tmp-model.h \ + -n model.c -m %D%/tmp-model.c \ + -n support.h -hf %D%/tmp-support.h \ + -n support.c -f %D%/tmp-support.c \ + -n itable.h -ht %D%/tmp-itable.h \ + -n itable.c -t %D%/tmp-itable.c \ + -n engine.h -he %D%/tmp-engine.h \ + -n engine.c -e %D%/tmp-engine.c \ + -n irun.c -r %D%/tmp-irun.c + $(AM_V_at)$(SHELL) $(srcroot)/move-if-change %D%/tmp-icache.h %D%/icache.h + $(AM_V_at)$(SHELL) $(srcroot)/move-if-change %D%/tmp-icache.c %D%/icache.c + $(AM_V_at)$(SHELL) $(srcroot)/move-if-change %D%/tmp-idecode.h %D%/idecode.h + $(AM_V_at)$(SHELL) $(srcroot)/move-if-change %D%/tmp-idecode.c %D%/idecode.c + $(AM_V_at)$(SHELL) $(srcroot)/move-if-change %D%/tmp-semantics.h %D%/semantics.h + $(AM_V_at)$(SHELL) $(srcroot)/move-if-change %D%/tmp-semantics.c %D%/semantics.c + $(AM_V_at)$(SHELL) $(srcroot)/move-if-change %D%/tmp-model.h %D%/model.h + $(AM_V_at)$(SHELL) $(srcroot)/move-if-change %D%/tmp-model.c %D%/model.c + $(AM_V_at)$(SHELL) $(srcroot)/move-if-change %D%/tmp-support.h %D%/support.h + $(AM_V_at)$(SHELL) $(srcroot)/move-if-change %D%/tmp-support.c %D%/support.c + $(AM_V_at)$(SHELL) $(srcroot)/move-if-change %D%/tmp-itable.h %D%/itable.h + $(AM_V_at)$(SHELL) $(srcroot)/move-if-change %D%/tmp-itable.c %D%/itable.c + $(AM_V_at)$(SHELL) $(srcroot)/move-if-change %D%/tmp-engine.h %D%/engine.h + $(AM_V_at)$(SHELL) $(srcroot)/move-if-change %D%/tmp-engine.c %D%/engine.c + $(AM_V_at)$(SHELL) $(srcroot)/move-if-change %D%/tmp-irun.c %D%/irun.c + $(AM_V_at)touch $@ + +MOSTLYCLEANFILES += $(%C%_BUILD_OUTPUTS) diff --git a/sim/v850/Makefile.in b/sim/v850/Makefile.in index 072c75027885..07014b8afb8c 100644 --- a/sim/v850/Makefile.in +++ b/sim/v850/Makefile.in @@ -34,70 +34,3 @@ SIM_EXTRA_CFLAGS = \ NL_TARGET = -DNL_TARGET_v850 ## COMMON_POST_CONFIG_FRAG - -BUILT_SRC_FROM_IGEN = \ - icache.h \ - icache.c \ - idecode.h \ - idecode.c \ - semantics.h \ - semantics.c \ - model.h \ - model.c \ - support.h \ - support.c \ - itable.h \ - itable.c \ - engine.h \ - engine.c \ - irun.c -$(BUILT_SRC_FROM_IGEN): tmp-igen -# - -.PHONY: clean-igen -clean-igen: - rm -f $(BUILT_SRC_FROM_IGEN) - rm -f tmp-igen tmp-insns - -IGEN_TRACE= # -G omit-line-numbers # -G trace-rule-selection -G trace-rule-rejection -G trace-entries -IGEN_INSN=$(srcdir)/v850.igen -IGEN_DC=$(srcdir)/v850-dc -tmp-igen: $(IGEN_INSN) $(IGEN_DC) $(IGEN) - $(ECHO_IGEN) $(IGEN_RUN) \ - $(IGEN_TRACE) \ - -G gen-direct-access \ - -G gen-zero-r0 \ - -i $(IGEN_INSN) \ - -o $(IGEN_DC) \ - -x \ - -n icache.h -hc tmp-icache.h \ - -n icache.c -c tmp-icache.c \ - -n semantics.h -hs tmp-semantics.h \ - -n semantics.c -s tmp-semantics.c \ - -n idecode.h -hd tmp-idecode.h \ - -n idecode.c -d tmp-idecode.c \ - -n model.h -hm tmp-model.h \ - -n model.c -m tmp-model.c \ - -n support.h -hf tmp-support.h \ - -n support.c -f tmp-support.c \ - -n itable.h -ht tmp-itable.h \ - -n itable.c -t tmp-itable.c \ - -n engine.h -he tmp-engine.h \ - -n engine.c -e tmp-engine.c \ - -n irun.c -r tmp-irun.c - $(SILENCE) $(SHELL) $(srcroot)/move-if-change tmp-icache.h icache.h - $(SILENCE) $(SHELL) $(srcroot)/move-if-change tmp-icache.c icache.c - $(SILENCE) $(SHELL) $(srcroot)/move-if-change tmp-idecode.h idecode.h - $(SILENCE) $(SHELL) $(srcroot)/move-if-change tmp-idecode.c idecode.c - $(SILENCE) $(SHELL) $(srcroot)/move-if-change tmp-semantics.h semantics.h - $(SILENCE) $(SHELL) $(srcroot)/move-if-change tmp-semantics.c semantics.c - $(SILENCE) $(SHELL) $(srcroot)/move-if-change tmp-model.h model.h - $(SILENCE) $(SHELL) $(srcroot)/move-if-change tmp-model.c model.c - $(SILENCE) $(SHELL) $(srcroot)/move-if-change tmp-support.h support.h - $(SILENCE) $(SHELL) $(srcroot)/move-if-change tmp-support.c support.c - $(SILENCE) $(SHELL) $(srcroot)/move-if-change tmp-itable.h itable.h - $(SILENCE) $(SHELL) $(srcroot)/move-if-change tmp-itable.c itable.c - $(SILENCE) $(SHELL) $(srcroot)/move-if-change tmp-engine.h engine.h - $(SILENCE) $(SHELL) $(srcroot)/move-if-change tmp-engine.c engine.c - $(SILENCE) $(SHELL) $(srcroot)/move-if-change tmp-irun.c irun.c - $(SILENCE) touch $@ diff --git a/sim/v850/local.mk b/sim/v850/local.mk new file mode 100644 index 000000000000..17adeabbf2fc --- /dev/null +++ b/sim/v850/local.mk @@ -0,0 +1,87 @@ +# See sim/Makefile.am +# +# Copyright (C) 1996-2021 Free Software Foundation, Inc. +# Written by Cygnus Support. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +%C%_BUILT_SRC_FROM_IGEN = \ + %D%/icache.h \ + %D%/icache.c \ + %D%/idecode.h \ + %D%/idecode.c \ + %D%/semantics.h \ + %D%/semantics.c \ + %D%/model.h \ + %D%/model.c \ + %D%/support.h \ + %D%/support.c \ + %D%/itable.h \ + %D%/itable.c \ + %D%/engine.h \ + %D%/engine.c \ + %D%/irun.c +%C%_BUILD_OUTPUTS = \ + $(%C%_BUILT_SRC_FROM_IGEN) \ + %D%/stamp-igen + +# This makes sure build tools are available before building the arch-subdirs. +SIM_ALL_RECURSIVE_DEPS += $(%C%_BUILD_OUTPUTS) + +$(%C%_BUILT_SRC_FROM_IGEN): %D%/stamp-igen + +%C%_IGEN_TRACE = # -G omit-line-numbers # -G trace-rule-selection -G trace-rule-rejection -G trace-entries +%C%_IGEN_INSN = $(srcdir)/%D%/v850.igen +%C%_IGEN_DC = $(srcdir)/%D%/v850-dc +%D%/stamp-igen: $(%C%_IGEN_INSN) $(%C%_IGEN_DC) $(IGEN) + $(AM_V_GEN)$(IGEN_RUN) \ + $(%C%_IGEN_TRACE) \ + -G gen-direct-access \ + -G gen-zero-r0 \ + -i $(%C%_IGEN_INSN) \ + -o $(%C%_IGEN_DC) \ + -x \ + -n icache.h -hc %D%/tmp-icache.h \ + -n icache.c -c %D%/tmp-icache.c \ + -n semantics.h -hs %D%/tmp-semantics.h \ + -n semantics.c -s %D%/tmp-semantics.c \ + -n idecode.h -hd %D%/tmp-idecode.h \ + -n idecode.c -d %D%/tmp-idecode.c \ + -n model.h -hm %D%/tmp-model.h \ + -n model.c -m %D%/tmp-model.c \ + -n support.h -hf %D%/tmp-support.h \ + -n support.c -f %D%/tmp-support.c \ + -n itable.h -ht %D%/tmp-itable.h \ + -n itable.c -t %D%/tmp-itable.c \ + -n engine.h -he %D%/tmp-engine.h \ + -n engine.c -e %D%/tmp-engine.c \ + -n irun.c -r %D%/tmp-irun.c + $(AM_V_at)$(SHELL) $(srcroot)/move-if-change %D%/tmp-icache.h %D%/icache.h + $(AM_V_at)$(SHELL) $(srcroot)/move-if-change %D%/tmp-icache.c %D%/icache.c + $(AM_V_at)$(SHELL) $(srcroot)/move-if-change %D%/tmp-idecode.h %D%/idecode.h + $(AM_V_at)$(SHELL) $(srcroot)/move-if-change %D%/tmp-idecode.c %D%/idecode.c + $(AM_V_at)$(SHELL) $(srcroot)/move-if-change %D%/tmp-semantics.h %D%/semantics.h + $(AM_V_at)$(SHELL) $(srcroot)/move-if-change %D%/tmp-semantics.c %D%/semantics.c + $(AM_V_at)$(SHELL) $(srcroot)/move-if-change %D%/tmp-model.h %D%/model.h + $(AM_V_at)$(SHELL) $(srcroot)/move-if-change %D%/tmp-model.c %D%/model.c + $(AM_V_at)$(SHELL) $(srcroot)/move-if-change %D%/tmp-support.h %D%/support.h + $(AM_V_at)$(SHELL) $(srcroot)/move-if-change %D%/tmp-support.c %D%/support.c + $(AM_V_at)$(SHELL) $(srcroot)/move-if-change %D%/tmp-itable.h %D%/itable.h + $(AM_V_at)$(SHELL) $(srcroot)/move-if-change %D%/tmp-itable.c %D%/itable.c + $(AM_V_at)$(SHELL) $(srcroot)/move-if-change %D%/tmp-engine.h %D%/engine.h + $(AM_V_at)$(SHELL) $(srcroot)/move-if-change %D%/tmp-engine.c %D%/engine.c + $(AM_V_at)$(SHELL) $(srcroot)/move-if-change %D%/tmp-irun.c %D%/irun.c + $(AM_V_at)touch $@ + +MOSTLYCLEANFILES += $(%C%_BUILD_OUTPUTS) -- 2.33.0