aboutsummaryrefslogtreecommitdiff
path: root/sim/config.h.in
AgeCommit message (Collapse)AuthorFilesLines
2024-01-10sim: m32r: fixup some of the int<->pointer castsMike Frysinger1-0/+3
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-10sim: build: switch to gdbsupport/libiberty.m4Mike Frysinger1-0/+46
Leverage this common logic to find all the libiberty settings rather than duplicate it ourselves.
2024-01-02sim: ppc: move termios probes to top-levelMike Frysinger1-0/+12
This is the last compile-time logic in the ppc subdir.
2024-01-02sim: ppc: move struct statfs to top-levelMike Frysinger1-0/+3
2024-01-02sim: ppc: move long long test to top-levelMike Frysinger1-0/+3
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/+9
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.
2023-01-16sim: build: stop probing system extensions (ourselves)Mike Frysinger1-32/+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.
2022-12-25sim: smp: make option available againMike Frysinger1-0/+3
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/+6
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-04sim: build: change AC_CHECK_LIB to AC_SEARCH_LIBSMike Frysinger1-12/+0
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-10/+0
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-10-11sim: Check known getopt definition existenceTsukasa OI1-0/+3
Clang generates a warning if there is a function declaration/definition with zero arguments. Such declarations/definitions without a prototype (an argument list) are deprecated forms of indefinite arguments ("-Wdeprecated-non-prototype"). On the default configuration, it causes a build failure (unless "--disable-werror" is specified). include/getopt.h defines some getopt function definitions but one of them has a form "extern int getopt ();". If this form is selected in include/getopt.h, Clang generates a warning and the build fails by default. In really old environments, this getopt definition with no arguments is necessary (because the definition may change between environments). However, this definition is now a cause of problems on modern environments. A good news is, this definition is not always selected (e.g. if used by binutils/*.c). This is because configuration scripts of binutils, gas, gprof and ld tries to find known definition of getopt function is used and defines HAVE_DECL_GETOPT macro. If this macro is defined when getopt.h is included, a good form of getopt is used and Clang won't generate warnings. This commit adds a modified portion of ld/configure.ac to find the known getopt definition. If we could find one (and we *will* in most modern environments), we don't need to rely on the deprecated definition.
2022-09-27sim: Link ZSTD_LIBSFangrui Song1-0/+3
This fixes linker errors in a `../../configure --enable-targets --enable-sim; make all-gdb` build.
2021-09-13sim: bfin: add support for SDL2Mike Frysinger1-0/+3
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-07-01sim: unify reserved instruction bits settingsMike Frysinger1-0/+3
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 Frysinger1-0/+3
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-19sim: unify gettext/intl probing logicMike Frysinger1-0/+4
Move these options up to the common dir so we only test & export them once across all ports.
2021-06-19sim: unify bfd library dependency testing logicMike Frysinger1-0/+7
Move these options up to the common dir so we only test & export them once across all ports.
2021-06-19sim: unify various library testing logicMike Frysinger1-0/+9
Move these options up to the common dir so we only test & export them once across all ports.
2021-06-17sim: overhaul & unify endian settings managementMike Frysinger1-0/+3
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.
2021-06-12sim: assume sys/select.h always existsMike Frysinger1-3/+0
Now that gnulib provides this, assume it exists.
2021-06-12sim: overhaul alignment settings managementMike Frysinger1-0/+3
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.
2021-06-12sim: unify bug & package settingsMike Frysinger1-0/+6
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.
2021-06-12sim: unify debug/stdio/trace/profile build settingsMike Frysinger1-0/+18
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.
2021-06-12sim: ppc: unify header & function & type tests tooMike Frysinger1-2/+186
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.
2021-06-12sim: unify environment build settingsMike Frysinger1-0/+3
Move the --sim-enable-environment option up to the common dir so we only test & export it once across all ports.
2021-06-12sim: unify assert build settingsMike Frysinger1-0/+3
Move the --sim-enable-assert option up to the common dir so we only test & export it once across all ports.
2021-06-12sim: unify platform function & header testsMike Frysinger1-0/+282
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.