Age | Commit message (Collapse) | Author | Files | Lines |
|
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.
|
|
Add conditional logic around fcntl.h F_{G,S}ETFL usage to fix builds
on systems that don't have it (e.g. Windows). The code is only used
to save & restore limited terminal stdin state.
|
|
Add conditional logic around termios.h usage to fix builds on systems
that don't have it (e.g. Windows).
|
|
This BSDism was never accepted into standards, so replace it with the
portable void* type instead.
|
|
|
|
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.
|
|
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.
|
|
This is needed when building for a target whose ar & ranlib are
incompatible with the current build system. For example, building
for Windows on a Linux system.
Then manually import the automake rule for libigen.a, but tweak the
tool variables to use the FOR_BUILD variants.
|
|
A lot of this code predates the bfd_vma format define, so we have a
random mix of casts to known types so we can printf the value. Use
the BFD_VMA_FMT that now exists to simplify and reliability output
across different build configs.
|
|
While libiberty provides a definition for this for systems that lack
the function (e.g. Windows), it doesn't provide a prototype. So add
our own local copy in the one file that uses the func.
|
|
Force this on for all ports. We have a few common models that can
be used, so make them generally available. If the port doesn't use
any hardware (the default), then behavior is unchanged.
|
|
This updates the sim so that it unconditionally uses sys/time.h. This
is in agreement with existing code, and a recent change to BFD.
I also think that sys/times.h is never needed by the sim, so this
patch removes the check and the one spot that was conditionally
including it.
sim/ChangeLog
2021-04-22 Tom Tromey <tom@tromey.com>
* m4/sim_ac_common.m4 (SIM_AC_COMMON): Don't check for sys/time.h
or sys/times.h.
sim/aarch64/ChangeLog
2021-04-22 Tom Tromey <tom@tromey.com>
* configure, config.in: Rebuild.
sim/arm/ChangeLog
2021-04-22 Tom Tromey <tom@tromey.com>
* configure, config.in: Rebuild.
sim/avr/ChangeLog
2021-04-22 Tom Tromey <tom@tromey.com>
* configure, config.in: Rebuild.
sim/bfin/ChangeLog
2021-04-22 Tom Tromey <tom@tromey.com>
* configure, config.in: Rebuild.
sim/bpf/ChangeLog
2021-04-22 Tom Tromey <tom@tromey.com>
* configure, config.in: Rebuild.
sim/common/ChangeLog
2021-04-22 Tom Tromey <tom@tromey.com>
* sim-utils.c: Update includes.
sim/cr16/ChangeLog
2021-04-22 Tom Tromey <tom@tromey.com>
* simops.c: Update includes.
* configure, config.in: Rebuild.
sim/cris/ChangeLog
2021-04-22 Tom Tromey <tom@tromey.com>
* rvdummy.c: Update includes.
* dv-rv.c: Update includes.
* configure, config.in: Rebuild.
sim/d10v/ChangeLog
2021-04-22 Tom Tromey <tom@tromey.com>
* configure, config.in: Rebuild.
sim/erc32/ChangeLog
2021-04-22 Tom Tromey <tom@tromey.com>
* configure, config.in: Rebuild.
sim/example-synacor/ChangeLog
2021-04-22 Tom Tromey <tom@tromey.com>
* configure, config.in: Rebuild.
sim/frv/ChangeLog
2021-04-22 Tom Tromey <tom@tromey.com>
* configure, config.in: Rebuild.
sim/ft32/ChangeLog
2021-04-22 Tom Tromey <tom@tromey.com>
* configure, config.in: Rebuild.
sim/h8300/ChangeLog
2021-04-22 Tom Tromey <tom@tromey.com>
* configure, config.in: Rebuild.
sim/iq2000/ChangeLog
2021-04-22 Tom Tromey <tom@tromey.com>
* configure, config.in: Rebuild.
sim/lm32/ChangeLog
2021-04-22 Tom Tromey <tom@tromey.com>
* configure, config.in: Rebuild.
sim/m32c/ChangeLog
2021-04-22 Tom Tromey <tom@tromey.com>
* configure, config.in: Rebuild.
sim/m32r/ChangeLog
2021-04-22 Tom Tromey <tom@tromey.com>
* configure, config.in: Rebuild.
sim/m68hc11/ChangeLog
2021-04-22 Tom Tromey <tom@tromey.com>
* configure, config.in: Rebuild.
sim/mcore/ChangeLog
2021-04-22 Tom Tromey <tom@tromey.com>
* configure, config.in: Rebuild.
sim/microblaze/ChangeLog
2021-04-22 Tom Tromey <tom@tromey.com>
* configure, config.in: Rebuild.
sim/mips/ChangeLog
2021-04-22 Tom Tromey <tom@tromey.com>
* configure, config.in: Rebuild.
sim/mn10300/ChangeLog
2021-04-22 Tom Tromey <tom@tromey.com>
* configure, config.in: Rebuild.
sim/moxie/ChangeLog
2021-04-22 Tom Tromey <tom@tromey.com>
* configure, config.in: Rebuild.
sim/msp430/ChangeLog
2021-04-22 Tom Tromey <tom@tromey.com>
* configure, config.in: Rebuild.
sim/or1k/ChangeLog
2021-04-22 Tom Tromey <tom@tromey.com>
* configure, config.in: Rebuild.
sim/ppc/ChangeLog
2021-04-22 Tom Tromey <tom@tromey.com>
* mon.c: Update includes.
* emul_unix.c: Update includes.
(do_unix_gettimeofday): Update condition.
sim/pru/ChangeLog
2021-04-22 Tom Tromey <tom@tromey.com>
* configure, config.in: Rebuild.
sim/riscv/ChangeLog
2021-04-22 Tom Tromey <tom@tromey.com>
* configure, config.in: Rebuild.
sim/rl78/ChangeLog
2021-04-22 Tom Tromey <tom@tromey.com>
* configure, config.in: Rebuild.
sim/rx/ChangeLog
2021-04-22 Tom Tromey <tom@tromey.com>
* configure, config.in: Rebuild.
sim/sh/ChangeLog
2021-04-22 Tom Tromey <tom@tromey.com>
* interp.c: Update includes.
* configure, config.in: Rebuild.
sim/v850/ChangeLog
2021-04-22 Tom Tromey <tom@tromey.com>
* configure, config.in: Rebuild.
|
|
GDB has required GNU make for quite some time, and this patch applies
this approach to the sim as well. Requiring GNU make means that
automatic dependency tracking can be simple and reliable, and it also
makes other refactorings simpler.
sim/ChangeLog
2021-04-22 Tom Tromey <tom@tromey.com>
* m4/sim_ac_common.m4 (SIM_AC_COMMON): Don't check for make.
sim/aarch64/ChangeLog
2021-04-22 Tom Tromey <tom@tromey.com>
* configure: Rebuild.
sim/arm/ChangeLog
2021-04-22 Tom Tromey <tom@tromey.com>
* configure: Rebuild.
sim/avr/ChangeLog
2021-04-22 Tom Tromey <tom@tromey.com>
* configure: Rebuild.
sim/bfin/ChangeLog
2021-04-22 Tom Tromey <tom@tromey.com>
* configure: Rebuild.
sim/common/ChangeLog
2021-04-22 Tom Tromey <tom@tromey.com>
* Make-common.in: Require GNU make.
sim/cr16/ChangeLog
2021-04-22 Tom Tromey <tom@tromey.com>
* configure: Rebuild.
sim/cris/ChangeLog
2021-04-22 Tom Tromey <tom@tromey.com>
* configure: Rebuild.
sim/d10v/ChangeLog
2021-04-22 Tom Tromey <tom@tromey.com>
* configure: Rebuild.
sim/erc32/ChangeLog
2021-04-22 Tom Tromey <tom@tromey.com>
* configure: Rebuild.
sim/example-synacor/ChangeLog
2021-04-22 Tom Tromey <tom@tromey.com>
* configure: Rebuild.
sim/frv/ChangeLog
2021-04-22 Tom Tromey <tom@tromey.com>
* configure: Rebuild.
sim/ft32/ChangeLog
2021-04-22 Tom Tromey <tom@tromey.com>
* configure: Rebuild.
sim/h8300/ChangeLog
2021-04-22 Tom Tromey <tom@tromey.com>
* configure: Rebuild.
sim/iq2000/ChangeLog
2021-04-22 Tom Tromey <tom@tromey.com>
* configure: Rebuild.
sim/lm32/ChangeLog
2021-04-22 Tom Tromey <tom@tromey.com>
* configure: Rebuild.
sim/m32c/ChangeLog
2021-04-22 Tom Tromey <tom@tromey.com>
* configure: Rebuild.
sim/m32r/ChangeLog
2021-04-22 Tom Tromey <tom@tromey.com>
* configure: Rebuild.
sim/m68hc11/ChangeLog
2021-04-22 Tom Tromey <tom@tromey.com>
* configure: Rebuild.
sim/mcore/ChangeLog
2021-04-22 Tom Tromey <tom@tromey.com>
* configure: Rebuild.
sim/microblaze/ChangeLog
2021-04-22 Tom Tromey <tom@tromey.com>
* configure: Rebuild.
sim/mips/ChangeLog
2021-04-22 Tom Tromey <tom@tromey.com>
* configure: Rebuild.
sim/mn10300/ChangeLog
2021-04-22 Tom Tromey <tom@tromey.com>
* configure: Rebuild.
sim/moxie/ChangeLog
2021-04-22 Tom Tromey <tom@tromey.com>
* configure: Rebuild.
sim/msp430/ChangeLog
2021-04-22 Tom Tromey <tom@tromey.com>
* configure: Rebuild.
sim/or1k/ChangeLog
2021-04-22 Tom Tromey <tom@tromey.com>
* configure: Rebuild.
sim/pru/ChangeLog
2021-04-22 Tom Tromey <tom@tromey.com>
* configure: Rebuild.
sim/riscv/ChangeLog
2021-04-22 Tom Tromey <tom@tromey.com>
* configure: Rebuild.
sim/rl78/ChangeLog
2021-04-22 Tom Tromey <tom@tromey.com>
* configure: Rebuild.
sim/rx/ChangeLog
2021-04-22 Tom Tromey <tom@tromey.com>
* configure: Rebuild.
sim/sh/ChangeLog
2021-04-22 Tom Tromey <tom@tromey.com>
* configure: Rebuild.
sim/v850/ChangeLog
2021-04-22 Tom Tromey <tom@tromey.com>
* configure: Rebuild.
|
|
My scripts weren't updated to use new -I../m4 as the first arg.
|
|
When building with clang, we get:
error: unknown warning option '-Wmissing-parameter-type' [-Werror,-Wunknown-warning-option]
This is because clang only warns by default when encountering an unknown
warning option, and the probe for supported warning flags is done
without -Werror. All flags are therefore accepted by configure, but
then it breaks when actually compiling a source file with -Werror.
This is equivalent to this commit in gdb:
3e019bdc20eb81b91ab5bc774386201b874c0bac
gdb: Use -Werror when checking for (un)supported warning flags
We then see some other compilation errors when building with clang and
-Werror, they can be dealt with later.
|
|
This avoids duplicate tests for headers between common m4, arches,
and any other sources that would trigger header tests.
|
|
This avoids duplicate tests for functions between common m4, arches,
and any other sources that would trigger func tests.
Also manually delete known duplicate function tests between the m4,
bfin, and v850 ports.
|
|
Add a READLINE_CFLAGS variable which adds the include path to the
in-tree readline when using the in-tree readline library.
sim/erc32/ChangeLog:
* Makefile.in (READLINE_SRC, READLINE_CFLAGS): Add.
(SIM_EXTRA_CFLAGS): Add READLINE_CFLAGS.
* configure: Rebuild.
* configure.ac (READLINE_CFLAGS): Add.
|
|
This updates various parts of the sim to include missing system
headers. I made the includes unconditional, because other parts of
the tree are already doing this.
2021-04-08 Tom Tromey <tom@tromey.com>
* traps.c: Include stdlib.h.
* cris-tmpl.c: Include stdlib.h.
sim/erc32/ChangeLog
2021-04-08 Tom Tromey <tom@tromey.com>
* func.c: Include sys/time.h.
sim/frv/ChangeLog
2021-04-08 Tom Tromey <tom@tromey.com>
* traps.c: Include stdlib.h.
* registers.c: Include stdlib.h.
* profile.c: Include stdlib.h.
* memory.c: Include stdlib.h.
* interrupts.c: Include stdlib.h.
* frv.c: Include stdlib.h.
* cache.c: Include stdlib.h.
sim/iq2000/ChangeLog
2021-04-08 Tom Tromey <tom@tromey.com>
* iq2000.c: Include stdlib.h.
sim/m32r/ChangeLog
2021-04-08 Tom Tromey <tom@tromey.com>
* traps.c: Include stdlib.h.
* m32r.c: Include stdlib.h.
sim/ppc/ChangeLog
2021-04-08 Tom Tromey <tom@tromey.com>
* emul_unix.c: Include time.h.
|
|
This changes all the non-generated (hand-written) code in sim to use
"new" (post-K&R) style function definitions.
2021-04-08 Tom Tromey <tom@tromey.com>
* bpf.c (bpf_def_model_init): Use new-style declaration.
sim/common/ChangeLog
2021-04-08 Tom Tromey <tom@tromey.com>
* cgen-utils.c (RORQI, ROLQI, RORHI, ROLHI, RORSI, ROLSI): Use
new-style declaration.
sim/erc32/ChangeLog
2021-04-08 Tom Tromey <tom@tromey.com>
* sis.c (run_sim, main): Use new-style declaration.
* interf.c (run_sim, sim_open, sim_close, sim_load)
(sim_create_inferior, sim_store_register, sim_fetch_register)
(sim_info, sim_stop_reason, flush_windows, sim_do_command): Use
new-style declaration.
* help.c (usage, gen_help): Use new-style declaration.
* func.c (batch, set_regi, set_rega, disp_reg, limcalc)
(reset_stat, show_stat, init_bpt, int_handler, init_signals)
(disp_fpu, disp_regs, disp_ctrl, disp_mem, dis_mem, event)
(init_event, set_int, advance_time, now, wait_for_irq, check_bpt)
(reset_all, sys_reset, sys_halt): Use new-style declaration.
* float.c (get_accex, clear_accex, set_fsr): Use new-style
declaration.
* exec.c (sub_cc, add_cc, log_cc, dispatch_instruction, fpexec)
(chk_asi, execute_trap, check_interrupts, init_regs): Use
new-style declaration.
* erc32.c (init_sim, reset, decode_ersr, mecparerror)
(error_mode, decode_memcfg, decode_wcr, decode_mcr, sim_halt)
(close_port, exit_sim, mec_reset, mec_intack, chk_irq, mec_irq)
(set_sfsr, mec_read, mec_write, init_stdio, restore_stdio)
(port_init, read_uart, write_uart, flush_uart, uarta_tx)
(uartb_tx, uart_rx, uart_intr, uart_irq_start, wdog_intr)
(wdog_start, rtc_intr, rtc_start, rtc_counter_read)
(rtc_scaler_set, rtc_reload_set, gpt_intr, gpt_start)
(gpt_counter_read, gpt_scaler_set, gpt_reload_set, timer_ctrl)
(memory_read, memory_write, get_mem_ptr, sis_memory_write)
(sis_memory_read): Use new-style declaration.
sim/frv/ChangeLog
2021-04-08 Tom Tromey <tom@tromey.com>
* sim-if.c (sim_open, frv_sim_close, sim_create_inferior): Use
new-style declaration.
sim/h8300/ChangeLog
2021-04-08 Tom Tromey <tom@tromey.com>
* compile.c (cmdline_location): Use new-style declaration.
sim/iq2000/ChangeLog
2021-04-08 Tom Tromey <tom@tromey.com>
* sim-if.c (sim_open, sim_create_inferior): Use new-style
declaration.
* iq2000.c (fetch_str): Use new-style declaration.
sim/lm32/ChangeLog
2021-04-08 Tom Tromey <tom@tromey.com>
* sim-if.c (sim_open, sim_create_inferior): Use new-style
declaration.
sim/m32r/ChangeLog
2021-04-08 Tom Tromey <tom@tromey.com>
* sim-if.c (sim_open, sim_create_inferior): Use new-style
declaration.
|
|
sim/erc32 uses an obsolete path to the in-tree build of readline.
readline was moved into a subdirectory some time ago. This patch
fixes the problem. Tested by rebuilding.
sim/erc32/ChangeLog
2021-04-05 Tom Tromey <tromey@adacore.com>
* configure: Rebuild.
* configure.ac (READLINE): Adjust in-tree value.
|
|
The toplevel, common, and igen dirs all have their own code for
setting up toolchain settings. Unify all of that in a new macro.
|
|
Some sim dirs were already setting up CFLAGS_FOR_BUILD in inconsistent
ways. Move it to a common place for reuse.
|
|
Rather than require $AR be set and then default to `ar`, use the
standard AC_CHECK_TOOL helper to find a good prefixed tool. In
practice this shouldn't change much as we seem to have macros in
the tree that were already setting it up, but we shouldn't rely
on that implicitly.
|
|
All the scripts were using this implicitly already, so there's no real
change for them, but we want to call it explicitly as the CPP tool is
used to generate nltvals.def.
|
|
We don't need a variable to add a dependency to the "all" target, and
having one doesn't really add value. Switch to the target directly for
the few ports that actually use this.
|
|
This file is quite large and is getting unmanageable. Split it apart
to follow aclocal best practices by putting one-macro-per-file. There
shouldn't be any real functional changes here as can be seen in the
configure script regens.
|
|
Rather than hand maintain m4 includes in various autotool files,
use AC_CONFIG_MACRO_DIRS to declare the relevant search paths.
This simplifies the code, makes it more robust, and cleans out
unused logic from configure.
|
|
These ports don't use the common sim core, so they weren't providing
a sim_memory_map for gdb, so they failed to link with the new memory
map logic added for the sim. Add stubs to fix.
|
|
The AC_CONFIG_HEADER macro is long deprecated, so switch to the
newer form. This also gets rid of the position limitation, and
drops support for an argument to SIM_AC_COMMON which we haven't
used anywhere.
|