Re: [PATCH] sim: testsuite: push $arch out to targets

Mike Frysinger via Gdb-patches
2021-01-21T00:37:54Z

On 20 Jan 2021 12:53, Tom Tromey wrote:
> Mike> as we do multibuilds, we'll have multiple ports active, so a single
> Mike> variable won't cut it. moving it here and out of autotols enables
> Mike> that. as we do multitarget, this will help smooth the transition as
> Mike> we won't have to juggle each arch as it migrates.
>
> I'm curious to hear about the plan here, specifically if you plan to
> tackle the "gdb can only include one sim" problem.

i've been slowly reworking the sim core to flip it from "the port owns the
central data structure" to "the core owns everything, and ports are just
given a pointer to their data structure". that would allow for the core to
pick the backend instead of the backend picking the core.

there's other settings that make this difficult in the sim as it binds a
lot of configure-time settings into the build (like register & addresss
sizes & endianness). so i'd expect at first we'd be able to do compatible
ports in a single build (e.g. all 32bit little endian). where to go from
there will require experimentation. i'm thinking the core compiles all
variants (32/64 le/be) and then the ports use defines to pick the right
ones for their subdir.

part of this work has been removing the ability for ports to deviate at
all: just make a single decision in the core, and everyone uses that.
we've given ports way too much leeway for too long.

at the very least, i have it working now where each subdir can be built
and installed in a single build. this is helpful for doing quick tests
that changes at least compile. obviously can't link a single gdb from
this, but gotta start somewhere. i'm trying to do this incrementally
rather than flip a switch and have everyone migrate in a single commit.
especially because not all ports support even the common/ code atm.

sim $ ls
aarch64 config.cache d10v h8300 m32r mips ppc testsuite
arm config.log erc32 igen m68hc11 mn10300 pru v850
avr config.status foo iq2000 Makefile moxie rl78
bfin cr16 frv lm32 mcore msp430 rx
bpf cris ft32 m32c microblaze or1k sh
sim $ ls */run */libsim.a
aarch64/libsim.a d10v/run m32r/libsim.a msp430/run
aarch64/run erc32/libsim.a m32r/run or1k/libsim.a
arm/libsim.a erc32/run m68hc11/libsim.a or1k/run
arm/run frv/libsim.a m68hc11/run ppc/libsim.a
avr/libsim.a frv/run mcore/libsim.a ppc/run
avr/run ft32/libsim.a mcore/run pru/libsim.a
bfin/libsim.a ft32/run microblaze/libsim.a pru/run
bfin/run h8300/libsim.a microblaze/run rl78/libsim.a
bpf/libsim.a h8300/run mips/libsim.a rl78/run
bpf/run iq2000/libsim.a mips/run rx/libsim.a
cr16/libsim.a iq2000/run mn10300/libsim.a rx/run
cr16/run lm32/libsim.a mn10300/run sh/libsim.a
cris/libsim.a lm32/run moxie/libsim.a sh/run
cris/run m32c/libsim.a moxie/run v850/libsim.a
d10v/libsim.a m32c/run msp430/libsim.a v850/run
-mike