Commit Graph

839 Commits

Author SHA1 Message Date
Andrew Burgess
1d506c26d9 Update copyright year range in header of all files managed by GDB
This commit is the result of the following actions:

  - Running gdb/copyright.py to update all of the copyright headers to
    include 2024,

  - Manually updating a few files the copyright.py script told me to
    update, these files had copyright headers embedded within the
    file,

  - Regenerating gdbsupport/Makefile.in to refresh it's copyright
    date,

  - Using grep to find other files that still mentioned 2023.  If
    these files were updated last year from 2022 to 2023 then I've
    updated them this year to 2024.

I'm sure I've probably missed some dates.  Feel free to fix them up as
you spot them.
2024-01-12 15:49:57 +00:00
Mike Frysinger
4c68f4e386 sim: mips: drop old clean workaround
This logic dates back to the original import, and seems to be for
handling systems where `rm -f` (i.e. no files) would error out.
None of that is relevant for us with current automake, so drop it.
2024-01-08 20:20:59 -05:00
Mike Frysinger
d31fd3f617 sim: mips: fix -Wshadow=local warnings
Delete redundant decls when the existing scope has the same var and
type available for use.
2023-12-22 23:29:19 -05:00
Mike Frysinger
28c06ff1a1 sim: mips: fix -Wimplicit-fallthrough warnings
Seems like these cases were meant to fallthru.
2023-12-21 01:59:23 -05:00
Mike Frysinger
d137b254d9 sim: signal: mark signal callback funcs as noreturn since they don't return
All funcs already call other funcs that don't return.  The mips port is
the only exception because its generic exception handler can return in
the case of normal exceptions.  So while the exceptions its signal handler
triggers doesn't return, we can't express that conditional logic.  So add
some useless abort calls to make the compiler happy.
2023-12-21 01:59:22 -05:00
Mike Frysinger
bb2f91823f sim: mips: fix -Wunused-variable warnings 2023-12-19 05:51:11 -05:00
Mike Frysinger
5dda1cd28a sim: mips: fix -Wunused-but-set-variable warnings 2023-12-07 21:41:27 -07:00
Mike Frysinger
de501587c2 sim: mips: fix sim_fpu usage
Fix some of the sim_fpu calls to use the right types.  While I'm
not familiar with the MIPS ISA in these cases, these look like
simple oversights due to the name/type mismatches.  This at least
fixes compiling with -Wenum-conversion.
2023-12-05 06:12:02 -07:00
Ying Huang
27c22a4c76 sim: mips: Change E_MIPS_* to EF_MIPS_*
According to we have changed all E_MIPS_* to EF_MIPS_* in binutils
and glibc, we also need to change it here to keep same style.
We can refer to this commit record:
https://sourceware.org/pipermail/binutils/2023-October/129904.html

Approved-By: Pedro Alves <pedro@palves.net>
2023-11-16 10:21:55 +08:00
Mike Frysinger
30ebc4310b sim: mips: fix printf string 2023-10-15 16:25:13 +05:45
Mike Frysinger
109a0a7e90 sim: modules.c: fix generation after recent refactors
Add explicit arch-specific modules.c rules to keep the build from
generating an incorrect common/modules.c.  Otherwise the pattern
rules would cascade such that it'd look for $arch/modules.o which
turned into common/modules.c which triggered the gen rule.

