Age | Commit message (Collapse) | Author | Files | Lines |
|
This doesn't matter right now, but it will as we add more flags to
the recursive make step to pass state down.
|
|
Automake will run each subdir individually before moving on to the next
one. This means that the linking phase, a single threaded process, will
not run in parallel with anything else. When we have to link ~32 ports,
that's 32 link steps that don't take advantage of parallel systems. On
my really old 4-core system, this cuts a multi-target build from ~60 sec
to ~30 sec. We eventually want to move all compile+link steps to this
common dir anyways, so might as well move linking now for a nice speedup.
We use noinst_PROGRAMS instead of bin_PROGRAMS because we're taking care
of the install ourselves rather than letting automake process it.
|
|
This is used to allow for dangling \ in object lists, but these are the
only ports that do it, and it isn't really necessary. Punt it to keep
the various makefiles harmonized.
|
|
When reading/writing arbitrary data to the system's memory, the unsigned
char pointer type doesn't make that much sense. Switch it to void so we
align a bit with standard C library read/write functions, and to avoid
having to sprinkle casts everywhere.
|
|
These functions only read from memory, so mark the pointer as const.
|
|
These functions only read from memory, so mark the pointer as const.
|
|
When reading/writing arbitrary data to the system's memory, the unsigned
char pointer type doesn't make that much sense. Switch it to void so we
align a bit with standard C library read/write functions, and to avoid
having to sprinkle casts everywhere.
|
|
Because of a Libiberty hack, getopt on GNU libc (2.25 or earlier) is
currently unusable on sim, causing a regression on CentOS 7.
This is caused as follows:
1. If HAVE_DECL_GETOPT is defined (getopt declaration with known prototype
is detected while configuration), a declaration of getopt in
"include/getopt.h" is suppressed.
The author started to define HAVE_DECL_GETOPT in sim with the commit
340aa4f6872c ("sim: Check known getopt definition existence").
2. GNU libc (2.25 or earlier)'s <unistd.h> includes <getopt.h> with a
special purpose macro defined to declare only getopt function but due
to include path (not tested while configuration), it causes <unistd.h>
to include Libiberty's "include/getopt.h".
3. If both 1. and 2. are satisfied, despite that <unistd.h> tries to
declare getopt by including <getopt.h>, "include/getopt.h" does not do
so, causing getopt function undeclared.
Getting rid of "include/getopt.h" (e.g. renaming this header file) is the
best solution to avoid hacking but as a short-term solution, this commit
replaces getopt with getopt_long under sim/.
|
|
Clang generates a warning if the format string of a printf-like function is
not a literal ("-Wformat-nonliteral"). On the default configuration, it
causes a build failure (unless "--disable-werror" is specified).
To avoid warnings on the printf-like wrapper, it requires proper
__attribute__((format)) and we have ATTRIBUTE_PRINTF macro for this reason.
This commit adds ATTRIBUTE_PRINTF to the printf-like functions.
|
|
Like commit b82817674f, this replaces BFD_VMA_FMT "x" in sim/ with
PRIx64 and casts to promote bfd_vma to uint64_t. The one file using
BFD_VMA_FMT in gdb/ instead now uses hex_string, and a typo in the
warning message is fixed.
|
|
Noticed format mismatch when attempted to build gdb on i686-linux-gnu
in --enable-64-bit-bfd mode:
sim/../../sim/cris/sim-if.c:576:28:
error: format '%lx' expects argument of type 'long unsigned int',
but argument 4 has type 'bfd_size_type' {aka 'long long unsigned int'} [-Werror=format=]
576 | sim_do_commandf (sd, "memory region 0x%" BFD_VMA_FMT "x,0x%lx",
| ^~~~~~~~~~~~~~~~~~~
577 | interp_load_addr, interpsiz);
| ~~~~~~~~~
| |
| bfd_size_type {aka long long unsigned int}
While at it fixed format string for time-related types.
|
|
PTR will soon disappear from ansidecl.h. Remove uses in sim. Where
a PTR cast is used in assignment or function args to a void* I've
simply removed the unnecessary (in C) cast rather than replacing with
(void *).
|
|
In commit:
commit 60a3da00bd5407f07d64dff82a4dae98230dfaac
Date: Sat Jan 22 11:38:18 2022 +0000
objdump/opcodes: add syntax highlighting to disassembler output
I broke several sim/ targets by forgetting to update their uses of the
libopcodes disassembler to take account of the new styled printing.
These should all be fixed by this commit.
I've not tried to add actual styled output to the simulator traces,
instead, the styled print routines just ignore the style and print the
output unstyled.
|
|
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.
|
|
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.
|
|
We already turn these on in the configure script.
|
|
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.
|
|
These rules don't depend on the target compiler settings, so hoist
the build logic up to the common builds for better parallelization.
|
|
Drop the single debugging line that repeats the command line option,
and use the silent build helpers to tighten up output.
|
|
Now that ChangeLog entries are no longer used for sim patches,
this commit renames all relevant sim ChangeLog to ChangeLog-2021,
similar to what we would do in the context of the "Start of New
Year" procedure.
The purpose of this change is to avoid people merging ChangeLog
entries by mistake when applying existing commits that they are
currently working on.
Also throw in a .gitignore entry to keep people from adding new
ChangeLog files anywhere in the sim tree.
|
|
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.
|
|
Move these options up to the common dir so we only test & export
them once across all ports.
|
|
The sim-hardware configure option allows builders to select a set of
device models to enable. But this seems like unnecessary overkill:
the existence of individual device models doesn't affect performance
at all as they are only enabled at runtime if the config uses them,
and individually these are all <5KB a piece. Stripping off a total
of ~50KB from a ~1MB binary doesn't seem useful, and it's extremely
unlikely anyone will ever bother.
So let's simplify the configure/make logic by turning sim-hardware
into a boolean option like many of the other sim options. Any ports
that have unique device models will declare them in their Makefile
instead of at configure time. This will allow us to (eventually)
unify the setting into the common dir.
|
|
Now that we've moved all content out to the common file, this is
empty and can be deleted it entirely.
|
|
Move these options up to the common dir so we only test & export
them once across all ports. This takes a page from the cgen maint
logic to make $(MAINT) work for non-automake Makefiles which will
allow us to merge it together.
|
|
This will allow us to build the common code with the same inline
settings as the arch subdirs, and only do the test once.
|
|
Move these options up to the common dir so we only test & export
them once across all ports.
|
|
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.
|
|
Move these options up to the common dir so we only test & export
them once across all ports.
|
|
Move these options up to the common dir so we only test & export
them once across all ports.
|
|
Move these options up to the common dir so we only test & export
them once across all ports.
|
|
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.
|
|
For the ports that still don't build with -Werror, rather than disable
the flag at configure time, do it at make time. This will allow us to
unify these tests in the common sim configure script.
|
|
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.
|
|
The current autoconf 2.69 defines this to nothing because the logic
in AC_PROG_CC takes care of it all the time now. Delete the call.
|
|
All of the settings in here are handled by the common top-level
config.h, so drop the individual arch-config.h files entirely.
This will also help guarantee that we don't add any new arch
specific defines that would affect common code which will help
with the effort of unifying them.
|
|
This is the only define left in m4/ that is not in the common config.h,
so move it to sim_hw_cflags so we can drop the arch-specific config.h.
|
|
Now that gnulib provides this, assume it exists.
|
|
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.
|
|
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.
|
|
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.
|
|
If the header files define open(), make sure our local open var
doesn't shadow it.
|
|
The defs.h header will take care of including the various config.h
headers. For now, it's just config.h, but we'll add more when we
integrate gnulib in.
This header should be used instead of config.h, and should be the
first include in every .c file. We won't rely on the old behavior
where we expected files to include the port's sim-main.h which then
includes the common sim-basics.h which then includes config.h. We
have a ton of code that includes things before sim-main.h, and it
sometimes needs to be that way. Creating a dedicated header avoids
the ordering mess and implicit inclusion that shows up otherwise.
|
|
|
|
The gdb/callback.h & gdb/remote-sim.h headers have nothing to do with
gdb and are really definitions for the libsim API under the sim/ tree.
While gdb uses those headers as a client, it's not specific to it. So
create a new sim/ namespace and move the headers there.
|
|
A random grab bag of minor fixes to enable -Werror for this port.
Check the return values of read & write calls and issue warnings when
they fail.
Fixup funky pointer math as the compiler doesn't like ++ on void*.
Handle short reads with fread().
|
|
Add scope braces to a bunch of the generated sections to avoid compiler
warnings about mixing code & variable declarations.
|