Commit Graph

54 Commits

Author SHA1 Message Date
Mike Frysinger
d73f39ee43 sim: move sim-inline to the common code
This will allow us to build the common code with the same inline
settings as the arch subdirs, and only do the test once.
2021-06-20 00:12:11 -04:00
Mike Frysinger
ce3ec98acd sim: unify gettext/intl probing logic
Move these options up to the common dir so we only test & export
them once across all ports.
2021-06-19 16:18:07 -04:00
Mike Frysinger
bc56166f66 sim: unify toolchain dependency logic
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.
2021-06-19 16:07:31 -04:00
Mike Frysinger
d3562f83a7 sim: unify toolchain probing logic
Move these options up to the common dir so we only test & export
them once across all ports.
2021-06-19 16:01:37 -04:00
Mike Frysinger
b5689863bd sim: unify bfd library dependency testing logic
Move these options up to the common dir so we only test & export
them once across all ports.
2021-06-19 01:08:39 -04:00
Mike Frysinger
07490bf81d sim: unify various library testing logic
Move these options up to the common dir so we only test & export
them once across all ports.
2021-06-19 01:01:21 -04:00
Mike Frysinger
47ce766a8b sim: unify -Werror build settings
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.
2021-06-18 10:25:04 -04:00
Mike Frysinger
982c3a65ca sim: move -Werror disabling to Makefile
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.
2021-06-18 10:15:15 -04:00
Mike Frysinger
1fef66b0dc sim: split sim-signal.h include out
The sim-basics.h is too big and includes too many things.  This leads
to some arch's sim-main.h having circular loop issues with defs, and
makes it hard to separate out common objects from arch-specific defs.
By splitting up sim-basics.h and killing off sim-main.h, it'll make
it easier to separate out the two.
2021-06-18 00:50:14 -04:00
Mike Frysinger
f9a4d54332 sim: overhaul & unify endian settings management
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-17 23:20:13 -04:00
Mike Frysinger
a8a3d90792 sim: drop obsolete AC_EXEEXT call
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.
2021-06-16 01:29:41 -04:00
Mike Frysinger
52d37d2c91 sim: drop arch-specific config.h
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.
2021-06-16 00:22:53 -04:00
Mike Frysinger
bcaa61f7c8 sim: move dv-sockser define to CPPFLAGS
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.
2021-06-15 23:27:14 -04:00
Mike Frysinger
82e6d6bf90 sim: drop redundant SIM_AC_OPTION_WARNINGS
The common code already calls this, so no need to do so in arch dirs.
We leave the calls that disable -Werror.  This will help unify the
configure scripts.
2021-06-14 23:19:52 -04:00
Mike Frysinger
ba307cddcf sim: overhaul alignment settings management
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-12 21:14:50 -04:00
Mike Frysinger
6dd65fc048 sim: unify bug & package settings
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-12 20:24:08 -04:00
Mike Frysinger
04381273a9 sim: unify debug/stdio/trace/profile build settings
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-12 20:07:57 -04:00
Mike Frysinger
5ea4547402 sim: unify environment build settings
Move the --sim-enable-environment option up to the common dir so we
only test & export it once across all ports.
2021-06-12 11:01:57 -04:00
Mike Frysinger
dba333c1e4 sim: unify assert build settings
Move the --sim-enable-assert option up to the common dir so we only
test & export it once across all ports.
2021-06-12 10:58:22 -04:00
Mike Frysinger
b15c5d7a51 sim: unify platform function & header tests
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.
2021-06-12 10:45:36 -04:00
Mike Frysinger
f4fdd84587 sim: fully merge sim_state_base into sim_state
Now that all ports have migrated to the new framework, drop support
for the old sim_state_base layout.
2021-05-17 01:05:08 -04:00
Mike Frysinger
383861bd08 sim: invert sim_state storage
Currently all ports have to declare sim_state themselves in their
sim-main.h and then embed the common sim_state_base & sim_cpu in it.
This dynamic makes it impossible to share common object code among
multiple ports because the core data structure is always different.

Let's invert this relationship: common code declares sim_state, and
if the port actually needs state on a per-instance basis, it can use
the new arch_data field for it.  Most ports don't actually use it,
so they don't need to declare anything at all.

This is the first in a series of changes: it adds a define to select
between the old & new layouts, then converts all the ports that don't
need custom state over to the new layout.
2021-05-17 00:42:55 -04:00
Mike Frysinger
6df01ab8ab sim: switch config.h usage to defs.h
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.
2021-05-16 22:38:41 -04:00
Mike Frysinger
79633c125e sim: riscv: move __int128 check to configure 2021-05-16 00:04:17 -04:00
Mike Frysinger
df68e12b3b sim: create header namespace
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.
2021-05-14 00:41:05 -04:00
Mike Frysinger
aa0fca163e sim: add support for build-time ar & ranlib
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.
2021-05-04 08:22:07 -04:00
Mike Frysinger
fe34861780 sim: nrun: add local strsignal prototype
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.
2021-05-01 16:37:39 -04:00
Mike Frysinger
bd0918c910 sim: nltvals: unify common syscall tables
Since libgloss provides a default syscall table for arches, use that
to provide the default syscall table for ports.  Only the exceptions
need to be enumerated now with the common logic as the default.
2021-04-26 22:39:55 -04:00
Mike Frysinger
66d055c754 sim: enable hardware support by default
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.
2021-04-26 22:30:55 -04:00
Tom Tromey
19f6a43c6c Do not check for sys/time.h or sys/times.h
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.
2021-04-22 19:51:55 -06:00
Tom Tromey
efd82ac7cb Require GNU make
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.
2021-04-22 19:51:54 -06:00
Mike Frysinger
2662c237a9 sim: regen against sim/m4/
My scripts weren't updated to use new -I../m4 as the first arg.
2021-04-21 20:40:51 -04:00
Simon Marchi
1f195bc327 sim: use -Werror when probing for supported warning flags
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:

    3e019bdc20
    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.