My local testing of this code didn't catch this bug because of how
Automake manages .Po (dependency files) in incremental builds -- it
was adding extra rules that override the pattern rules which caused
the build to generate correct modules.c files.  But when building
from a cold cache, the pattern rules would force common/modules.c to
be used leading to crashes at runtime.
2023-01-15 20:55:48 -05:00
Mike Frysinger
72be276fff sim: common: move modules.c to source tracking
This makes sure the arch-specific modules.c wildcard is matched and
not the common/%.c so that we compile it correctly.  It also makes
sure each subdir has depdir logic enabled.
2023-01-14 20:53:13 -05:00
Mike Frysinger
ee3134d028 sim: build: drop most recursive build deps
Now that we build these objects in the top dir & generate modules.c
there, we don't need to generate them all first -- we can let the
normal dependency graph take care of building things in parallel.
2023-01-14 20:50:36 -05:00
Mike Frysinger
eac2fbdc4b sim: common: move libcommon.a objects to sources
This simplifies the build logic and avoids an Automake bug where the
common_libcommon_a_OBJECTS variable isn't set in the arch libsim.a
DEPENDENCIES for targets that, alphabetically, come before "common".
We aren't affected by that bug with the current code, but as we move
things out of SIM_ALL_RECURSIVE_DEPS and rely on finer dependencies,
we will trip over it.
2023-01-14 20:48:49 -05:00
Mike Frysinger
068b723abc sim: build: drop AM_MAKEFLAGS settings
We don't have any recursive builds anymore, so we can drop this logic.
2023-01-14 20:41:24 -05:00
Mike Frysinger
6baf06097b sim: build: drop subdir Makefile.in files
These aren't used anymore, so punt them all.
2023-01-11 22:49:28 -05:00
Mike Frysinger
b36a89d135 sim: move arch-specific file compilation of common/ files to top-level 2023-01-10 01:15:29 -05:00
Mike Frysinger
1546cb4540 sim: mips: move arch-specific file compilation to top-level
The arch-specific compiler flags are duplicated, but they'll be cleaned
up once we move all subdir compiles to the top-level.
2023-01-10 01:15:28 -05:00
Mike Frysinger
e732fe9b4f sim: build: drop support for creating libsim.a in subdirs
Now that all ports have moved to creating libsim.a in the top-level,
drop all the support code to create it in a subdir.
2023-01-10 01:15:26 -05:00
Mike Frysinger
1f1afa43f5 sim: mips: move libsim.a creation to top-level
The objects are still compiled in the subdir, but the creation of the
archive itself is in the top-level.  This is a required step before we
can move compilation itself up, and makes it easier to review.

The downside is that each object compile is a recursive make instead of
a single one.  On my 4 core system, it adds ~100msec to the build per
port, so it's not great, but it shouldn't be a big deal.  This will go
away of course once the top-level compiles objects.

The mips code is a little more tricky than others because, for multi-run
targets, it generates the list of sources & objects on the fly in the
configure script.
2023-01-10 01:15:25 -05:00
Mike Frysinger
437eeee95c sim: modules: trigger generation from top-level
Add rules for tracking generated subdir modules.c files.  This doesn't
actually generate the file from the top-level, but allows us to add
rules that need to be ordered wrt it.  Once those changes land, we can
rework this to actually generate from the top-level.

This currently builds off of the objects that go into the libsim.a as
we don't build those from the top-level either.  Once we migrate that
up, we can switch this to the source files directly.  It's a bit hacky
overall, but makes it easier to migrate things in smaller chunks, and
we aren't going to keep this logic long term.
2023-01-10 01:15:23 -05:00
Mike Frysinger
ddfc4317d5 sim: mips: add multi source to built sources
The multirun generation mode is a bit of a mess as generated run files
depend on generate igen files, all with unknown names ahead of time.
In the multirun mode, be lazy and declare all of these generated source
files as built sources so they'll be created early on.
2023-01-04 22:51:07 -05:00
Mike Frysinger
80636a54bc sim: build: move generated headers to built sources
Automake's automatic header deptracking has a bootstrap problem where
it can't detect generated headers when compiling.  We've been handling
that by adding a custom SIM_ALL_RECURSIVE_DEPS variable, but that only
works when building objects recursively in subdirs.  As we move those
out to the top-level, we don't have any recursive steps anymore.  The
Automake approach is to declare those headers in BUILT_SOURCES.

