aboutsummaryrefslogtreecommitdiff
path: root/sim
AgeCommit message (Collapse)AuthorFilesLines
2022-01-06sim: m68hc11: migrate to standard uintXX_t typesMike Frysinger13-273/+265
This old port setup its own uintXX types, but since we require C11 now, we can assume the standard uintXX_t types exist and use them. Also migrate off the sim-specific unsignedXX types.
2022-01-06sim: d10v: migrate to standard uintXX_t typesMike Frysinger4-273/+265
This old port setup its own uintXX types, but since we require C11 now, we can assume the standard uintXX_t types exist and use them. Also migrate off the sim-specific unsignedXX types.
2022-01-06sim: cr16: migrate to standard uintXX_t typesMike Frysinger3-630/+621
This old port setup its own uintXX types, but since we require C11 now, we can assume the standard uintXX_t types exist and use them. Also migrate off the sim-specific unsignedXX types.
2022-01-01sim: ppc: drop natural typesMike Frysinger4-31/+10
These are almost entirely unused. For the very few places using them, replace with explicit signed types. This matches what was done in the common sim code.
2022-01-01sim: mips: clean up bad style/whitespaceMike Frysinger23-345/+345
This doesn't fix all the problems, but grabs a bunch of the more obvious ones.
2022-01-01sim: tweak copyright lines for gnulib update-copyrightMike Frysinger23-23/+23
The regex it uses does not like so many leading spaces which causes it to think the files lack copyright. Trim them down so the script can find & update them accordingly.
2022-01-01Automatic Copyright Year update after running gdb/copyright.pyJoel Brobecker670-670/+670
This commit brings all the changes made by running gdb/copyright.py as per GDB's Start of New Year Procedure. For the avoidance of doubt, all changes in this commits were performed by the script.
2021-12-16sim: mips/or1k: drop redundant arg to bitsize macroMike Frysinger4-6/+4
These are just using the default behavior for the 3rd arg, so drop it to make it more clear. This also makes them match all other ports that only use the first 2 arguments.
2021-12-16sim: fix mingw builds with replacement gnulib openMike Frysinger1-2/+2
The header shuffling in here broke the workaround for gnulib defining "open". Move it back before the sim-specific includes to fix. This is because the callback struct in the headers has an "open" member and this file tries to call that.
2021-12-09sim: use ## for automake commentsMike Frysinger25-882/+419
The ## marker tells automake to not include the comment in its generated output, so use that in most places where the comment only makes sense in the inputs.
2021-12-04sim: include ansidecl.h when neededMike Frysinger16-1/+26
Avoid implicit include deps with this to help untangle sim headers so we can get rid of arch-specific sim-main.h.
2021-12-04sim: include stdint.h when neededMike Frysinger3-0/+3
Avoid implicit include deps with this to help untangle sim headers so we can get rid of arch-specific sim-main.h.
2021-12-04sim: include stdarg.h when usedMike Frysinger20-0/+22
Avoid implicit include deps with this to help untangle sim headers so we can get rid of arch-specific sim-main.h.
2021-12-04sim: reorder header includesMike Frysinger44-162/+173
We're including system headers after local headers in a bunch of places, but this leads to conflicts when our local headers happen to define symbols that show up in the system headers. Use the more standard order of: * config.h (via defs.h) * system headers * local library headers (e.g. bfd & libiberty) * sim specific headers
2021-12-04sim: moxie: hoist dtb rules up to common buildsMike Frysinger4-49/+116
These rules don't depend on the target compiler settings, so hoist the build logic up to the common builds for better parallelization.
2021-12-04sim: m68hc11: delete unused profile flagsMike Frysinger1-1/+0
These were moved to the common configure script a while ago and have the same default as these, so just delete it.
2021-12-04sim: msp430: delete redundant comments & settingsMike Frysinger1-22/+0
These were copied from the example docs, so aren't adding any value.
2021-12-04sim: erc32: drop old configure targetMike Frysinger1-8/+0
There is no configure script in here anymore to regenerate.
2021-12-04sim: m32c/rl78: drop redundant -Wall settingsMike Frysinger2-3/+1
We already turn these on in the configure script.
2021-12-04sim: frv: split up testsuite a bitMike Frysinger9-19/+136
Running frv's allinsn in serial is quite slow due to the sheer number of tests it contains. By splitting it up and running in parallel, the execution time on my system goes from ~100sec to ~60sec.
2021-11-28sim: testsuite: drop most specific istarget checksMike Frysinger42-47/+42
We'll rely on the toolchain probing to determine whether each arch's tests can be run rather the current configure target. This allows testing all of the ports in a multitarget configuration. For now, we don't reformat the files entirely to make it easier to review, and in case we need to make adjustments. Once this feels like it's stable, we can flatten the code a bit by removing the if statement entirely.
2021-11-28sim: testsuite: support parallel executionMike Frysinger2-10/+80
Break up the dejagnu logic so that we can parallelize the testsuite. This takes a page from gcc & gdb where each .exp is run in isolation instead of in serial. For most targets, this doesn't make much of a difference as they only have a single .exp. A few (like cris & frv) have multiple .exp though and will see a bit of a speed up. The real gain is when testing a multitarget build. This way we can run all the targets in parallel and cut the execution time a bit. On my system, it goes from ~155sec to ~100sec. We can gain further speedups by splitting up some of the larger .exp files into smaller groups. We'll do that in a followup though.
2021-11-28sim: testsuite: expand arch specific toolchain settingsMike Frysinger3-7/+63
Leverage the new per-port toolchain settings to initialize the env for eeach set of tests. This allows us to run all the tests in a multitarget build if the user sets up the vars. If they don't, we can still skip all the tests.
2021-11-28sim: testsuite: setup per-port toolchain settings for multitarget buildMike Frysinger5-3/+895
Gas does not support multitarget builds -- it still only supports a single input & output format. ld is a bit better, but requires manual flags to select the right output. This makes it impossible to run the complete testsuite in a multitarget build. To address this limitation, create a suite of FOR_TARGET variables so these can be set to precompiled as & ld programs. It requires a bit of setup ahead of time, but it's a one-time cost, and makes running the full testsuite at once much easier.
2021-11-28sim: add checks to core headers to prevent incorrect common buildingMike Frysinger3-2/+8
Some of the core sim headers rely on the SIM_AC_OPTION_BITSIZE macro which can change the size of core types. Since these haven't been unified across ports, add checks to make sure they aren't accidentally included when building for all ports. This caught the sim-load file using poisoned headers that it didn't actually need.
2021-11-28sim: unify syscall.o buildingMike Frysinger3-1/+22
Now that we've unified all the syscall tables, this file does not rely on any port-specific settings, so move it up to building as part of the common step so we only do it once in a multibuild.
2021-11-28sim: drop unused gentmap & nltvals.def logicMike Frysinger6-422/+31
Now that all ports have switched to target-newlib-* files, there's no need for these files & generating things at build time. So punt the logic and make target-newlib-syscall a hard requirement.
2021-11-28sim: mcore: switch to new target-newlib-syscallMike Frysinger2-3/+5
Use the new target-newlib-syscall module. This is needed to merge all the architectures into a single build, and mcore has a custom syscall table for its newlib/libgloss port.
2021-11-28sim: riscv: switch to new target-newlib-syscallMike Frysinger2-3/+2
Use the new target-newlib-syscall module. This is needed to merge all the architectures into a single build, and riscv has a custom syscall table for its newlib/libgloss port.
2021-11-28sim: cr16: switch to new target-newlib-syscallMike Frysinger3-51/+28
Use the new target-newlib-syscall module. This is needed to merge all the architectures into a single build, and cr16 has a custom syscall table for its newlib/libgloss port. This allows cleaning up the syscall ifdef logic. We know these will always exist now.
2021-11-28sim: d10v: switch to new target-newlib-syscallMike Frysinger3-36/+26
Use the new target-newlib-syscall module. This is needed to merge all the architectures into a single build, and d10v has a custom syscall table for its newlib/libgloss port. This allows cleaning up the syscall ifdef logic. We know these will always exist now.
2021-11-28sim: sh: switch to new target-newlib-syscallMike Frysinger2-25/+23
Use the new target-newlib-syscall module. This is needed to merge all the architectures into a single build, and sh has a custom syscall table for its newlib/libgloss port.
2021-11-28sim: v850: switch to new target-newlib-syscallMike Frysinger3-67/+26
Use the new target-newlib-syscall module. This is needed to merge all the architectures into a single build, and v850 has a custom syscall table for its newlib/libgloss port. This allows cleaning up the syscall ifdef logic. We know these will always exist now.
2021-11-28sim: iq2000/lm32/m32c/moxie/rx: switch to new target-newlib-syscall.hMike Frysinger5-35/+35
Use the new target-newlib-syscall.h to provide the target syscall defines. These code paths are written specifically for the newlib ABI rather than being generalized, so switching them to the defines rather than trying to go through the dynamic callback conversion seems like the best trade-off for now. Might have to reconsider this in the future.
2021-11-28sim: nltvals: pull target syscalls out into a dedicated source fileMike Frysinger9-65/+987
Like we just did for pulling out the errno map, pull out the syscall maps into a dedicated common file. Most newlib ports are using the same syscall map, but not all, which means we have to do a bit more work to migrate. This commit adds the maps and switches the ports using the common default syscall table over to it. Ports using unique syscall tables are still using the old targ-map.c logic. Switching common ports over is easy by checking NL_TARGET, but the ppc code needs a bit more cleanup here hence its larger diff.
2021-11-28sim: frv: resolve syscalls dynamicallyMike Frysinger1-2/+1
Avoid use of TARGET_<syscall> defines and rely on the callback layers to resolve these dynamically so we can support multiple syscall layers instead of assuming the newlib/libgloss numbers all the time.
2021-11-28sim: mn10300: resolve syscalls dynamicallyMike Frysinger3-5/+4
Avoid use of TARGET_<syscall> defines and rely on the callback layers to resolve these dynamically so we can support multiple syscall layers instead of assuming the newlib/libgloss numbers all the time.
2021-11-28sim: nltvals: drop i960Mike Frysinger2-26/+2
This port was dropped from gdb/bfd/sim years ago, so stop including its syscall constants too.
2021-11-28sim: moxie: fix datadir handlingMike Frysinger1-1/+1
Expand the value at `make` time rather than configure generation time so that we handle $(datarootdir) setting properly.
2021-11-27sim: hw: mark hw_descriptors constMike Frysinger2-2/+2
2021-11-27sim: testsuite: add dedicated flag for init toolchain testsMike Frysinger2-6/+15
As we setup more reliable CC_FOR_TARGET variables for each target, the bfin way of overriding it to stuff custom CFLAGS doesn't scale well. Add a dedicated CFLAGS_FOR_TARGET_init setting that each set of tests can setup if they want to add custom options.
2021-11-27sim: testsuite: clean up arch specific toolchain settingsMike Frysinger3-4/+14
In a multitarget build, we process all targets in order, so make sure the toolchain settings from one don't leak into the next.
2021-11-27sim: cris: always search for local rvdummy toolMike Frysinger1-8/+2
If the board info sets the sim to a basename that is found via $PATH (which is the default dejagnu behavior), the logic here to use its dirname to find rvdummy fails because it looks for `./rvdummy`. So switch it to always use the local build of rvdummy which is the one we want to be testing against in the first place. If we get a request for testing against a different setup, we can figure out & document the needs at that point, and then setup some config knobs to control it.
2021-11-26sim: testsuite: fix bits-gen EXEEXT handlingMike Frysinger2-8/+8
Add missing $(EXEEXT) to dependencies on bits-gen. These are actually build-only tools, but automake doesn't allow for build & host tools, so the rules are re-using EXEEXT.
2021-11-26sim: testsuite: initial support for OS-specific testsMike Frysinger107-107/+158
We usually test against the newlib/libgloss environment, but for a few ports that also support Linux apps, we want to test that logic too. A lot of the C code is written such that it works with either newlib/libgloss or glibc/linux toolchains, but we have some tests that end up being Linux-specific. Cris has been using the target tuple as a rough proxy for this (where cris*-*-elf is assumed to be newlib/libgloss, and everything else is glibc/linux), but that is a bit too rough, and it doesn't work in a multitarget build. So lets create a few stub files that we can do compile tests with to detect the different setups, and then let tests declare which one they require (if they require any at all).
2021-11-26sim: testsuite: unify basic C compiler checksMike Frysinger4-40/+53
Both bfin & cris ports test the C compiler to see if it works, but in their own way. Unify the checks in the common code so we can leverage them in more ports in the future, and collapse the bfin & cris code.
2021-11-26sim: testsuite: rework sim_init usageMike Frysinger44-26/+109
The sim_init function was called by runtest for each test when --tool was set to sim. When we changed to --tool '' to collapse the testsuite dir, the init function was no longer called on every test. However, it was still being called explicitly by config/default.exp. It's not clear why that explicit call ever existed since, in the past, it meant it was redundant. Lets drop the single sim_init call in config/default.exp and move it out to all our tests. This replicates the runtest behavior so we can setup variables on a per-test basis which allows us to recollapse the sim_path logic back. We'll also leverage this in the future for toolchain setup. Also add a few comments clarifying the overall runtime behavior.
2021-11-26sim: cris: fix testsuite hang when sim is missingMike Frysinger2-0/+9
If the cris sim hasn't been built yet, trying to run its testsuite will hang indefinitely. The common sim APIs already have this, so copy it over to the cris forks of the test+run functions.
2021-11-26sim: testsuite: fix objdir handlingMike Frysinger9-42/+46
The tests assume that the cwd is the objdir directory and write its intermediates to there all the time. When using runtest's --objdir setting though, this puts the files in the wrong place. This isn't a big problem currently as we never change --objdir, but in order to support parallel test execution, we're going to start setting that option, so clean up the code ahead of time. We also have to tweak some of the cris tests which were making assumptions about the argv[0] value.
2021-11-26sim: testsuite: rename global_sim_options to SIMFLAGS_FOR_TARGETMike Frysinger5-37/+19
Now that all the other toolchain settings have been renamed to match the dejagnu settings of XXX_FOR_TARGET, rename global_sim_options to SIMFLAGS_FOR_TARGET too.