2021-04-21 19:48:35 -04:00
Mike Frysinger
2c2645d7a8 sim: switch to AC_CHECK_HEADERS_ONCE
This avoids duplicate tests for headers between common m4, arches,
and any other sources that would trigger header tests.
2021-04-18 23:53:01 -04:00
Mike Frysinger
37e9f18266 sim: switch to AC_CHECK_FUNCS_ONCE & merge a little
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.
2021-04-18 21:55:17 -04:00
Mike Frysinger
d5a71b1131 sim: cgen: move cgen_cpu_max_extra_bytes logic into the common code
Every arch handles this the same way, so move it to the common code.
This will also make unifying the sim_cpu structure easier.
2021-04-12 00:14:32 -04:00
Mike Frysinger
c2783492b6 sim: unify toolchain settings
The toplevel, common, and igen dirs all have their own code for
setting up toolchain settings.  Unify all of that in a new macro.
2021-04-02 23:31:14 -04:00
Mike Frysinger
c25ea03dd6 sim: set up build-time compiler settings
Some sim dirs were already setting up CFLAGS_FOR_BUILD in inconsistent
ways.  Move it to a common place for reuse.
2021-02-28 03:14:59 -05:00
Mike Frysinger
a3e2cc64a6 sim: use AC_CHECK_TOOL to find ar
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.
2021-02-28 03:03:44 -05:00
Mike Frysinger
ebe9564b99 sim: require AC_PROG_CPP explicitly
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.
2021-02-28 02:19:51 -05:00
Mike Frysinger
760b3e8bc9 sim: common: split up acinclude.m4 into individual m4 files
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.
2021-02-21 02:20:19 -05:00
Mike Frysinger
136da8cd9c sim: switch to AC_CONFIG_MACRO_DIRS
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.
2021-02-13 00:24:20 -05:00
Mike Frysinger
7a36eeea26 sim: common: switch AC_CONFIG_HEADERS
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.
2021-02-06 12:00:42 -05:00
Mike Frysinger
aa09469fc6 sim: drop use of bfd/configure.host
These settings might have made sense in darker compiler times, but I
think they're largely obsolete now.  Looking through the values that
get used in HDEFINES, it's quite limited, and configure itself should
handle them.  If we still need something, we can leverage standard
autoconf macros instead, after we get a clear user report.

TDEFINES was never set anywhere and was always empty, so prune that.
2021-02-06 10:56:11 -05:00
Mike Frysinger
68ed285428 sim: clean up C11 header includes
Since we require C11 now, we can assume many headers exist, and
clean up all of the conditional includes.  It's not like any of
this code actually accounted for the headers not existing, just
whether we could include them.

The strings.h cleanup is a little nuanced: it isn't in C11, but
every use of it in the codebase will include strings.h only if
string.h doesn't exist.  Since we now assume the C11 string.h
exists, we'll never include strings.h, so we can delete it.
2021-01-11 08:05:54 -05:00
Mike Frysinger
50df264dae sim: clean up stale AC_PREREQ refs
This was purged from the tree when we upgraded to autoconf-2.69,
but a few references in the sim tree were missed.
2021-01-09 09:27:29 -05:00
Mike Frysinger
bf470982f9 sim: enable -Werror by default for some arches
We've had this off for a long time because the sim code was way too
full of warnings for it to be feasible.  However, I've cleaned things
up significantly from when this was first merged, and we can start to
turn this around.

Change the macro to enable -Werror by default, and allow ports to opt
out.  New ports will get it automatically (and we can push back on
them if they try to turn it off).

Also turn it off for the few ports that still hit warnings for me.
All the rest will get the new default, and we'll wait for feedback
if/when new issues come up.
2021-01-09 09:19:37 -05:00
Mike Frysinger
f41464416a sim: pru: fix include ordering with sim-main.h
Make sure config.h is included before C library headers otherwise the
later libiberty.h include gets confused about asprintf state leading
to warnings like:
common/sim-utils.c:330:9:
	warning: implicit declaration of function 'vasprintf';
	did you mean 'xvasprintf'? [-Wimplicit-function-declaration]
2021-01-09 08:43:48 -05:00
Mike Frysinger
46f900c065 sim: require a C11 compiler
With GDB requiring a C++11 compiler now, this hopefully shouldn't
be a big deal.  It's been 10 years since C11 came out, so should
be plenty of time to upgrade.

This will allow us to start cleaning up random header logic and
many of our non-standard custom types.
2021-01-08 15:45:42 -05:00
Mike Frysinger
dfb856ba26 sim: update bug URI to https:// 2021-01-04 18:14:37 -05:00