[78/83] sim: common: move libcommon.a objects to sources

Message ID 20230103075605.13606-79-vapier@gentoo.org
State Committed
Headers
Series sim: merge subdir makefiles into top-level |

Commit Message

Mike Frysinger Jan. 3, 2023, 7:56 a.m. UTC
  This simplifies the build logic and avoids an Automake bug where the
common_libcommon_a_OBJECTS variable isn't set in the arch libsim.a
DEPENDENCIES for targets that, alphabetically, come before "common".
We aren't affected by that bug with the current code, but as we move
things out of SIM_ALL_RECURSIVE_DEPS and rely on finer dependencies,
we will trip over it.
---
 sim/Makefile.in              | 401 ++++++++++++++++++-----------------
 sim/aarch64/local.mk         |   4 +-
 sim/arm/local.mk             |   4 +-
 sim/avr/local.mk             |   4 +-
 sim/bfin/local.mk            |   4 +-
 sim/bpf/local.mk             |   4 +-
 sim/common/local.mk          |   1 +
 sim/cr16/local.mk            |   4 +-
 sim/cris/local.mk            |   4 +-
 sim/d10v/local.mk            |   4 +-
 sim/erc32/local.mk           |   4 +-
 sim/example-synacor/local.mk |   4 +-
 sim/frv/local.mk             |   4 +-
 sim/ft32/local.mk            |   4 +-
 sim/h8300/local.mk           |   4 +-
 sim/iq2000/local.mk          |   4 +-
 sim/lm32/local.mk            |   4 +-
 sim/m32c/local.mk            |   4 +-
 sim/m32r/local.mk            |   4 +-
 sim/m68hc11/local.mk         |   4 +-
 sim/mcore/local.mk           |   4 +-
 sim/microblaze/local.mk      |   4 +-
 sim/mips/local.mk            |   4 +-
 sim/mn10300/local.mk         |   4 +-
 sim/moxie/local.mk           |   4 +-
 sim/msp430/local.mk          |   4 +-
 sim/or1k/local.mk            |   4 +-
 sim/pru/local.mk             |   4 +-
 sim/riscv/local.mk           |   4 +-
 sim/rl78/local.mk            |   4 +-
 sim/rx/local.mk              |   4 +-
 sim/sh/local.mk              |   4 +-
 sim/v850/local.mk            |   4 +-
 33 files changed, 275 insertions(+), 251 deletions(-)
  

Patch

diff --git a/sim/aarch64/local.mk b/sim/aarch64/local.mk
index 10e814b49f90..ff7c51e43157 100644
--- a/sim/aarch64/local.mk
+++ b/sim/aarch64/local.mk
@@ -16,9 +16,9 @@ 
 ## You should have received a copy of the GNU General Public License
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-%C%_libsim_a_SOURCES =
+%C%_libsim_a_SOURCES = \
+	$(common_libcommon_a_SOURCES)
 %C%_libsim_a_LIBADD = \
-	$(common_libcommon_a_OBJECTS) \
 	$(patsubst %,%D%/%,$(SIM_NEW_COMMON_OBJS)) \
 	$(patsubst %,%D%/dv-%.o,$(SIM_HW_DEVICES)) \
 	%D%/cpustate.o \
diff --git a/sim/arm/local.mk b/sim/arm/local.mk
index c172b5f26824..2e20f8533897 100644
--- a/sim/arm/local.mk
+++ b/sim/arm/local.mk
@@ -18,9 +18,9 @@ 
 
 AM_CPPFLAGS_%C% = -DMODET
 
-%C%_libsim_a_SOURCES =
+%C%_libsim_a_SOURCES = \
+	$(common_libcommon_a_SOURCES)
 %C%_libsim_a_LIBADD = \
-	$(common_libcommon_a_OBJECTS) \
 	%D%/wrapper.o \
 	$(patsubst %,%D%/%,$(SIM_NEW_COMMON_OBJS)) \
 	$(patsubst %,%D%/dv-%.o,$(SIM_HW_DEVICES)) \