This isn't completely foolproof as the Automake manual documents: it
only activates for `make all`, not `make foo.o`, but that shouldn't be
a huge limitation as it only affects the initial compile.  After that,
rebuilds should work fine.
2023-01-02 21:16:19 -05:00
Mike Frysinger
c217e3d54e sim: replace -I$srcroot/bfd include with -I$srcroot
Clean up includes a bit by making ports include bfd/ headers
explicitly.  This matches other projects, and makes it more clear
where these headers are coming from.
2023-01-01 23:17:07 -05:00
Mike Frysinger
0d9d77e506 sim: refresh copyright dates a bit
Update a few files that were missed, and revert the generated Automake
output that uses dates from Automake itself.
2023-01-01 15:09:19 -05:00
Joel Brobecker
213516ef31 Update copyright year range in header of all files managed by GDB
This commit is the result of running the gdb/copyright.py script,
which automated the update of the copyright year range for all
source files managed by the GDB project to be updated to include
year 2023.
2023-01-01 17:01:16 +04:00
Mike Frysinger
f12c3c632e sim: mips: hoist "multi" igen rules up to common builds
Since these are the last mips igen rules, we can clean up a number of
bits in the local Makefile.in.
2022-12-27 00:31:34 -05:00
Mike Frysinger
f6d58d4012 sim: mips: hoist "m16" igen rules up to common builds 2022-12-27 00:31:34 -05:00
Mike Frysinger
3a31051b3a sim: mips: hoist "single" igen rules up to common builds 2022-12-27 00:31:34 -05:00
Mike Frysinger
07f60ed831 sim: mips: rename "igen" generation mode to "single"
The naming in here has grown organically and is confusing to follow.
Originally there was only one set of rules for generating code from
the igen sources, so calling it "tmp-igen" and such made sense.  But
when other multigen modes were added ("m16" & "multi") which also
used igen, it's not clear what's common igen and what's specific to
this generation  mode.  So rename the set of rules from "igen" to
"single" so it's easier to follow.
2022-12-27 00:31:34 -05:00
Mike Frysinger
49d3ce6c2e sim: mips: hoist itable igen rules up to common builds
Since this rule is pretty simple, hoist it up to the common build.
2022-12-27 00:31:33 -05:00
Mike Frysinger
67c952d109 sim: mips: unify itable generation (a bit)
The m16 & multi targets generate itable once even when all the other
modules are generated multiple times.  The default igen target will
generate itable with everything else out of convenience.  This means
flags are passed which don't affect the generated itable there.

We can unify the itable generation by making sure the right -F/-M
filter variables are passed down.  Since there's already a dedicated
rule & variable in the multi build mode, generalize that and switch
the m16 & igen builds over too.

