aboutsummaryrefslogtreecommitdiff
path: root/sim/configure
AgeCommit message (Collapse)AuthorFilesLines
2024-01-23sim: sh: fix nested braces in struct initMike Frysinger1-1/+0
The op struct includes an array of strings, but doesn't use braces around that array when initializing. This causes a ton of warnings when using -Wmissing-braces. Add them to fix. The code this tool generates is the same before & after.
2024-01-10sim: m32r: fixup some of the int<->pointer castsMike Frysinger1-3/+36
The m32r trap code was written for a 32-bit Linux host (and really, one whose Linux ABI matched pretty exactly). This has lead to conversions between integers and pointers which breaks down hard on 64-bit hosts. Clean up some of the functions where possible to avoid unnecessary conversions, use uintptr_t to cast 32-bit target pointers to host pointers in some places, and just stub out a few functions that can't easily be salvaged currently when sizeof(void*) is not 32-bits. This is a bit ugly, but lets us enable warnings for the whole file.
2024-01-10gdbsupport: tighten up libiberty code a bit with dnlMike Frysinger1-4/+1
No functional change here, just touch up generated output slightly. Approved-By: Tom Tromey <tom@tromey.com>
2024-01-10sim: build: switch to gdbsupport/libiberty.m4Mike Frysinger1-12/+361
Leverage this common logic to find all the libiberty settings rather than duplicate it ourselves.
2024-01-08sim: warnings: compile build tools with -Werror tooMike Frysinger1-3/+67
Add support for compiling build tools with various -Werror settings. Since the tools don't compile cleanly with the same set of flags as the rest of the sim code, we need to maintain & test a separate list. Only bother when not cross-compiling so we don't have to test all the flags against the build compiler. This should be good enough for our actual development flows.
2024-01-08sim: mips: drop old clean workaroundMike Frysinger1-2/+1
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-08sim: warnings: enable -Wshift-negative-valueMike Frysinger1-0/+1
Now that all the relevant sources are fixed, enable the warning.
2024-01-06sim: warnings: enable -Wshadow=localMike Frysinger1-0/+1
This brings us in sync with current set of gdb warnings (for C).
2024-01-03sim: configure: switch to m4_mapMike Frysinger1-60/+30
Minor reduction in boilerplate here. No real functional changes.
2024-01-03sim: drop support for recursive makes entirelyMike Frysinger1-34/+1
Now that all ports have been merged to the top-level, we no longer need this framework to pass settings down to sub-makefiles. Delete it all.
2024-01-03sim: ppc: hoist compilation up to top-levelMike Frysinger1-3/+0
This removes all recursive makes from the ppc port.
2024-01-03sim: drop support for automatic subdir recursionMike Frysinger1-6/+2
No port relies on this anymore, so we can scrub it all.
2024-01-03sim: ppc: move libsim.a creation to top-levelMike Frysinger1-1/+0
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. It adds some overhead, so it's not great, but it shouldn't be a big deal. This will go away once compilation is hoisted up.
2024-01-02sim: ppc: merge configure logic into top-levelMike Frysinger1-153/+418
Now that the ppc configure script is just namespaced options, we can move it to ppc/acinclude.m4 and include it directly in the top-level configure script and kill off the last subdir configure script.
2024-01-02sim: ppc: move termios probes to top-levelMike Frysinger1-2/+136
This is the last compile-time logic in the ppc subdir.
2024-01-02sim: ppc: move struct statfs to top-levelMike Frysinger1-2/+49
2024-01-02sim: ppc: move long long test to top-levelMike Frysinger1-2/+12
While the sim code doesn't utilize HAVE_LONG_LONG itself, other code (like libiberty) seem to, so check for it in the top-level for all ports to leverage.
2024-01-02sim: ppc: hoist sysv tests to top-levelMike Frysinger1-2/+130
Now that the sysv tests turn into config.h defines and everything checks that, we can move the tests to the top-level and out of the ppc subdir.
2024-01-01sim: warnings: enable -Wunused-variableMike Frysinger1-1/+1
2023-12-23sim: warnings: rework individual flag disable into dedicated varsMike Frysinger1-23/+104
The -Wshadow=local is too new for some compilers, so move it to a var that we test at configure time.
2023-12-21sim: warnings: enable -Wreturn-typeMike Frysinger1-0/+1
Older versions of gcc support this warning flag. We're already clean.
2023-12-21sim: warnings: fix -Wreturn-mismatch typoMike Frysinger1-1/+1
2023-12-21sim: warnings: enable -Wimplicit-fallthrough=5Mike Frysinger1-0/+1
It caught some legitimate bugs, so clearly it's helpful.
2023-12-21sim: warnings: enable -Wduplicated-condMike Frysinger1-0/+1
2023-12-17sim: warnings: add more flagsMike Frysinger1-0/+3
We already build cleanly with these.
2023-12-15sim: warnings: enable -Wunused-but-set-variableMike Frysinger1-1/+1
2023-12-07sim: warnings: disable -Wenum-conversion fow now [PR sim/29752]Mike Frysinger1-0/+1
The cgen code mixes virtual insn enums with insn enums, and there isn't an obvious (to me) way to unravel this atm, so disable the warning. sim/lm32/decode.c:45:5: error: implicit conversion from enumeration type 'CGEN_INSN_VIRTUAL_TYPE' to different enumeration type 'CGEN_INSN_TYPE' (aka 'enum cgen_insn_type') [-Werror,-Wenum-conversion] 45 | { VIRTUAL_INSN_X_INVALID, LM32BF_INSN_X_INVALID, LM32BF_SFMT_EMPTY }, | ~ ^~~~~~~~~~~~~~~~~~~~~~ Bug: https://sourceware.org/PR29752
2023-12-06sim: support dlopen in -lcMike Frysinger1-1/+1
Stop assuming that dlopen is only available via -ldl. Newer versions of glibc have merged it into -lc which broke this configure test.
2023-12-06sim: warnings: add more flagsMike Frysinger1-4/+15
Sync with the list of flags from gdbsupport, and add a few more of our own to catch recent issues. Comment out the C++-specific flags as we don't build with C++.
2023-12-05sim: warnings: sync some build logic from gdbsupportMike Frysinger1-7/+32
This fixes testing of -Wno flags, and adds some more portable ones.
2023-12-04sim: warnings: enable only for development buildsMike Frysinger1-3/+5
Reuse the bfd/development.sh script like most other project to determine whether the current source tree is a dev build (e.g. git) or a release build, and disable the warnings for releases.
2023-08-19sim --enable-cgen-maintAlan Modra1-0/+3
I had reason yesterday to want to regenerate configury files which I do with --enable-maintainer-mode, and added --enable-cgen-maint accidentally. The first problem I hit is that sim looks for cgen in a different directory by default than opcodes, and I had my source layout set up for opcodes rather than sim. Fix that by making both use ../cgen first, then ../../cgen relative to sim/ and opcodes/. The next problem was that various sim local.mk files expected generated sources in the build dir rather than the source dir. Fix that by adding $(srcdir) to paths. Finally, the generated iq2000 files had a compile error, fixed by the cpu/iq2000.cpu patch. cpu/ * iq2000.cpu (syscall): Add pc arg. opcodes/ * configure.ac (cgendir): Default to ../../cgen, but use ../cgen if found there. * configure: Regenerate. sim/m4/ * sim_ac_option_cgen_maint.m4 (cgendir): Look in ../cgen too. sim/ * cris/local.mk: Add $(srcdir) to paths for regenerated source. * frv/local.mk: Likewise. * iq2000/local.mk: Likewise. * lm32/local.mk: Likewise. * m32r/local.mk: Likewise. * or1k/local.mk: Likewise. * Makefile.in: Regenerate. * configure: Regenerate.
2023-08-12regen configAlan Modra1-21/+52
This regenerates config files changed by the previous 44 commits. Note that subject lines in these commits mostly match the gcc git originating commit.
2023-01-16sim: assume sys/stat.h always exists (via gnulib)Mike Frysinger1-31/+2
We have many uses of sys/stat.h that are unprotected by HAVE_SYS_STAT_H, so this is more formalizing the reality that we require this header. Since we switched to gnulib, it guarantees that a sys/stat.h exists for us to include, so we're doubly OK.
2023-01-16sim: formally assume unistd.h always exists (via gnulib)Mike Frysinger1-5/+2
We have many uses of unistd.h that are unprotected by HAVE_UNISTD_H, so this is more formalizing the reality that we require this header. Since we switched to gnulib, it guarantees that a unistd.h exists for us to include, so we're doubly OK.
2023-01-16sim: build: stop probing system extensions (ourselves)Mike Frysinger1-156/+3
This logic was added in order to expose the strsignal prototype for nrun.c. Since then, we've migrated to gnulib as our portability layer, and it takes care of probing system extensions for us, so there's no need to duplicate the work.
2023-01-15sim: igen: simplify build logic a littleMike Frysinger1-48/+2
Now that all ports (that use igen) build in the top-level and depend on igen, we can move the conditional logic out of configure. We also switch from noinst_LIBRARIES to EXTRA_LIBRARIES so that the library is only built when needed (i.e. the igen tool is used).
2023-01-14sim: build: drop depdir subdir hackMike Frysinger1-160/+0
Now that all the ports compile some C files in their arch dirs, Automake guarantees creating the depdir for us, so we can drop our configure hack.
2023-01-13sim: build: delete Make-common.in logicMike Frysinger1-14/+2
Now that all (other than ppc) build in the top-level, this logic is unused, so punt it all.
2023-01-10sim: disable recursive make in (most) subdirsMike Frysinger1-598/+2
Now that all (other than ppc) build in the top-level, we can disable the recursive make calls to them. This speeds things up nicely.
2023-01-10sim: mips: move libsim.a creation to top-levelMike Frysinger1-10/+10
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-05sim: Move getopt checking inside SIM_AC_PLATFORMTsukasa OI1-32/+32
This commit moves getopt declaration checker originally in sim/ configure.ac; added in commit 340aa4f6872c ("sim: Check known getopt definition existence") to sim/m4/sim_ac_platform.m4 (inside the SIM_AC_PLATFORM macro). It also regenerates configuration files using the maintainer mode.
2023-01-02sim: build: add var for tracking sim enable directlyMike Frysinger1-33/+66
Rather than rely on SIM_SUBDIRS being set, add a dedicated variable to track whether to enable the sim. While the current code works fine, it won't work as we remove the recursive make logic (i.e. the SIM_SUBDIRS variable).
2023-01-02sim: build: use Automake include varsMike Frysinger1-6/+2
Rather than define our own hack for emitting an include statement, use the existing Automake include variables. These have the nice side-effect of being more portable.
2023-01-01sim: replace -I$srcroot/bfd include with -I$srcrootMike Frysinger1-2/+2
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-01sim: refresh copyright dates a bitMike Frysinger1-1/+1
Update a few files that were missed, and revert the generated Automake output that uses dates from Automake itself.
2022-12-27sim: mips: hoist "multi" igen rules up to common buildsMike Frysinger1-2/+16
Since these are the last mips igen rules, we can clean up a number of bits in the local Makefile.in.
2022-12-27sim: mips: hoist "m16" igen rules up to common buildsMike Frysinger1-2/+16
2022-12-27sim: mips: hoist "single" igen rules up to common buildsMike Frysinger1-2/+16
2022-12-27sim: mips: rename "igen" generation mode to "single"Mike Frysinger1-25/+25
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.