diff --git a/sim/avr/local.mk b/sim/avr/local.mk
index 3cae5bf8483b..0647dedd1bd5 100644
--- a/sim/avr/local.mk
+++ b/sim/avr/local.mk
@@ -15,9 +15,9 @@ 
 ## You should have received a copy of the GNU General Public License
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-%C%_libsim_a_SOURCES =
+%C%_libsim_a_SOURCES = \
+	$(common_libcommon_a_SOURCES)
 %C%_libsim_a_LIBADD = \
-	$(common_libcommon_a_OBJECTS) \
 	%D%/interp.o \
 	$(patsubst %,%D%/%,$(SIM_NEW_COMMON_OBJS)) \
 	$(patsubst %,%D%/dv-%.o,$(SIM_HW_DEVICES)) \
diff --git a/sim/bfin/local.mk b/sim/bfin/local.mk
index 17a5047fa240..9291e0641a38 100644
--- a/sim/bfin/local.mk
+++ b/sim/bfin/local.mk
@@ -18,9 +18,9 @@ 
 
 AM_CPPFLAGS_%C% = $(SDL_CFLAGS)
 
-%C%_libsim_a_SOURCES =
+%C%_libsim_a_SOURCES = \
+	$(common_libcommon_a_SOURCES)
 %C%_libsim_a_LIBADD = \
-	$(common_libcommon_a_OBJECTS) \
 	$(patsubst %,%D%/%,$(SIM_NEW_COMMON_OBJS)) \
 	$(patsubst %,%D%/dv-%.o,$(SIM_HW_DEVICES)) \
 	$(patsubst %,%D%/dv-%.o,$(%C%_SIM_EXTRA_HW_DEVICES)) \
diff --git a/sim/bpf/local.mk b/sim/bpf/local.mk
index 5f559c93a02e..4218999c7e72 100644
--- a/sim/bpf/local.mk
+++ b/sim/bpf/local.mk
@@ -23,9 +23,9 @@  AM_CPPFLAGS_%C%_decode_be.o = -DWANT_ISA_EBPFBE
 AM_CPPFLAGS_%C%_sem_le.o = -DWANT_ISA_EBPFLE
 AM_CPPFLAGS_%C%_sem_be.o = -DWANT_ISA_EBPFBE
 
-%C%_libsim_a_SOURCES =
+%C%_libsim_a_SOURCES = \
+	$(common_libcommon_a_SOURCES)
 %C%_libsim_a_LIBADD = \
-	$(common_libcommon_a_OBJECTS) \
 	$(patsubst %,%D%/%,$(SIM_NEW_COMMON_OBJS)) \
 	$(patsubst %,%D%/dv-%.o,$(SIM_HW_DEVICES)) \
 	%D%/modules.o \
diff --git a/sim/common/local.mk b/sim/common/local.mk
index c297668b0be9..18b85cfd9418 100644
--- a/sim/common/local.mk
+++ b/sim/common/local.mk
@@ -30,6 +30,7 @@  SIM_ALL_RECURSIVE_DEPS += \
 
 ## NB: libcommon.a isn't used directly by ports.  We need a target for common
 ## objects to be a part of, and ports use the individual objects directly.
+## We can delete this once ppc/Makefile.in is merged into ppc/local.mk.
 noinst_LIBRARIES += %D%/libcommon.a
 %C%_libcommon_a_SOURCES = \
 	%D%/callback.c \
diff --git a/sim/cr16/local.mk b/sim/cr16/local.mk
index 8d8d27f82e67..19446381c9f5 100644
--- a/sim/cr16/local.mk
+++ b/sim/cr16/local.mk
@@ -16,9 +16,9 @@ 
 ## You should have received a copy of the GNU General Public License
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-%C%_libsim_a_SOURCES =
+%C%_libsim_a_SOURCES = \
+	$(common_libcommon_a_SOURCES)
 %C%_libsim_a_LIBADD = \
-	$(common_libcommon_a_OBJECTS) \
 	$(patsubst %,%D%/%,$(SIM_NEW_COMMON_OBJS)) \
 	$(patsubst %,%D%/dv-%.o,$(SIM_HW_DEVICES)) \
 	%D%/interp.o \