I spent a lot of time staring at this code, building for diff mips
targets, and exploring all the shell code paths.  I think this is
safe, but only time (and users) will really tell.
2022-12-27 00:31:33 -05:00
Mike Frysinger
4c45662c0f sim: mips: rename multi_flags to igen_itable_flags
This variable is only used to generate the itable files.  In preparation
for merging the itable logic among all ports, rename "multi_flags" to a
more appropriate "igen_itable_flags" variable.  There should be no real
chagnes here otherwise.
2022-12-27 00:31:33 -05:00
Mike Frysinger
556ca380d7 sim: mips: drop unused micromips igen logic
This code appears to be unused since it was first merged.  When
micromips was enabled, it was via the "MULTI" config, not the
"MICROMIPS" config, and the multi configs have sep vars.  Since
nothing sets SIM_MIPS_GEN=MICROMIPS in the config, all of this
should be unreachable, so punt it to simplify.  Further, the
SIM_MIPS_MICROMIPS16_FLAGS & SIM_MIPS_MICROMIPS_FLAGS settings
rely on sim_mips_micromips{,16}_{filter,machine} variables that
are never set in the configure script.
2022-12-27 00:31:33 -05:00
Mike Frysinger
edda128da7 sim: mips: move distclean settings to common build
This was missed when mips/configure was merged into the top-level.
2022-12-25 10:05:39 -05:00
Mike Frysinger
111b1cf97e sim: smp: plumb igen flag down to all users
While mips has respected sim_igen_smp at configure time (which was
always empty since it defaulted smp to off), no other igen port did.
Move this to a makefile variable and plumb it through the common
IGEN_RUN variable instead so everyone gets it by default.  We also
clean up some redundant -N0 setting with multirun mips.
2022-12-25 02:13:32 -05:00
Mike Frysinger
883be19774 sim: cpu: change default init to handle all cpus
All the runtimes were only initializing a single CPU.  When SMP is
enabled, things quickly crash as none of the other CPU structs are
setup.  Change the default from 0 to the compile time value.
2022-12-25 02:10:46 -05:00
Mike Frysinger
23ddbd2f2b sim: mips: clean up a bit after mips/configure removal
Now that there is no subdir configure script, we can clean up some
logic that was spread between the files.
2022-12-24 22:13:56 -05:00
Mike Frysinger
abc494c65d sim: mips: move igen settings to top-level configure
This is the last bit of logic that exists in the mips configure
script, so move it to the top-level configure to kill it off.
We still have to move the Makefile.in igen logic to local.mk,
but this is a required first step for that.
2022-12-24 22:13:13 -05:00
Mike Frysinger
fec5386aef sim: mips: namespace igen configure vars
To prepare moving this logic to the top-level configure, the vars
need to be namespaced.  Do that here to make it easier to review.
Basically sim_xxx -> SIM_MIPS_XXX when a var is exported from the
configure script to the Makefile, and sim_xxx -> sim_mips_xxx when
the var is internal in the configure script.
2022-12-24 21:41:22 -05:00
Mike Frysinger
a449d2c294 sim: mips: add igen recursive dep
Make sure the igen tool exists before trying to compile the mips
subdir.  This happens to work when mips has a subconfigure, but
hits a race condition when that is removed.
2022-12-24 21:39:09 -05:00
Mike Frysinger
d093438bdc sim: mips: drop unused ENGINE_ISSUE_POSTFIX_HOOK
Nothing defines this, and it isn't called in all the engine runtimes,
so drop it entirely to avoid confusion.
2022-12-24 21:37:59 -05:00
Mike Frysinger
3bef0f032c sim: igen: drop move-if-changed usage
Now that igen itself has this logic, drop these custom build rules
to greatly simplify.
2022-12-24 21:35:54 -05:00
Mike Frysinger
6cf3ddd23e sim: move bfd.h include out of sim-main.h
Not all arches include this in sim-main.h, and the ones that do don't
actually use bfd defines in the sim-main.h header.  Prune it to make
sim-main.h simpler so we can kill it off entirely in the future.

We add the include to the files that utilize e.g. bfd_vma though.
2022-12-22 22:06:12 -05:00
Mike Frysinger
3841a73a27 sim: mips: trim redundant igen settings
These variables are setting the same value as the defaults.  Trim
this redundant logic to make it easier to see the real differences
so we can try to keep unifying cases.
2022-12-22 21:29:21 -05:00
Mike Frysinger
022e1fb26c sim: mips: merge mips64* with existing multi-run build
Change the default (unhandled) mips64* targets to use the existing
mips64 multi-run build.  It already handles the formats, we just
have to list the mips8000 bfd for it.
2022-12-22 21:24:09 -05:00
Mike Frysinger
a54eee6db6 sim: mips: merge mips64vr5000 with existing multi-run build
The existing mips64vr-* multi-run build already handles mips5000
targets, so reuse that for mips64vr5* targets too.  This moves
more logic from build-time to runtime so we can have a single
binary that supports many targets.
2022-12-22 21:20:44 -05:00
Mike Frysinger
697e27f0ee sim: mips: switch from SIM_ADDR to address_word
The latter type matches the address size configured for this sim.

Also take the opportunity to simplify printf logic by leveraging
PRI* macros.
2022-12-22 20:10:13 -05:00
Mike Frysinger
2ac6aa431e sim: mips: merge mips64vr4300 with existing multi-run build
The existing mips64vr-* multi-run build already handles mips4300
targets, so reuse that for mips64vr43* targets too.  This moves
more logic from build-time to runtime so we can have a single
binary that supports many targets.
2022-12-22 19:04:23 -05:00
Mike Frysinger
2011a54779 sim: mips: match target on cpu settings
We don't need to enforce larger target settings when the only thing
the sim should care about is the CPU target.  So reduce most of the
target matches to only check the CPU.
2022-12-21 22:27:12 -05:00