aboutsummaryrefslogtreecommitdiff
path: root/sim/m4
AgeCommit message (Collapse)AuthorFilesLines
2024-01-08sim: warnings: compile build tools with -Werror tooMike Frysinger1-0/+29
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: 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-1/+1
This brings us in sync with current set of gdb warnings (for C).
2024-01-02sim: ppc: move termios probes to top-levelMike Frysinger1-0/+69
This is the last compile-time logic in the ppc subdir.
2024-01-02sim: ppc: move struct statfs to top-levelMike Frysinger1-0/+24
2024-01-02sim: ppc: move long long test to top-levelMike Frysinger1-0/+1
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-0/+55
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-21/+45
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: signal: mark signal callback funcs as noreturn since they don't returnMike Frysinger1-0/+1
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-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/+3
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/+22
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-8/+33
This fixes testing of -Wno flags, and adds some more portable ones.
2023-12-04sim: warnings: enable only for development buildsMike Frysinger1-2/+2
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-01-16sim: assume sys/stat.h always exists (via gnulib)Mike Frysinger1-4/+1
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-1/+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-1/+0
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-05sim: Move getopt checking inside SIM_AC_PLATFORMTsukasa OI1-0/+14
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-01sim: drop mention of & support for subdir configureMike Frysinger2-57/+0
Now that no ports use these common configure APIs, delete the logic and remove it from the documentation.
2023-01-01Update copyright year range in header of all files managed by GDBJoel Brobecker21-21/+21
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.
2022-12-25sim: smp: plumb igen flag down to all usersMike Frysinger1-1/+2
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-25sim: smp: make option available againMike Frysinger1-6/+12
At some point we want this to work, but it's not easy to test if the configure option isn't available. Restore it, but keep the default off.
2022-11-10sim: restore lstat & mkdir func checksMike Frysinger1-0/+2
When merging ppc configure checks into the top-level, these 2 funcs were accidentally dropped (probably due to incorrect resolution of conflicts). Restore them since the ppc code utilizes them both.
2022-11-05sim: fix readline linkageMike Frysinger1-1/+1
Now that we link programs in the top dir instead of the arch subdir, update the readline library path to be relative to the top dir.
2022-11-05sim: adjust sim_hw options styleMike Frysinger1-2/+4
We use uppercase for other variables, and are already turning it to uppercase in the arch-subdir.mk, so convert it in the configure step.
2022-11-04sim: don't hardcode -ldl for SDL supportMike Frysinger1-4/+8
Since we use AC_SEARCH_LIBS to find dlopen, we don't need to hardcode -ldl when using SDL ourselves.
2022-11-04sim: build: change AC_CHECK_LIB to AC_SEARCH_LIBSMike Frysinger1-5/+5
With more C libraries moving functions entirely into the main -lc, change the AC_CHECK_LIB calls to AC_SEARCH_LIBS so we look in there first and avoid extra linkage when possible.
2022-11-04sim: build: switch to bfd & opcodes libtool linker scriptsMike Frysinger1-15/+1
Now that we use libtool to link, we don't need to duplicate all the libs that bfd itself uses. This simplifies the configure & Makefile.
2022-11-02sim: split CPPFLAGS between build & hostMike Frysinger1-0/+3
In order to merge more common/ files into the top-level, we need to add more host flags to CPPFLAGS, and that conflicts with our current use with build-time tools. So split them apart like we do with all other build flags to avoid the issue.
2022-09-27sim: Link ZSTD_LIBSFangrui Song1-0/+1
This fixes linker errors in a `../../configure --enable-targets --enable-sim; make all-gdb` build.
2022-02-21sim: gdbinit: hoist setup to common codeMike Frysinger1-7/+0
This was left in subdirs because of the dynamic cgen usage. However, we can move this breakpoint call to runtime and let gdb detect whether the symbol exists.
2022-02-14sim: Fix use of out-of-tree assembler and linker when testingHans-Peter Nilsson1-7/+14
With commit 7a259895bb2d "sim: testsuite: expand arch specific toolchain settings", trying to use out-of-tree ld and as at test-time broke for the "primary target", like when testing a release-tarball. Subsequent to that commit, all assembler tests without in-tree-built tools FAIL, getting errors when trying to call $(abs_builddir)/../gas/as-new. But, that isn't the actual culprint; it's actually it's its immediate predecessor, commit 8996c21067373 "sim: testsuite: setup per-port toolchain settings for multitarget build", which hardcodes in-tree-paths to those tools instead of considering e.g. $(<X>_FOR_TARGET), the preferred overridable variable for single-target builds, as set up by the toplevel Makefile. This commit calls GCC_TARGET_TOOL (a deceptive name; gcc-specific features aren't used) from toplev/config/acx.m4, somewhat like calls in toplev/configure.ac but without the NCN_STRICT_CHECK_TARGET_TOOLS step, for each X to find a value for $(<X>_FOR_TARGET). N.B.: in-tree tools still override any ${target}-${tool} found in $PATH, i.e. only previously broken builds are affected. The variables $(<X>_FOR_TARGET) are usually overridden by the toplevel Makefile to the same value or better, but has to be set here too, as automake "wants" Makefiles to be self-contained (you get an error pointing out that the variable may be empty). If it hadn't been for that, SIM_AC_CHECK_TOOLCHAIN_FOR_PRIMARY_TARGET would not be needed. This detail should only (positively) affect users invoking "make check" in sim/ instead of "make check-sim" (or "make check") at the toplevel. Now the output from "configure" matches the target tools actually used by sim at test-time, for the "primary target". Using $(CC) for "example-" targets CC_FOR_TARGET is not changed, as that appears to be a deliberate special-case. Note that all tools still have to be installed and present in $PATH at configure-time to be properly used at test-time. sim: * m4/sim_ac_toolchain.m4 (SIM_AC_CHECK_TOOLCHAIN_FOR_PRIMARY_TARGET): New defun. (SIM_TOOLCHAIN_VARS): Call it using AC_REQUIRE, and use variables AS_FOR_TARGET, LD_FOR_TARGET and CC_FOR_TARGET instead of hard-coded values. * Makefile.in, configure: Regenerate.
2022-01-01sim: tweak copyright lines for gnulib update-copyrightMike Frysinger21-21/+21
The regex it uses does not like so many leading spaces which causes it to think the files lack copyright. Trim them down so the script can find & update them accordingly.
2021-11-28sim: testsuite: setup per-port toolchain settings for multitarget buildMike Frysinger1-0/+25
Gas does not support multitarget builds -- it still only supports a single input & output format. ld is a bit better, but requires manual flags to select the right output. This makes it impossible to run the complete testsuite in a multitarget build. To address this limitation, create a suite of FOR_TARGET variables so these can be set to precompiled as & ld programs. It requires a bit of setup ahead of time, but it's a one-time cost, and makes running the full testsuite at once much easier.
2021-09-13sim: bfin: add support for SDL2Mike Frysinger1-5/+14
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-09sim: dv-sockser: enable for mingw targets tooMike Frysinger1-10/+5
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-07-01sim: unify reserved instruction bits settingsMike Frysinger2-11/+13
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-06-30sim: unify scache settingsMike Frysinger2-15/+10
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-30sim: move default model to the runtime sim stateMike Frysinger2-32/+0
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-29sim: use -Wunused-but-set-parameterMike Frysinger1-6/+10
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-29sim: use -Wno-error=maybe-uninitializedMike Frysinger1-0/+3
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-27sim: erc32: merge with common configure scriptMike Frysinger1-0/+28
Move the unique library tests to the common code so we can delete the erc32 configure logic entirely.