Commit Graph

144 Commits

Author SHA1 Message Date
Mike Frysinger
1ee4d0e313 sim: frv: flip trapdump default back to off
When I refactored this by scoping it to sim-frv-xxx in commit
e7954ef5e5 ("sim: frv: scope the
unique configure flag"), I changed the default from off to on.
While the feature is nice for developers, it breaks a bunch of
tests which aren't expecting this extra output.  So flip it back
to off by default.
2021-11-10 05:19:03 -05:00
Mike Frysinger
65dcce8f79 sim: add arch-specific conditional logic
This will make it easy to include arch-specific logic (build files)
as we migrate ports to the common top level build.
2021-10-31 02:03:16 -04:00
Nick Alcock
b9004024b9 configure: regenerate in all projects that use libtool.m4
(including sim/, which has no changelog.)

bfd/ChangeLog
2021-09-27  Nick Alcock  <nick.alcock@oracle.com>

	* configure: Regenerate.

binutils/ChangeLog
2021-09-27  Nick Alcock  <nick.alcock@oracle.com>

	* configure: Regenerate.

gas/ChangeLog
2021-09-27  Nick Alcock  <nick.alcock@oracle.com>

	* configure: Regenerate.

gprof/ChangeLog
2021-09-27  Nick Alcock  <nick.alcock@oracle.com>

	* configure: Regenerate.

ld/ChangeLog
2021-09-27  Nick Alcock  <nick.alcock@oracle.com>

	* configure: Regenerate.

libctf/ChangeLog
2021-09-27  Nick Alcock  <nick.alcock@oracle.com>

	* configure: Regenerate.
	* Makefile.in: Regenerate.

opcodes/ChangeLog
2021-09-27  Nick Alcock  <nick.alcock@oracle.com>

	* configure: Regenerate.

zlib/ChangeLog
2021-09-27  Nick Alcock  <nick.alcock@oracle.com>

	* configure: Regenerate.
2021-09-27 20:31:24 +01:00
Mike Frysinger
f050cfdd82 sim: bfin: add support for SDL2
This probably should have been ported long ago, but better late than
never.  We keep support for both versions for now since both projects
tend to have long lifetimes.  Maybe consider dropping SDL1 in another
ten years.
2021-09-13 22:45:19 -04:00
Mike Frysinger
03de8f26e8 sim: dv-sockser: enable for mingw targets too
We have enough functionality from gnulib now to build sockser on
all platforms.

Non-blocking I/O is supported when F_GETFL/F_SETFL are unavailable,
but we can address that in a follow up commit.  This mirrors what
is done in other places in the sim already.
2021-09-09 01:32:16 -04:00
Mike Frysinger
99aedb6243 sim: update configure target list
Fix sorting of the list, and update the globs to match the list used
in gdb's configure script.
2021-09-08 01:24:15 -04:00
Mike Frysinger
7eb1f99ada sim: unify reserved instruction bits settings
Move these options up to the common dir so we only test & export
them once across all ports.

The setting only affects igen based ports, and they were turning
this on by default, so keep the default in place.
2021-07-01 20:53:00 -04:00
Mike Frysinger
313c332ff2 sim: m32r: merge with common configure script
Now that the traps code has been unified, the configure script has no
unique logic in it, so it can be merged into the single common one.
2021-07-01 20:48:07 -04:00
Mike Frysinger
408a44aac1 sim: cris/frv/iq2000/lm32: merge with common configure script
Now that the scache logic has been migrated into the common code,
there's nothing specific in these configure scripts, so merge them
into the common one.

The frv unique logic can be moved to a dedicated include and merged
in the common configure since the flag has been scoped to the arch.
2021-06-30 14:39:46 -04:00
Mike Frysinger
b79efe264f sim: unify scache settings
The cgen scache module is enabled by every cgen port, and with the
same default value of 16k (which matches the common default value).
Let's pull this option out of the individual ports (via CPPFLAGS)
and into the common code (via config.h).

The object itself is compiled only for cgen ports atm, so that part
doesn't change.  The scache code is initialized dynamically via the
modules.c logic.  That's why the profile code needs an additional
CGEN_ARCH check.

This will allow us to collapse arch configure files more.  Merging
the source files will require more future work, but integrating the
cgen & non-cgen worlds itself will take a lot.
2021-06-30 13:33:18 -04:00
Mike Frysinger
d8b04da736 sim: bfin: merge with common configure script
Now that the model logic has been migrated into the runtime, there's
nothing specific in the bfin configure code, so merge it into the
common one.
2021-06-30 03:01:46 -04:00
Mike Frysinger
d414eb3e7f sim: move default model to the runtime sim state
This kills off another compile-time option by moving the setting to
the individual arch runtimes.  This will allow dynamic selection by
the arch when doing a single build with multiple arches.

The sim_model_init rework is a little funky.  In the past it was
disabled entirely if no default model was set.  We maintain the
spirit of the logic by gating the fallback logic on whether the
port has defined any models.
2021-06-30 02:57:45 -04:00
Mike Frysinger
7f6fa74374 sim: use -Wunused-but-set-parameter
The code is already clean, so sync this over from gdb warning.m4.
Also shuffle the order of the flags a bit to match the current gdb
warning.m4 code.
2021-06-29 22:28:50 -04:00
Mike Frysinger
3167423f07 sim: use -Wno-error=maybe-uninitialized
We have some code tripping this warning, but it depends on the gcc
version & optimization levels.  We've added some hints to the code
so some versions of gcc work better, but still not all.  Let's just
disable the warning like gdb does.
2021-06-29 22:22:17 -04:00
Mike Frysinger
5d0b3088f7 sim: erc32: merge with common configure script
Move the unique library tests to the common code so we can delete
the erc32 configure logic entirely.
2021-06-27 01:21:47 -04:00
Mike Frysinger
d57b653328 sim: bfin: move pkg-config & SDL checks to common code
This reduces the unique logic in bfin/configure to make it easier to
(eventually) unify it entirely.
2021-06-27 01:18:22 -04:00
Mike Frysinger
b34084121a sim: switch common srcdir to abs_srcdir
We rewrite srcdir in subdir Makefiles that we generate from the common
parent dir since it points to the parent dir.  Since @srcdir@ can be a
variety of formats (relative & absolute), switch to @abs_srcdir@ which
is a lot easier to adjust.  Our use of srcdir in here should handle it.
2021-06-23 18:12:43 -04:00
Mike Frysinger
e173c80fbb sim: rx: merge with common configure script
Move the unique configure flag to acinclude.m4 so the common code
can include it, then delete the rx configure logic entirely.
2021-06-22 19:29:28 -04:00
Mike Frysinger
36bb57e40c sim: drop configure scripts for simple ports
These ports only use the pieces that have been unified, so we can
merge them into the common configure script and get rid of their
unique one entirely.

We still compile & link separate run programs, and have dedicated
subdir Makefiles, but the configure script portion is merged.
2021-06-22 19:26:13 -04:00
Mike Frysinger
456ef1c1d4 sim: unify hardware settings
Move these options up to the common dir so we only test & export
them once across all ports.
2021-06-21 22:20:18 -04:00
Mike Frysinger
1bf5c34239 sim: unify cgen maintainer settings
Move these options up to the common dir so we only test & export
them once across all ports.  It makes it available to targets that
aren't cgen-based, but those will just ignore the settings, so it
shouldn't be an issue.
2021-06-20 00:25:13 -04:00
Mike Frysinger
d73f39ee43 sim: move sim-inline to the common code
This will allow us to build the common code with the same inline
settings as the arch subdirs, and only do the test once.
2021-06-20 00:12:11 -04:00
Mike Frysinger
a979f2a07a sim: unify dtc tool checks
Only one arch uses this currently, but others could too.  By moving
it up to the common checks, it'll also let us simplify the moxie code
significantly.
2021-06-19 22:43:56 -04:00
Mike Frysinger
ce3ec98acd sim: unify gettext/intl probing logic
Move these options up to the common dir so we only test & export
them once across all ports.
2021-06-19 16:18:07 -04:00
Mike Frysinger
bc56166f66 sim: unify toolchain dependency logic
The common dir is already probing this info since it's using automake,
so pass it down to the subdirs so they don't have to probe it at all.
2021-06-19 16:07:31 -04:00
Mike Frysinger
b5689863bd sim: unify bfd library dependency testing logic
Move these options up to the common dir so we only test & export
them once across all ports.
2021-06-19 01:08:39 -04:00
Mike Frysinger
07490bf81d sim: unify various library testing logic
Move these options up to the common dir so we only test & export
them once across all ports.
2021-06-19 01:01:21 -04:00
Mike Frysinger
47ce766a8b sim: unify -Werror build settings
Move these options up to the common dir so we only test & export
them once across all ports.  It also enables -Werror usage on the
common files we've been pulling out of arch subdirs.
2021-06-18 10:25:04 -04:00
Mike Frysinger
3f8414df7a sim: create a makefile fragment to pass common settings down
As we merge settings from subdirs into the common configure, we
sometimes need to keep the settings working in both dirs.  Create
a makefile fragment to pass them down so we don't have to run the
checks twice.  For now, the file is empty, but we'll start moving
logic in shortly.
2021-06-18 10:11:58 -04:00
Mike Frysinger
f9a4d54332 sim: overhaul & unify endian settings management
The m4 macro has 2 args: the "wire" settings (which represents the
hardwired port behavior), and the default settings (which are used
if nothing else is specified).  If none are specified, the arch is
expected to support both, and the value will be probed based on the
user runtime options or the input program.

Only two arches today set the default value (bpf & mips).  We can
probably let this go as it only shows up in one scenario: the sim
is invoked, but with no inputs, and no user endian selection.  This
means bpf will not behave like the other arches: an error is shown
and forces the user to make a choice.  If an input program is used
though, we'll still switch the default to that.  This allows us to
remove the WITH_DEFAULT_TARGET_BYTE_ORDER setting.

For the ports that set a "wire" endian, move it to the runtime init
of the respective sim_open calls.  This allows us to change the
WITH_TARGET_BYTE_ORDER to purely a user-selected configure setting
if they want to force a specific endianness.

With all the endian logic moved to runtime selection, we can move
the configure call up to the common dir so we only process it once
across all ports.

The ppc arch was picking the wire endian based on the target used,
but since we weren't doing that for other biendian arches, we can
let this go too.  We'll rely on the input selecting the endian, or
make the user decide.
2021-06-17 23:20:13 -04:00
Mike Frysinger
fbe8d1cf5b sim: enable silent rules in common builds
We only do the common code as automake simplifies the logic.
2021-06-14 20:04:44 -04:00
Mike Frysinger
2726bbc339 sim: assume sys/select.h always exists
Now that gnulib provides this, assume it exists.
2021-06-12 22:19:30 -04:00
Mike Frysinger
ba307cddcf sim: overhaul alignment settings management
Currently, the sim-config module will abort if alignment settings
haven't been specified by the port's configure.ac.  This is a bit
weird when we've allowed SIM_AC_OPTION_ALIGNMENT to seem like it's
optional to use.  Thus everyone invokes it.

There are 4 alignment settings, but really only 2 matters: strict
and nonstrict.  The "mixed" setting is just the default ("unset"),
and "forced" isn't used directly by anyone (it's available as a
runtime option for some ports).