diff --git a/sim/cris/local.mk b/sim/cris/local.mk
index ef78c63062c2..14c8644fe070 100644
--- a/sim/cris/local.mk
+++ b/sim/cris/local.mk
@@ -16,9 +16,9 @@ 
 ## You should have received a copy of the GNU General Public License
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-%C%_libsim_a_SOURCES =
+%C%_libsim_a_SOURCES = \
+	$(common_libcommon_a_SOURCES)
 %C%_libsim_a_LIBADD = \
-	$(common_libcommon_a_OBJECTS) \
 	$(patsubst %,%D%/%,$(SIM_NEW_COMMON_OBJS)) \
 	$(patsubst %,%D%/dv-%.o,$(SIM_HW_DEVICES)) \
 	$(patsubst %,%D%/dv-%.o,$(%C%_SIM_EXTRA_HW_DEVICES)) \
diff --git a/sim/d10v/local.mk b/sim/d10v/local.mk
index 04dd763f57c0..967d4e7e543c 100644
--- a/sim/d10v/local.mk
+++ b/sim/d10v/local.mk
@@ -16,9 +16,9 @@ 
 ## You should have received a copy of the GNU General Public License
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-%C%_libsim_a_SOURCES =
+%C%_libsim_a_SOURCES = \
+	$(common_libcommon_a_SOURCES)
 %C%_libsim_a_LIBADD = \
-	$(common_libcommon_a_OBJECTS) \
 	%D%/interp.o \
 	$(patsubst %,%D%/%,$(SIM_NEW_COMMON_OBJS)) \
 	$(patsubst %,%D%/dv-%.o,$(SIM_HW_DEVICES)) \
diff --git a/sim/erc32/local.mk b/sim/erc32/local.mk
index 2361cf2eafc8..a371fbc542b1 100644
--- a/sim/erc32/local.mk
+++ b/sim/erc32/local.mk
@@ -25,9 +25,9 @@  AM_CPPFLAGS_%C% = $(READLINE_CFLAGS)
 ## behaviour of UART interrupt routines ...
 AM_CPPFLAGS_%C% += -DFAST_UART
 
-%C%_libsim_a_SOURCES =
+%C%_libsim_a_SOURCES = \
+	$(common_libcommon_a_SOURCES)
 %C%_libsim_a_LIBADD = \
-	$(common_libcommon_a_OBJECTS) \
 	%D%/erc32.o \
 	%D%/exec.o \
 	%D%/float.o \
diff --git a/sim/example-synacor/local.mk b/sim/example-synacor/local.mk
index 37999807ba32..f9d43a89feb6 100644
--- a/sim/example-synacor/local.mk
+++ b/sim/example-synacor/local.mk
@@ -16,9 +16,9 @@ 
 ## You should have received a copy of the GNU General Public License
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-%C%_libsim_a_SOURCES =
+%C%_libsim_a_SOURCES = \
+	$(common_libcommon_a_SOURCES)
 %C%_libsim_a_LIBADD = \
-	$(common_libcommon_a_OBJECTS) \
 	$(patsubst %,%D%/%,$(SIM_NEW_COMMON_OBJS)) \
 	$(patsubst %,%D%/dv-%.o,$(SIM_HW_DEVICES)) \
 	%D%/interp.o \
diff --git a/sim/frv/local.mk b/sim/frv/local.mk
index 8c2a61588429..c1a10045a708 100644
--- a/sim/frv/local.mk
+++ b/sim/frv/local.mk
@@ -22,9 +22,9 @@  AM_CPPFLAGS_%C% = $(SIM_FRV_TRAPDUMP_FLAGS)
 AM_CFLAGS_%C%_memory.o = -Wno-error
 AM_CFLAGS_%C%_sem.o = -Wno-error
 
-%C%_libsim_a_SOURCES =
+%C%_libsim_a_SOURCES = \
+	$(common_libcommon_a_SOURCES)
 %C%_libsim_a_LIBADD = \
-	$(common_libcommon_a_OBJECTS) \
 	$(patsubst %,%D%/%,$(SIM_NEW_COMMON_OBJS)) \
 	$(patsubst %,%D%/dv-%.o,$(SIM_HW_DEVICES)) \
 	%D%/modules.o \
