Commit Graph

99 Commits

Author SHA1 Message Date
Matthieu Longo
c22e3e25de autoupdate: replace obsolete macros AC_HELP_STRING
- AC_HELP_STRING by AS_HELP_STRING
  https://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.72/autoconf.html#index-AC_005fHELP_005fSTRING-1
Except for the ifdef in lib-prefix.m4, make the defun of AC_LIB_ARG_WITH
unconditional.
2024-06-10 08:25:55 +09:30
Mike Frysinger
72d711c155 sim: build: switch to gdbsupport/libiberty.m4
Leverage this common logic to find all the libiberty settings rather
than duplicate it ourselves.
2024-01-10 19:53:10 -05:00
Mike Frysinger
586cfe1a5d sim: configure: switch to m4_map
Minor reduction in boilerplate here.  No real functional changes.
2024-01-03 01:43:14 -05:00
Mike Frysinger
c67a81c92f sim: drop support for recursive makes entirely
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-03 01:21:48 -05:00
Mike Frysinger
2c3bcf2537 sim: ppc: hoist compilation up to top-level
This removes all recursive makes from the ppc port.
2024-01-03 01:21:48 -05:00
Mike Frysinger
10e1edb737 sim: drop support for automatic subdir recursion
No port relies on this anymore, so we can scrub it all.
2024-01-03 01:21:48 -05:00
Mike Frysinger
01c2a7aa69 sim: ppc: move libsim.a creation to top-level
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-03 01:21:48 -05:00
Mike Frysinger
5f7e03a6bb sim: ppc: merge configure logic into top-level
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-02 01:41:55 -05:00
Mike Frysinger
ab18008ed1 sim: warnings: enable only for development builds
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-12-04 23:45:27 -05:00
Mike Frysinger
9a7472d7c5 sim: igen: simplify build logic a little
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-15 02:07:43 -05:00
Mike Frysinger
eaa13962f2 sim: build: drop depdir subdir hack
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-14 21:02:12 -05:00
Mike Frysinger
fe0adb538f sim: build: delete Make-common.in logic
Now that all (other than ppc) build in the top-level, this logic is
unused, so punt it all.
2023-01-13 17:34:53 -05:00
Mike Frysinger
fd95c73ef5 sim: disable recursive make in (most) subdirs
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-10 01:22:00 -05:00
Tsukasa OI
9f046489d0 sim: Move getopt checking inside SIM_AC_PLATFORM
This commit moves getopt declaration checker originally in sim/
configure.ac; added in commit 340aa4f687 ("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-05 03:31:42 +00:00
Mike Frysinger
7c9a934c4d sim: build: add var for tracking sim enable directly
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-02 22:40:49 -05:00
Mike Frysinger
4d4996a55e sim: build: use Automake include vars
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-02 19:30:22 -05:00
Mike Frysinger
20b579bac5 sim: smp: make option available again
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-12-25 02:13:30 -05:00
Mike Frysinger
23ddbd2f2b sim: mips: clean up a bit after mips/configure removal
Now that there is no subdir configure script, we can clean up some
logic that was spread between the files.
2022-12-24 22:13:56 -05:00
Mike Frysinger
abc494c65d sim: mips: move igen settings to top-level configure
This is the last bit of logic that exists in the mips configure
script, so move it to the top-level configure to kill it off.
We still have to move the Makefile.in igen logic to local.mk,
but this is a required first step for that.
2022-12-24 22:13:13 -05:00
Mike Frysinger
2d5700ad4e sim: mips: move subtarget defines to top-level configure
We want to kill off mips/configure entirely.  Move this small part
out now to get started.
2022-12-21 22:27:11 -05:00
Mike Frysinger
871aa3b9ee sim: v850: drop subdir configure logic
We've been using this only to set the default word size to 32.  We
can easily move this into the makefile via a -D compiler flag and
clean up the build logic quite a bit.
2022-11-07 23:26:07 +07:00
Mike Frysinger
4cf83930c1 sim: mn10300: drop subdir configure logic
We've been using this only to set the default word size to 32.  We
can easily move this into the makefile via a -D compiler flag and
clean up the build logic quite a bit.
2022-11-07 23:25:48 +07:00
Mike Frysinger
763b20abcb sim: or1k: drop subdir configure logic
We've been using this only to set the default word size to 32.  We
can easily move this into the makefile via a -D compiler flag and
clean up the build logic quite a bit.
2022-11-07 23:25:27 +07:00
Mike Frysinger
ee79c7df30 sim: bpf: drop subdir configure logic
We've been using this only to set the default word size to 64.  We
can easily move this into the makefile via a -D compiler flag and
clean up the build logic quite a bit.
2022-11-07 23:25:01 +07:00
Mike Frysinger
1787fcc45a sim: riscv: drop subdir configure logic
We've been using this only to set the default word size to 32-vs-64
based on the $target.  We can easily merge this with the top-level
configure script to clean things up a bit.
2022-11-07 23:24:46 +07:00
Mike Frysinger
23912acd40 sim: .gdbinit: generate for all arch subdirs
This was being skipped for ports that had a recursive configure,
but we want it for them too.
2022-11-07 21:52:47 +07:00
Mike Frysinger
2ba09f42f1 sim: build: add a proper var for enabled arches
The install code was using $SUBDIRS to track all enabled arches.  This
works, but isn't great if we want to add a subdir that isn't an arch
port, or as we merge the subdirs into the top-level.  Create a new var
explicitly to track the list of enabled arches instead.
2022-11-07 21:51:11 +07:00
Mike Frysinger
c0c25232da sim: run: move linking into top-level
Automake will run each subdir individually before moving on to the next
one.  This means that the linking phase, a single threaded process, will
not run in parallel with anything else.  When we have to link ~32 ports,
that's 32 link steps that don't take advantage of parallel systems.  On
my really old 4-core system, this cuts a multi-target build from ~60 sec
to ~30 sec.  We eventually want to move all compile+link steps to this
common dir anyways, so might as well move linking now for a nice speedup.

We use noinst_PROGRAMS instead of bin_PROGRAMS because we're taking care
of the install ourselves rather than letting automake process it.
2022-11-05 20:00:56 +07:00
Mike Frysinger
46a1e1f20b sim: merge gnulib logic into the top-level
We aren't using this just yet, but we will, so make it available to
building of common sim files.
2022-11-03 12:53:49 +05:45
Tsukasa OI
340aa4f687 sim: Check known getopt definition existence
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-10-11 15:18:14 +01:00
Mike Frysinger
7cd7b0641b sim: add arch/.gdbinit stub scripts
Make it easy to load the common gdbinit script even when running in
the arch/ subdir instead of the top-level sim dir.
2022-03-28 23:10:34 -04:00
Mike Frysinger
216722984f sim: gdbinit: hoist setup to common code
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-21 13:57:33 -05:00
Mike Frysinger
8996c21067 sim: testsuite: setup per-port toolchain settings for multitarget build
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-11-28 21:55:15 -05:00
Mike Frysinger
fb2c495f94 sim: avoid installing headers when there is no sim
If we aren't building any sims, don't install the sim headers as they
won't be useful to anyone.
2021-11-18 19:45:54 -05:00
Mike Frysinger
65dcce8f79 sim: add arch-specific conditional logic
This will make it easy to include arch-specific logic (build files)
as we migrate ports to the common top level build.
2021-10-31 02:03:16 -04:00
Mike Frysinger
99aedb6243 sim: update configure target list
Fix sorting of the list, and update the globs to match the list used
in gdb's configure script.
2021-09-08 01:24:15 -04:00
Mike Frysinger
7eb1f99ada sim: unify reserved instruction bits settings
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-07-01 20:53:00 -04:00
Mike Frysinger
313c332ff2 sim: m32r: merge with common configure script
Now that the traps code has been unified, the configure script has no
unique logic in it, so it can be merged into the single common one.
2021-07-01 20:48:07 -04:00
Mike Frysinger
408a44aac1 sim: cris/frv/iq2000/lm32: merge with common configure script
Now that the scache logic has been migrated into the common code,
there's nothing specific in these configure scripts, so merge them
into the common one.

The frv unique logic can be moved to a dedicated include and merged
in the common configure since the flag has been scoped to the arch.
2021-06-30 14:39:46 -04:00
Mike Frysinger
b79efe264f sim: unify scache settings
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-30 13:33:18 -04:00
Mike Frysinger
d8b04da736 sim: bfin: merge with common configure script
Now that the model logic has been migrated into the runtime, there's
nothing specific in the bfin configure code, so merge it into the
common one.
2021-06-30 03:01:46 -04:00
Mike Frysinger
d414eb3e7f sim: move default model to the runtime sim state
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-30 02:57:45 -04:00
Mike Frysinger
5d0b3088f7 sim: erc32: merge with common configure script
Move the unique library tests to the common code so we can delete
the erc32 configure logic entirely.
2021-06-27 01:21:47 -04:00
Mike Frysinger
b34084121a sim: switch common srcdir to abs_srcdir
We rewrite srcdir in subdir Makefiles that we generate from the common
parent dir since it points to the parent dir.  Since @srcdir@ can be a
variety of formats (relative & absolute), switch to @abs_srcdir@ which
is a lot easier to adjust.  Our use of srcdir in here should handle it.
2021-06-23 18:12:43 -04:00
Mike Frysinger
e173c80fbb sim: rx: merge with common configure script
Move the unique configure flag to acinclude.m4 so the common code
can include it, then delete the rx configure logic entirely.
2021-06-22 19:29:28 -04:00
Mike Frysinger
36bb57e40c sim: drop configure scripts for simple ports
These ports only use the pieces that have been unified, so we can
merge them into the common configure script and get rid of their
unique one entirely.

We still compile & link separate run programs, and have dedicated
subdir Makefiles, but the configure script portion is merged.
2021-06-22 19:26:13 -04:00
Mike Frysinger
456ef1c1d4 sim: unify hardware settings
Move these options up to the common dir so we only test & export
them once across all ports.
2021-06-21 22:20:18 -04:00
Mike Frysinger
1bf5c34239 sim: unify cgen maintainer settings
Move these options up to the common dir so we only test & export
them once across all ports.  It makes it available to targets that
aren't cgen-based, but those will just ignore the settings, so it
shouldn't be an issue.
2021-06-20 00:25:13 -04:00
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
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