The m4 macro has 2 args: the "wire" settings (which represents the
hardwired port behavior), and the default settings (which are used
if nothing else is specified).  If none are specified, then the
build won't work (see above as if SIM_AC_OPTION_ALIGNMENT wasn't
called).  If default settings are provided, then that is used, but
we allow the user to override at runtime.  Otherwise, the "wire"
settings are used and user runtime options to change are ignored.

Most ports specify a default, or set the "wire" to nonstrict.  A
few set "wire" to strict, but it's not clear that's necessary as
it doesn't make the code behavior, by default, any different.  It
might make things a little faster, but we should provide the user
the choice of the compromises to make: force a specific mode at
compile time for faster runtime, or allow the choice at runtime.
More likely it seems like an oversight when these ports were
initially created, and/or copied & pasted from existing ports.

With all that backstory, let's get to what this commit does.

First kill off the idea of a compile-time default alignment and
set it to nonstrict in the common code.  For any ports that want
strict alignment by default, that code is moved to sim_open while
initializing the sim.  That means WITH_DEFAULT_ALIGNMENT can be
completely removed.

Moving the default alignment to the runtime also allows removal
of setting the "wire" settings at configure time.  Which allows
removing of all arguments to SIM_AC_OPTION_ALIGNMENT and moving
that call to common code.