diff --git a/sim/ft32/local.mk b/sim/ft32/local.mk
index 36081effabec..c793f87f4aaf 100644
--- a/sim/ft32/local.mk
+++ b/sim/ft32/local.mk
@@ -16,9 +16,9 @@ 
 ## You should have received a copy of the GNU General Public License
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-%C%_libsim_a_SOURCES =
+%C%_libsim_a_SOURCES = \
+	$(common_libcommon_a_SOURCES)
 %C%_libsim_a_LIBADD = \
-	$(common_libcommon_a_OBJECTS) \
 	$(patsubst %,%D%/%,$(SIM_NEW_COMMON_OBJS)) \
 	$(patsubst %,%D%/dv-%.o,$(SIM_HW_DEVICES)) \
 	%D%/interp.o \
diff --git a/sim/h8300/local.mk b/sim/h8300/local.mk
index dca8084763d0..04affc9051bb 100644
--- a/sim/h8300/local.mk
+++ b/sim/h8300/local.mk
@@ -16,9 +16,9 @@ 
 ## You should have received a copy of the GNU General Public License
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-%C%_libsim_a_SOURCES =
+%C%_libsim_a_SOURCES = \
+	$(common_libcommon_a_SOURCES)
 %C%_libsim_a_LIBADD = \
-	$(common_libcommon_a_OBJECTS) \
 	%D%/compile.o \
 	$(patsubst %,%D%/%,$(SIM_NEW_COMMON_OBJS)) \
 	$(patsubst %,%D%/dv-%.o,$(SIM_HW_DEVICES)) \
diff --git a/sim/iq2000/local.mk b/sim/iq2000/local.mk
index 34589dbad885..fa498e485950 100644
--- a/sim/iq2000/local.mk
+++ b/sim/iq2000/local.mk
@@ -16,9 +16,9 @@ 
 ## You should have received a copy of the GNU General Public License
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-%C%_libsim_a_SOURCES =
+%C%_libsim_a_SOURCES = \
+	$(common_libcommon_a_SOURCES)
 %C%_libsim_a_LIBADD = \
-	$(common_libcommon_a_OBJECTS) \
 	$(patsubst %,%D%/%,$(SIM_NEW_COMMON_OBJS)) \
 	$(patsubst %,%D%/dv-%.o,$(SIM_HW_DEVICES)) \
 	%D%/modules.o \
diff --git a/sim/lm32/local.mk b/sim/lm32/local.mk
index 1c286245cca1..4fecaca6a389 100644
--- a/sim/lm32/local.mk
+++ b/sim/lm32/local.mk
@@ -16,9 +16,9 @@ 
 ## You should have received a copy of the GNU General Public License
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-%C%_libsim_a_SOURCES =
+%C%_libsim_a_SOURCES = \
+	$(common_libcommon_a_SOURCES)
 %C%_libsim_a_LIBADD = \
-	$(common_libcommon_a_OBJECTS) \
 	$(patsubst %,%D%/%,$(SIM_NEW_COMMON_OBJS)) \
 	$(patsubst %,%D%/dv-%.o,$(SIM_HW_DEVICES)) \
 	$(patsubst %,%D%/dv-%.o,$(%C%_SIM_EXTRA_HW_DEVICES)) \
diff --git a/sim/m32c/local.mk b/sim/m32c/local.mk
index ad047f17b783..7093e248c7e2 100644
--- a/sim/m32c/local.mk
+++ b/sim/m32c/local.mk
@@ -18,9 +18,9 @@ 
 
 AM_CPPFLAGS_%C% = -DTIMER_A
 
-%C%_libsim_a_SOURCES =
+%C%_libsim_a_SOURCES = \
+	$(common_libcommon_a_SOURCES)
 %C%_libsim_a_LIBADD = \
-	$(common_libcommon_a_OBJECTS) \
 	%D%/gdb-if.o \
 	%D%/int.o \
 	%D%/load.o \
