Age | Commit message (Collapse) | Author | Files | Lines |
|
This fixes remaking of these files and avoids unnecessary rebuilds.
Also add both to `make clean` to match other stamp files.
|
|
Now that all warnings are fixed in this port, enable -Werror by default.
|
|
This allows the caller to catch engine aborts if they want, and fixes
the warning about missing stdlib.h include by not using abort().
|
|
Add conditional logic around fcntl.h F_{G,S}ETFL usage to fix builds
on systems that don't have it (e.g. Windows). The code is only used
to save & restore limited terminal stdin state.
|
|
Add conditional logic around termios.h usage to fix builds on systems
that don't have it (e.g. Windows).
|
|
The common code already calls this, so no need to do so in arch dirs.
We leave the calls that disable -Werror. This will help unify the
configure scripts.
|
|
We only do the common code as automake simplifies the logic.
|
|
The current setting assumes that gnulib is only used by dirs
immediately under the source root. Trying to build it two or
more levels deep fails. Switch GNULIB_BUILDDIR to a relative
GNULIB_PARENT_DIR so that it can be used to construct both the
build & source paths.
|
|
The common version.o we're building can be used for the ppc subdir,
so switch it over too.
|
|
This is the last unique setting that rx has in its config.h, so by
moving this to CPPFLAGS, we can drop its config.h entirely.
|
|
There are some functions that gnulib does not yet provide fallbacks
for, so start a common file of our own for holding existing stubs.
|
|
Since this file does not rely on any port-specific settings, move it
up to building as part of the common step so we only do it once in a
multibuild.
|
|
The common sim-profile option controls whether to keep track of
runtime execution (like cycle count), so switch the rx-specific
cycle-stats option over to that.
|
|
Now that gnulib provides this, assume it exists.
|
|
This BSDism was never accepted into standards, so replace it with the
portable void* type instead.
|
|
|
|
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.
|
|
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.
|
|
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.
|
|
This follows existing organizational structure with one configure option
per m4 file, and will make it easier to move to the common configure dir.
|
|
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.
|
|
The ppc port doesn't share a lot of the common logic, but there are
a few bits that bleed across. Have it use the common configure for
environment settings too to avoid duplicate define errors after the
recent unification with the other ports.
|
|
Move the --sim-enable-environment option up to the common dir so we
only test & export it once across all ports.
|
|
Move the --sim-enable-assert option up to the common dir so we only
test & export it once across all ports.
|
|
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.
|
|
We require C11 which defines NULL, so drop the inconsistent set of
fallback defines in the codebase.
|
|
The hook is a void func, so defining it to 0 triggers warnings,
and isn't really needed.
|
|
Allow ports to initialize the callback endian if they want. This will
allow delegation of the logic out of common code in the future.
Also switch from the CURRENT_TARGET_BYTE_ORDER macro to the underlying
current_target_byte_order storage since the latter has been setup by
the sim-config module based on the same macros. This will allow the
nrun module to be moved to common building for sharing.
|
|
Code should be going through this macro rather than accessing the
underlying value directly.
|
|
This function has done only one thing: post-process command line
settings to see if profiling or tracing has been enabled, and if
so, set the run_fast_p flag in the simulator state. That flag is
only used in one place: to select the fast or slow cgen engine.
By inlining the run_fast_p logic to the one place it's used, we
can delete a good amount of logic specific to cgen ports: both
the call to cgen_init and the conditional simulator state. This
in turn allows us to have a single simulator state struct across
all ports so we can share objects more between them, and makes
the sim_open calls look more consistent.
|
|
Separate the name of the igen program from the options used to run it.
This allows us to avoid duplicating ../igen/igen in Makefiles and reuse
the existing setting in the common Makefile. This also allows us to
easily harmonize the use of EXEEXT between igen/local.mk and the common
makefiles when cross-compiling for e.g. Windows.
|
|
Now that gnulib provides a wrapper, assume it always exists.
|
|
This provides a space to generate things that we only need to build
once per-arch. Some day that will be all of common/, but for now,
we move the version.c management in.
|
|
gnulib can override stdio.h and/or stdlib.h in which case the gnulib
headers require config.h to be included first.
gdb/sim/m32c/ChangeLog:
* m32c.opc: Include defs.h.
* r8c.opc: Likewise.
|
|
This mirrors what we do for other builds already.
|
|
If the OS headers define the "errno" symbol, it breaks some of these
funcs that were using "int errno" itself. Rename local vars to "err"
to avoid that, and delete the old "extern int errno".
|
|
The execv prototypes on Windows via mingw64 include extra const
markings on the argv/envp pointers than what POSIX specifies.
Cast them to void* as a hack to get it working on all platforms.
|
|
This is a bit of a hack, but it matches the hack we use in other
places in the sim currently. This fixes building for e.g. Windows.
The signal fallback logic needs a bit of love in general at some
point across all sim code.
|
|
Some modules might require extra linking depending on the platform
(e.g. Windows might need -lws2_32), so include the existing extra
gnulib libs setting.
|
|
Make sure we don't fail to build when dv-socker is unavailable.
|
|
Some were missing, some were unused, and some were partially renamed.
|
|
Newer gcc warns when writing statements like (a && b || c && d),
so add more parentheses to make it (and the reader) happy.
|
|
|
|
If the header files define open(), make sure our local open var
doesn't shadow it.
|
|
We use getline, so leverage gnulib to provide fallback implementation.
|
|
Need to shift the upper 32-bits and not just combine directly with
the lower 32-bits.
|
|
* addb.s: Add special case reg,<@reg+ / @reg- / @+reg / @-reg>.
* andb.s: Likewise.
* cmpb.s: Likewise.
* orb.s: Likewise.
* subb.s: Likewise.
* xorb.s: Likewise.
* movb.s: Add special case reg,<@reg+ / @reg- / @+reg / @-reg>
@reg+,@reg+ / @-reg,@-reg.
* movw.s: Likewise.
* movl.s: Likewise.
|
|
* sim-main.h (h8_typecodes): Add operand type OP_REG_DEC, OP_REG_INC.
* compile.c (decode): Rewrite oprand type for specific case.
(fetch_1): Add handling OP_REG_DEC and OP_REG_INC.
(step_once): Fix operand fetch order.
|
|
All other cgen ports keep their generated desc & opc files under
opcodes/, so move the cris files over too. The cris-opc.c file,
while not generated, is already here to complement.
|
|
The cleanup to use BFD_VMA_FMT also adjusted this line, but used the
incorrect format: while BFD_VMA_FMT needs an explicit "x", PRIx32 does
not, so the spurious "x" here confused the parser and broke execution.
|