The macro logic can be reworked to not pass WITH_ALIGNMENT as -D
CPPFLAG and instead move it to config.h.

All of these taken together mean we can hoist the macro up to the
top level and share it among all sims so behavior is consistent
among all the ports.
2021-06-12 21:14:50 -04:00
Mike Frysinger
6dd65fc048 sim: unify bug & package settings
Move these options up to the common dir so we only test & export
them once across all ports.  The AC_INIT macro does a lot of the
heavy lifting already which allows further simplification.
2021-06-12 20:24:08 -04:00
Mike Frysinger
04381273a9 sim: unify debug/stdio/trace/profile build settings
Move these options up to the common dir so we only test & export
them once across all ports.

The ppc code needs a little extra care with its trace settings as
it's not exactly the same API as the common code.  The other knobs
are the same though.
2021-06-12 20:07:57 -04:00
Mike Frysinger
a48ff3efda sim: ppc: unify header & function & type tests too
Since ppc now shares a config.h with the top-level, move all of its
relevant settings up a level.  The ppc port tests a lot more funcs,
but that's because its syscall emulation is a lot more complete.
We'll probably utilize some of these in the common code too.
2021-06-12 14:39:44 -04:00
Mike Frysinger
5ea4547402 sim: unify environment build settings
Move the --sim-enable-environment option up to the common dir so we
only test & export it once across all ports.
2021-06-12 11:01:57 -04:00
Mike Frysinger
dba333c1e4 sim: unify assert build settings
Move the --sim-enable-assert option up to the common dir so we only
test & export it once across all ports.
2021-06-12 10:58:22 -04:00
Mike Frysinger
b15c5d7a51 sim: unify platform function & header tests
Move the various platform tests up a level to avoid duplication
across the ports.  When building multiple versions, this speeds
things up a bit.

