aboutsummaryrefslogtreecommitdiff
path: root/sim/configure
AgeCommit message (Collapse)AuthorFilesLines
2023-08-19sim --enable-cgen-maintAlan Modra1-0/+3
I had reason yesterday to want to regenerate configury files which I do with --enable-maintainer-mode, and added --enable-cgen-maint accidentally. The first problem I hit is that sim looks for cgen in a different directory by default than opcodes, and I had my source layout set up for opcodes rather than sim. Fix that by making both use ../cgen first, then ../../cgen relative to sim/ and opcodes/. The next problem was that various sim local.mk files expected generated sources in the build dir rather than the source dir. Fix that by adding $(srcdir) to paths. Finally, the generated iq2000 files had a compile error, fixed by the cpu/iq2000.cpu patch. cpu/ * iq2000.cpu (syscall): Add pc arg. opcodes/ * configure.ac (cgendir): Default to ../../cgen, but use ../cgen if found there. * configure: Regenerate. sim/m4/ * sim_ac_option_cgen_maint.m4 (cgendir): Look in ../cgen too. sim/ * cris/local.mk: Add $(srcdir) to paths for regenerated source. * frv/local.mk: Likewise. * iq2000/local.mk: Likewise. * lm32/local.mk: Likewise. * m32r/local.mk: Likewise. * or1k/local.mk: Likewise. * Makefile.in: Regenerate. * configure: Regenerate.
2023-08-12regen configAlan Modra1-21/+52
This regenerates config files changed by the previous 44 commits. Note that subject lines in these commits mostly match the gcc git originating commit.
2023-01-16sim: assume sys/stat.h always exists (via gnulib)Mike Frysinger1-31/+2
We have many uses of sys/stat.h that are unprotected by HAVE_SYS_STAT_H, so this is more formalizing the reality that we require this header. Since we switched to gnulib, it guarantees that a sys/stat.h exists for us to include, so we're doubly OK.
2023-01-16sim: formally assume unistd.h always exists (via gnulib)Mike Frysinger1-5/+2
We have many uses of unistd.h that are unprotected by HAVE_UNISTD_H, so this is more formalizing the reality that we require this header. Since we switched to gnulib, it guarantees that a unistd.h exists for us to include, so we're doubly OK.
2023-01-16sim: build: stop probing system extensions (ourselves)Mike Frysinger1-156/+3
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.
2023-01-15sim: igen: simplify build logic a littleMike Frysinger1-48/+2
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-14sim: build: drop depdir subdir hackMike Frysinger1-160/+0
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-13sim: build: delete Make-common.in logicMike Frysinger1-14/+2
Now that all (other than ppc) build in the top-level, this logic is unused, so punt it all.
2023-01-10sim: disable recursive make in (most) subdirsMike Frysinger1-598/+2
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-10sim: mips: move libsim.a creation to top-levelMike Frysinger1-10/+10
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. On my 4 core system, it adds ~100msec to the build per port, so it's not great, but it shouldn't be a big deal. This will go away of course once the top-level compiles objects. The mips code is a little more tricky than others because, for multi-run targets, it generates the list of sources & objects on the fly in the configure script.
2023-01-05sim: Move getopt checking inside SIM_AC_PLATFORMTsukasa OI1-32/+32
This commit moves getopt declaration checker originally in sim/ configure.ac; added in commit 340aa4f6872c ("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-02sim: build: add var for tracking sim enable directlyMike Frysinger1-33/+66
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-02sim: build: use Automake include varsMike Frysinger1-6/+2
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-01sim: replace -I$srcroot/bfd include with -I$srcrootMike Frysinger1-2/+2
Clean up includes a bit by making ports include bfd/ headers explicitly. This matches other projects, and makes it more clear where these headers are coming from.
2023-01-01sim: refresh copyright dates a bitMike Frysinger1-1/+1
Update a few files that were missed, and revert the generated Automake output that uses dates from Automake itself.
2022-12-27sim: mips: hoist "multi" igen rules up to common buildsMike Frysinger1-2/+16
Since these are the last mips igen rules, we can clean up a number of bits in the local Makefile.in.
2022-12-27sim: mips: hoist "m16" igen rules up to common buildsMike Frysinger1-2/+16
2022-12-27sim: mips: hoist "single" igen rules up to common buildsMike Frysinger1-2/+16
2022-12-27sim: mips: rename "igen" generation mode to "single"Mike Frysinger1-25/+25
The naming in here has grown organically and is confusing to follow. Originally there was only one set of rules for generating code from the igen sources, so calling it "tmp-igen" and such made sense. But when other multigen modes were added ("m16" & "multi") which also used igen, it's not clear what's common igen and what's specific to this generation mode. So rename the set of rules from "igen" to "single" so it's easier to follow.
2022-12-27sim: mips: unify itable generation (a bit)Mike Frysinger1-0/+4
The m16 & multi targets generate itable once even when all the other modules are generated multiple times. The default igen target will generate itable with everything else out of convenience. This means flags are passed which don't affect the generated itable there. We can unify the itable generation by making sure the right -F/-M filter variables are passed down. Since there's already a dedicated rule & variable in the multi build mode, generalize that and switch the m16 & igen builds over too. I spent a lot of time staring at this code, building for diff mips targets, and exploring all the shell code paths. I think this is safe, but only time (and users) will really tell.
2022-12-27sim: mips: rename multi_flags to igen_itable_flagsMike Frysinger1-6/+6
This variable is only used to generate the itable files. In preparation for merging the itable logic among all ports, rename "multi_flags" to a more appropriate "igen_itable_flags" variable. There should be no real chagnes here otherwise.
2022-12-27sim: mips: drop unused micromips igen logicMike Frysinger1-8/+2
This code appears to be unused since it was first merged. When micromips was enabled, it was via the "MULTI" config, not the "MICROMIPS" config, and the multi configs have sep vars. Since nothing sets SIM_MIPS_GEN=MICROMIPS in the config, all of this should be unreachable, so punt it to simplify. Further, the SIM_MIPS_MICROMIPS16_FLAGS & SIM_MIPS_MICROMIPS_FLAGS settings rely on sim_mips_micromips{,16}_{filter,machine} variables that are never set in the configure script.
2022-12-25sim: smp: plumb igen flag down to all usersMike Frysinger1-7/+9
While mips has respected sim_igen_smp at configure time (which was always empty since it defaulted smp to off), no other igen port did. Move this to a makefile variable and plumb it through the common IGEN_RUN variable instead so everyone gets it by default. We also clean up some redundant -N0 setting with multirun mips.
2022-12-25sim: smp: make option available againMike Frysinger1-2/+30
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-24sim: mips: move igen settings to top-level configureMike Frysinger1-8/+260
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-21sim: mips: move fpu bitsize defines to top-level configureMike Frysinger1-2/+26
This drops support for the --enable-sim-float configure option, but it's not clear anyone ever actually used that. Eventually we'll want this to be a runtime option anyways.
2022-12-21sim: mips: move bitsize defines to top-level configureMike Frysinger1-2/+28
Since the msb value is always defined as the wordsize-1, stop hardcoding that value directly, and use a CPP value instead.
2022-12-21sim: mips: move subtarget defines to top-level configureMike Frysinger1-2/+27
We want to kill off mips/configure entirely. Move this small part out now to get started.
2022-11-10sim: restore lstat & mkdir func checksMike Frysinger1-2/+8
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-07sim: riscv: add missing AC_MSG_RESULT callMike Frysinger1-0/+2
Previous commit in here forgot to include this.
2022-11-07sim: v850: drop subdir configure logicMike Frysinger1-5/+21
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-07sim: mn10300: drop subdir configure logicMike Frysinger1-4/+20
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-07sim: or1k: drop subdir configure logicMike Frysinger1-4/+20
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-07sim: bpf: drop subdir configure logicMike Frysinger1-8/+24
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-07sim: riscv: drop subdir configure logicMike Frysinger1-2/+30
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-07sim: .gdbinit: generate for all arch subdirsMike Frysinger1-100/+121
This was being skipped for ports that had a recursive configure, but we want it for them too.
2022-11-07sim: build: add a proper var for enabled archesMike Frysinger1-33/+69
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-05sim: fix readline linkageMike Frysinger1-1/+1
Now that we link programs in the top dir instead of the arch subdir, update the readline library path to be relative to the top dir.
2022-11-05sim: run: move linking into top-levelMike Frysinger1-2/+16
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-05sim: adjust sim_hw options styleMike Frysinger1-2/+4
We use uppercase for other variables, and are already turning it to uppercase in the arch-subdir.mk, so convert it in the configure step.
2022-11-04sim: don't hardcode -ldl for SDL supportMike Frysinger1-5/+9
Since we use AC_SEARCH_LIBS to find dlopen, we don't need to hardcode -ldl when using SDL ourselves.
2022-11-04sim: build: change AC_CHECK_LIB to AC_SEARCH_LIBSMike Frysinger1-90/+145
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-359/+4
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-11-03sim: merge gnulib logic into the top-levelMike Frysinger1-2/+6
We aren't using this just yet, but we will, so make it available to building of common sim files.
2022-11-02sim: split CPPFLAGS between build & hostMike Frysinger1-2/+6
In order to merge more common/ files into the top-level, we need to add more host flags to CPPFLAGS, and that conflicts with our current use with build-time tools. So split them apart like we do with all other build flags to avoid the issue.
2022-10-11sim: Check known getopt definition existenceTsukasa OI1-0/+32
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-2/+132
This fixes linker errors in a `../../configure --enable-targets --enable-sim; make all-gdb` build.
2022-03-28sim: add arch/.gdbinit stub scriptsMike Frysinger1-25/+100
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-25libtool.m4: fix the NM="/nm/over/here -B/option/with/path" caseNick Alcock1-7/+13
My previous nm patch handled all cases but one -- if the user set NM in the environment to a path which contained an option, libtool's nm detection tries to run nm against a copy of nm with the options in it: e.g. if NM was set to "nm --blargle", and nm was found in /usr/bin, the test would try to run "/usr/bin/nm --blargle /usr/bin/nm --blargle". This is unlikely to be desirable: in this case we should run "/usr/bin/nm --blargle /usr/bin/nm". Furthermore, as part of this nm has to detect when the passed-in $NM contains a path, and in that case avoid doing a path search itself. This too was thrown off if an option contained something that looked like a path, e.g. NM="nm -B../prev-gcc"; libtool then tries to run "nm -B../prev-gcc nm" which rarely works well (and indeed it looks to see whether that nm exists, finds it doesn't, and wrongly concludes that nm -p or whatever does not work). Fix all of these by clipping all options (defined as everything including and after the first " -") before deciding whether nm contains a path (but not using the clipped value for anything else), and then removing all options from the path-modified nm before looking to see whether that nm existed. NM=my-nm now does a path search and runs e.g. /usr/bin/my-nm -B /usr/bin/my-nm NM=/usr/bin/my-nm now avoids a path search and runs e.g. /usr/bin/my-nm -B /usr/bin/my-nm NM="my-nm -p../wombat" now does a path search and runs e.g. /usr/bin/my-nm -p../wombat -B /usr/bin/my-nm NM="../prev-binutils/new-nm -B../prev-gcc" now avoids a path search: ../prev-binutils/my-nm -B../prev-gcc -B ../prev-binutils/my-nm This seems to be all combinations, including those used by GCC bootstrap (which, before this commit, fails to bootstrap when configured --with-build-config=bootstrap-lto, because the lto plugin is now using --export-symbols-regex, which requires libtool to find a working nm, while also using -B../prev-gcc to point at the lto plugin associated with the GCC just built.) Regenerate all affected configure scripts. * libtool.m4 (LT_PATH_NM): Handle user-specified NM with options, including options containing paths.
2022-02-21sim: gdbinit: hoist setup to common codeMike Frysinger1-1/+2
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.