Age | Commit message (Collapse) | Author | Files | Lines |
|
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.
|
|
Leverage this common logic to find all the libiberty settings rather
than duplicate it ourselves.
|
|
This is the last compile-time logic in the ppc subdir.
|
|
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
This fixes linker errors in a `../../configure --enable-targets
--enable-sim; make all-gdb` build.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
Now that gnulib provides this, assume it exists.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|