For now we move the obvious stuff up a level, but we don't turn
own the config.h entirely just yet -- we still have some tests
related to libraries that need consideration.
2021-06-12 10:45:36 -04:00
Mike Frysinger
aa0fca163e sim: add support for build-time ar & ranlib
This is needed when building for a target whose ar & ranlib are
incompatible with the current build system.  For example, building
for Windows on a Linux system.

Then manually import the automake rule for libigen.a, but tweak the
tool variables to use the FOR_BUILD variants.
2021-05-04 08:22:07 -04:00
Mike Frysinger
26da232cbd sim: example-synacor: a simple implementation for reference
Provide a simple example simulator for people porting to new targets
to use as a reference.  This one has the advantage of being used by
people and having a fun program available for it.

It doesn't require a special target -- the example simulators can be
built for any existing port.
2021-04-03 16:19:16 -04:00
Mike Frysinger
a0e674c1ce sim: add preliminary support for --enable-targets
This doesn't actually create one `run` program like other projects,
but creates multiple `run-$arch` targets.  While it might not seem
that useful initially, this has some nice properties:
- Allows us to quickly build all sim targets in a single tree.
- Positions us better for converting targets over to a proper
  multitarget build+install.

We don't have the ability to actually run tests against them, but
that's due to a limitation in gas: it doesn't support multitarget.
If that ever changes, we should be able to turn on our tests too.
We can improve the test framework to fallback to a system toolchain
if available to help mitigate that.
2021-04-03 14:49:50 -04:00
Mike Frysinger
b6b1c79084 sim: igen: merge build into top level
This simplifies the build a bit (especially for deps in port subdirs),
and avoids recursive make.  This in turn speeds up the build, and sets
us up for multi-target.
2021-04-02 23:35:47 -04:00
Mike Frysinger
c2783492b6 sim: unify toolchain settings
The toplevel, common, and igen dirs all have their own code for
setting up toolchain settings.  Unify all of that in a new macro.
2021-04-02 23:31:14 -04:00
Tom Tromey
8c379db285 Enable maintainer mode for sim
The sim's recently switch to using Automake caused a build failure for
me, because I didn't have the correct auto* tools in my path.
However, the rule in the tree is that this is not needed in general.
This patch adds a call to AM_MAINTAINER_MODE, to align the sim with
the way the rest of the tree works here.

sim/ChangeLog
2021-03-08  Tom Tromey  <tromey@adacore.com>

	* aclocal.m4, configure, Makefile.in: Rebuild.
	* configure.ac: Use AM_MAINTAINER_MODE.
2021-03-08 07:53:53 -07:00
Jeff Law
f4df849f1d Regenerated 2021-03-07 16:03:49 -07:00
Mike Frysinger
6c57b87fc4 sim: testsuite: merge into toplevel automake
This allows us to delete most of our custom test logic,
and avoids a recursive make for minor speed up.
2021-03-07 15:54:53 -05:00
Mike Frysinger
6bddc3e8b4 sim: switch top level to automake
This doesn't gain us much by itself, but it sets us up for using more
features as we try to unify ports and avoid recursive make.
2021-03-07 13:41:45 -05:00
Mike Frysinger
3e8bb3e934 sim: merge configure.tgt into configure.ac
One fewer file to worry about & manage.
2021-02-20 10:35:27 -05:00
Mike Frysinger
b0dcd7d832 sim: testsuite: push $arch out to targets
This is needed to move to automake & its dejagnu-provided logic,
and eventually by the unified sim logic.  The $arch is used only
to figure out which `run` program to use when running tests, and
as we move to a single top-level build, we can delete this and
use sim/run directly.
2021-02-13 12:14:25 -05:00