diff --git a/sim/m32r/local.mk b/sim/m32r/local.mk
index 78c8a87a42eb..6a6a6d999128 100644
--- a/sim/m32r/local.mk
+++ b/sim/m32r/local.mk
@@ -30,9 +30,9 @@  AM_CFLAGS_%C%_sem.o = -Wno-error
 AM_CFLAGS_%C%_sim_if.o = -Wno-error
 AM_CFLAGS_%C%_traps.o = -Wno-error
 
-%C%_libsim_a_SOURCES =
+%C%_libsim_a_SOURCES = \
+	$(common_libcommon_a_SOURCES)
 %C%_libsim_a_LIBADD = \
-	$(common_libcommon_a_OBJECTS) \
 	$(patsubst %,%D%/%,$(SIM_NEW_COMMON_OBJS)) \
 	$(patsubst %,%D%/dv-%.o,$(SIM_HW_DEVICES)) \
 	$(patsubst %,%D%/dv-%.o,$(%C%_SIM_EXTRA_HW_DEVICES)) \
diff --git a/sim/m68hc11/local.mk b/sim/m68hc11/local.mk
index 8f881d5b854d..d5faae40ed53 100644
--- a/sim/m68hc11/local.mk
+++ b/sim/m68hc11/local.mk
@@ -27,9 +27,9 @@  AM_CPPFLAGS_%C% = \
 	-DWITH_TARGET_ADDRESS_BITSIZE=32 \
 	-DWITH_TARGET_WORD_MSB=31
 
-%C%_libsim_a_SOURCES =
+%C%_libsim_a_SOURCES = \
+	$(common_libcommon_a_SOURCES)
 %C%_libsim_a_LIBADD = \
-	$(common_libcommon_a_OBJECTS) \
 	%D%/interp.o \
 	%D%/m68hc11int.o \
 	%D%/m68hc12int.o \
diff --git a/sim/mcore/local.mk b/sim/mcore/local.mk
index dff8a684ef44..4c9cb50af911 100644
--- a/sim/mcore/local.mk
+++ b/sim/mcore/local.mk
@@ -16,9 +16,9 @@ 
 ## You should have received a copy of the GNU General Public License
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-%C%_libsim_a_SOURCES =
+%C%_libsim_a_SOURCES = \
+	$(common_libcommon_a_SOURCES)
 %C%_libsim_a_LIBADD = \
-	$(common_libcommon_a_OBJECTS) \
 	%D%/interp.o \
 	$(patsubst %,%D%/%,$(SIM_NEW_COMMON_OBJS)) \
 	$(patsubst %,%D%/dv-%.o,$(SIM_HW_DEVICES)) \
diff --git a/sim/microblaze/local.mk b/sim/microblaze/local.mk
index dff8a684ef44..4c9cb50af911 100644
--- a/sim/microblaze/local.mk
+++ b/sim/microblaze/local.mk
@@ -16,9 +16,9 @@ 
 ## You should have received a copy of the GNU General Public License
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-%C%_libsim_a_SOURCES =
+%C%_libsim_a_SOURCES = \
+	$(common_libcommon_a_SOURCES)
 %C%_libsim_a_LIBADD = \
-	$(common_libcommon_a_OBJECTS) \
 	%D%/interp.o \
 	$(patsubst %,%D%/%,$(SIM_NEW_COMMON_OBJS)) \
 	$(patsubst %,%D%/dv-%.o,$(SIM_HW_DEVICES)) \
diff --git a/sim/mips/local.mk b/sim/mips/local.mk
index e54a0ef6102e..942997240c8e 100644
--- a/sim/mips/local.mk
+++ b/sim/mips/local.mk
@@ -53,9 +53,9 @@  if SIM_MIPS_GEN_MODE_MULTI
 	%D%/itable.o \
 	%D%/multi-run.o
 endif
-%C%_libsim_a_SOURCES =
+%C%_libsim_a_SOURCES = \
+	$(common_libcommon_a_SOURCES)
 %C%_libsim_a_LIBADD = \
-	$(common_libcommon_a_OBJECTS) \
 	%D%/interp.o \
 	$(%C%_GEN_OBJ) \
 	$(patsubst %,%D%/%,$(SIM_NEW_COMMON_OBJS)) \
diff --git a/sim/mn10300/local.mk b/sim/mn10300/local.mk
index 0c5d1bf59be4..2abd093e8343 100644
--- a/sim/mn10300/local.mk
+++ b/sim/mn10300/local.mk
@@ -20,9 +20,9 @@  AM_CPPFLAGS_%C% = \
 	-DPOLL_QUIT_INTERVAL=0x20 \
 	-DWITH_TARGET_WORD_BITSIZE=32 -DWITH_TARGET_WORD_MSB=31
 
-%C%_libsim_a_SOURCES =
+%C%_libsim_a_SOURCES = \
+	$(common_libcommon_a_SOURCES)
 %C%_libsim_a_LIBADD = \
-	$(common_libcommon_a_OBJECTS) \
 	%D%/itable.o \
 	%D%/semantics.o \
 	%D%/idecode.o \
diff --git a/sim/moxie/local.mk b/sim/moxie/local.mk
index 4b7d2984f16e..0e07c8607879 100644
--- a/sim/moxie/local.mk
+++ b/sim/moxie/local.mk
@@ -18,9 +18,9 @@ 
 
 AM_CPPFLAGS_%C% = -DDTB="\"$(dtbdir)/moxie-gdb.dtb\""
 
-%C%_libsim_a_SOURCES =
+%C%_libsim_a_SOURCES = \
+	$(common_libcommon_a_SOURCES)
 %C%_libsim_a_LIBADD = \
-	$(common_libcommon_a_OBJECTS) \
 	$(patsubst %,%D%/%,$(SIM_NEW_COMMON_OBJS)) \
 	$(patsubst %,%D%/dv-%.o,$(SIM_HW_DEVICES)) \
 	%D%/interp.o \
diff --git a/sim/msp430/local.mk b/sim/msp430/local.mk
index bb7afd304705..27169c504075 100644
--- a/sim/msp430/local.mk
+++ b/sim/msp430/local.mk
@@ -16,9 +16,9 @@ 
 ## You should have received a copy of the GNU General Public License
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-%C%_libsim_a_SOURCES =
+%C%_libsim_a_SOURCES = \
+	$(common_libcommon_a_SOURCES)
 %C%_libsim_a_LIBADD = \
-	$(common_libcommon_a_OBJECTS) \
 	$(patsubst %,%D%/%,$(SIM_NEW_COMMON_OBJS)) \
 	$(patsubst %,%D%/dv-%.o,$(SIM_HW_DEVICES)) \
 	%D%/msp430-sim.o \
diff --git a/sim/or1k/local.mk b/sim/or1k/local.mk
index 2a3b129c9fb9..71a34db21d8d 100644
--- a/sim/or1k/local.mk
+++ b/sim/or1k/local.mk
@@ -17,9 +17,9 @@ 
 
 AM_CPPFLAGS_%C% = -DWITH_TARGET_WORD_BITSIZE=32 -DWITH_TARGET_WORD_MSB=31
 
-%C%_libsim_a_SOURCES =
+%C%_libsim_a_SOURCES = \
+	$(common_libcommon_a_SOURCES)
 %C%_libsim_a_LIBADD = \
-	$(common_libcommon_a_OBJECTS) \
 	$(patsubst %,%D%/%,$(SIM_NEW_COMMON_OBJS)) \
 	$(patsubst %,%D%/dv-%.o,$(SIM_HW_DEVICES)) \
 	%D%/modules.o \
diff --git a/sim/pru/local.mk b/sim/pru/local.mk
index 0048199f6d3e..8ffc509c0144 100644
--- a/sim/pru/local.mk
+++ b/sim/pru/local.mk
@@ -16,9 +16,9 @@ 
 ## You should have received a copy of the GNU General Public License
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-%C%_libsim_a_SOURCES =
+%C%_libsim_a_SOURCES = \
+	$(common_libcommon_a_SOURCES)
 %C%_libsim_a_LIBADD = \
-	$(common_libcommon_a_OBJECTS) \
 	$(patsubst %,%D%/%,$(SIM_NEW_COMMON_OBJS)) \
 	$(patsubst %,%D%/dv-%.o,$(SIM_HW_DEVICES)) \
 	%D%/interp.o \
diff --git a/sim/riscv/local.mk b/sim/riscv/local.mk
index a3f232eea5ec..150639315fae 100644
--- a/sim/riscv/local.mk
+++ b/sim/riscv/local.mk
@@ -18,9 +18,9 @@ 
 
 AM_CPPFLAGS_%C% = -DWITH_TARGET_WORD_BITSIZE=$(SIM_RISCV_BITSIZE)
 
-%C%_libsim_a_SOURCES =
+%C%_libsim_a_SOURCES = \
+	$(common_libcommon_a_SOURCES)
 %C%_libsim_a_LIBADD = \
-	$(common_libcommon_a_OBJECTS) \
 	$(patsubst %,%D%/%,$(SIM_NEW_COMMON_OBJS)) \
 	$(patsubst %,%D%/dv-%.o,$(SIM_HW_DEVICES)) \
 	%D%/interp.o \
diff --git a/sim/rl78/local.mk b/sim/rl78/local.mk
index 56161eae25a2..0d39140ac6b8 100644
--- a/sim/rl78/local.mk
+++ b/sim/rl78/local.mk
@@ -16,9 +16,9 @@ 
 ## You should have received a copy of the GNU General Public License
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-%C%_libsim_a_SOURCES =
+%C%_libsim_a_SOURCES = \
+	$(common_libcommon_a_SOURCES)
 %C%_libsim_a_LIBADD = \
-	$(common_libcommon_a_OBJECTS) \
 	%D%/load.o \
 	%D%/mem.o \
 	%D%/cpu.o \
diff --git a/sim/rx/local.mk b/sim/rx/local.mk
index 3b1e199e68b8..2a9387d27b79 100644
--- a/sim/rx/local.mk
+++ b/sim/rx/local.mk
@@ -18,9 +18,9 @@ 
 
 AM_CPPFLAGS_%C% = $(SIM_RX_CYCLE_ACCURATE_FLAGS)
 
-%C%_libsim_a_SOURCES =
+%C%_libsim_a_SOURCES = \
+	$(common_libcommon_a_SOURCES)
 %C%_libsim_a_LIBADD = \
-	$(common_libcommon_a_OBJECTS) \
 	%D%/fpu.o \
 	%D%/load.o \
 	%D%/mem.o \
diff --git a/sim/sh/local.mk b/sim/sh/local.mk
index 558a747d2661..b197fa4c7c37 100644
--- a/sim/sh/local.mk
+++ b/sim/sh/local.mk
@@ -16,9 +16,9 @@ 
 ## You should have received a copy of the GNU General Public License
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-%C%_libsim_a_SOURCES =
+%C%_libsim_a_SOURCES = \
+	$(common_libcommon_a_SOURCES)
 %C%_libsim_a_LIBADD = \
-	$(common_libcommon_a_OBJECTS) \
 	%D%/interp.o \
 	$(patsubst %,%D%/%,$(SIM_NEW_COMMON_OBJS)) \
 	$(patsubst %,%D%/dv-%.o,$(SIM_HW_DEVICES)) \
diff --git a/sim/v850/local.mk b/sim/v850/local.mk
index 62d3e82ff76a..68f61f89505c 100644
--- a/sim/v850/local.mk
+++ b/sim/v850/local.mk
@@ -18,9 +18,9 @@ 
 
 AM_CPPFLAGS_%C% = -DWITH_TARGET_WORD_BITSIZE=32 -DWITH_TARGET_WORD_MSB=31
 
-%C%_libsim_a_SOURCES =
+%C%_libsim_a_SOURCES = \
+	$(common_libcommon_a_SOURCES)
 %C%_libsim_a_LIBADD = \
-	$(common_libcommon_a_OBJECTS) \
 	$(patsubst %,%D%/%,$(SIM_NEW_COMMON_OBJS)) \
 	$(patsubst %,%D%/dv-%.o,$(SIM_HW_DEVICES)) \
 	%D%/simops.o \