aboutsummaryrefslogtreecommitdiff
path: root/sim/ppc/configure.ac
AgeCommit message (Collapse)AuthorFilesLines
2024-01-02sim: ppc: merge configure logic into top-levelMike Frysinger1-234/+0
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-02sim: ppc: scope configure options to --enable-sim-ppc-xxxMike Frysinger1-154/+154
To prepare for moving these into the top-level configure, namespace then with the port name like we do with all other ports.
2024-01-02sim: ppc: standardize configure option processingMike Frysinger1-140/+71
Switch from ad-hoc $silent checks & echo calls to standard AC_MSG_CHECKING & AC_MSG_RESULT calls. Also delete pointless variable setting after calling AC_MSG_ERROR.
2024-01-02sim: ppc: switch to AS_HELP_STRING for automatic formattingMike Frysinger1-18/+18
2024-01-02sim: ppc: drop configure compiler checksMike Frysinger1-6/+0
Now that the ppc script only checks configure options and sets up variables in the Makefile from those, delete all the compile related logic to greatly simplify the configure script.
2024-01-02sim: ppc: drop custom config.h headerMike Frysinger1-5/+1
Now that everything has moved to the top-level, we can drop the custom ppc config.h and reuse the common one.
2024-01-02sim: ppc: move termios probes to top-levelMike Frysinger1-69/+0
This is the last compile-time logic in the ppc subdir.
2024-01-02sim: ppc: switch to AC_CACHE_CHECKMike Frysinger1-30/+30
This macro replaces the AC_MSG_CHECKING+AC_CACHE_VAL+AC_MSG_RESULT which reduces the boilerplate in here a little bit.
2024-01-02sim: ppc: switch struct member checks to AC_CHECK_MEMBERMike Frysinger1-20/+20
This covers a lot of the AC_MSG_CHECKING+AC_TRY_COMPILE+AC_MSG_RESULT boilerplate and matches what we do in the top-level platform checks.
2024-01-02sim: ppc: move termio defines to config.hMike Frysinger1-6/+4
Move the defines from explicit -D options to config.h defines to simplify the build and make it easier to move to the top-level configure.
2024-01-02sim: ppc: move struct statfs to top-levelMike Frysinger1-24/+0
2024-01-02sim: ppc: move long long test to top-levelMike Frysinger1-2/+0
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.
2024-01-02sim: ppc: hoist sysv tests to top-levelMike Frysinger1-54/+0
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.
2024-01-02sim: ppc: always compile in the sysv sem & shm device filesMike Frysinger1-8/+8
Move the stub logic to the device files themselves. This makes the configure & build logic more static which will make it easier to move to the top-level build, and matches what we did with the common/ hw tree already. This also decouples the logic from the two -- in the past, you needed both sem & shm in order to enable the device models, but now each one is tied to its own independent knob. Practically speaking, this will probably not make a difference, but it simplifies the build a bit.
2024-01-02sim: ppc: change SysV sem & shm tests to compile-timeMike Frysinger1-31/+17
Instead of executing code to see if SysV semaphores & shared memory are available, switch to just a compile-time test. The system used to compile might not match the system used to run the code wrt the current kernel & OS settings, but the library APIs should. So move the failures from compile-time to runtime so the program is more portable, and works correctly even when cross-compiling.
2024-01-02sim: ppc: merge System V semaphores checksMike Frysinger1-34/+8
Compile tests can use earlier defines, so hoist the HAVE_UNION_SEMUN define to before the semaphore check, and use it in the test so that we can merge the 2 versions into one. This also defines HAVE_UNION_SEMUN even when ac_cv_sysv_sem is not set, but that's OK as this define is only about a type existing, not about whether the overall code is usable.
2024-01-02sim: ppc: fix bad AC_CACHE_CHECK call with semunMike Frysinger1-4/+2
The first arg is the cache var name, and this one was typoed relative to what the call actually set. We also don't need the manual call to AC_MSG_RESULT as the AC_CACHE_CHECK takes care of it for us.
2024-01-01sim: ppc: drop build-config.h usageMike Frysinger1-31/+0
This header is only used by the igen tool, and none of the igen code depends on the configure-time checks. Delete the logic to simplify to prepare for moving it to the local.mk code.
2024-01-01sim: ppc: drop unused host bitsize settingsMike Frysinger1-1/+0
This is never set anywhere, so it's always empty. Scrub it.
2022-12-19sim: ppc: change spreg switch table generation to compile-timeMike Frysinger1-1/+1
Simplify the generator by always outputting the switch tables, and leave the choice of whether to use them to the compiler via a -D flag.
2022-11-10sim: ppc: drop obsolete USE_WIN32API checkMike Frysinger1-10/+0
This controls only one thing: how to call mkdir(). The gnulib code already has a mkdir module that provides this exact logic for us, so punt the code entirely.
2022-11-05sim: ppc: drop unused /dev/zero logicMike Frysinger1-28/+0
Nothing in the tree checks this option, or has checked for decades. The pre-cvs-import ChangeLog suggests this was added & removed back then, but can't be sure as that history doesn't exist in the VCS.
2022-11-05sim: ppc: delete unused host bitsize settingsMike Frysinger1-10/+0
Nothing checks this define anywhere, so drop all the logic. We don't want this to be a configure option in the first place as all such usage should be automatic & following proper types.
2022-11-05sim: ppc: inline the sim-packages optionMike Frysinger1-24/+0
This has only ever had a single option that's enabled by default. The objects it adds are pretty small and don't add overhead at runtime if it isn't used, so just enable it all the time to make the build code simpler.
2022-10-23sim: mips/ppc/riscv: re-add AC_CANONICAL_SYSTEM [PR sim/29439]Mike Frysinger1-0/+4
These configure scripts check $target and change behavior. They shouldn't be doing that, but until we can rework the sim to change behavior based on the input ELF, restore AC_CANONICAL_SYSTEM to these so that $target is correctly populated. This was lost in the d3562f83a7b8a1ae6e333cd5561419d3da18fcb4 ("sim: unify toolchain probing logic") refactor as the logic was hoisted up to the common code. But the fact the vars weren't passed down to the sub-configure scripts was missed. Bug: https://sourceware.org/PR29439
2021-11-03sim: ppc: inline common sim-fpu.c logicMike Frysinger1-13/+0
We will never bother building w/out a ../common/ sim directory, so drop ancient logic supporting that method.
2021-11-03sim: ppc: switch to common builds for callback objectsMike Frysinger1-14/+0
We don't need to build this anymore ourselves since the common build includes it and produces the same object code. We also need to pull in the split constant modules after the refactoring and pulling them out of nltvals.def & targ-map.o. This doesn't matter for the sim directly, but does for gdb and other users of libsim. We also delete some conditional source tree logic since we already require this be the "new" combined tree with a ../common/ dir. This has been the case for decades at this point.
2021-09-09sim: ppc: drop support for std-config.h overridesMike Frysinger1-22/+0
Only the ppc arch supports this kind of source file override logic. All the others expose knobs via configure flags, and for some of these, the ppc code does as well. For others, it doesn't make sense to ever change them. Since it's unlikely anyone is using this, drop it all to simplify the code (and to get us a little closer to the common sim code).
2021-09-08sim: ppc: switch to common warning flagsMike Frysinger1-44/+0
Now that the ppc code has been cleaned up enough to use the same set of warning flags as the common code, delete the ppc-specific configure logic so we can leverage what the common code already defined for us.
2021-09-08sim: ppc: enable -Wpointer-sign warningsTom de Vries1-1/+1
When compiling with --enable-werror and CFLAGS="-O0 -g -Wall", we run into: ... src/sim/ppc/hw_memory.c: In function 'hw_memory_init_address': src/sim/ppc/hw_memory.c:204:7: error: pointer targets in passing argument 4 \ of 'device_find_integer_array_property' differ in signedness \ [-Werror=pointer-sign] &new_chunk->size); ^ ... Fix these by adding an explicit pointer cast. It's a bit ugly to use APIs based on signed integers to read out unsigned values, but in practice, this is par for the course in the ppc code. We already use signed APIs and assign the result to unsigned values a lot: see how device_find_integer_property returns a signed integer (cell), but then assign it to unsigned types. The array APIs are not used that often which is why we don't see many warnings, and we disable warnings when we assign signed integers to unsigned integers in general. The dtc/libfdt project (which is the standard in other projects) processes the fdt blob as a series of bytes without any type information. Typing is left to the caller. They have core APIs that read/write bytes, and a few helper functions to cast/convert those bytes to the right value (e.g. u32). In this ppc sim code, the core APIs use signed integers, and the callers convert to unsigned, usually implicitly. We could add some core APIs to the ppc sim that deal with raw bytes and then add some helpers to convert to the right type, but that seems like a lot of lifting for what boils down to a cast, and is effectively equivalent to all the implicit assignments we use elsewhere. Long term, a lot of the ppc code should either get converted to existing sim common code, or we should stand up proper APIs in the common code first, or use standard libraries to do all the processing (e.g. libfdt). Either way, this device.c code would all get deleted, and callers (like these hw_*.c files) would get converted. Which is also why we go with a cast rather new (but largely unused) APIs.
2021-09-08sim: ppc: enable -Wmissing-declarations & -Wmissing-prototypesMike Frysinger1-2/+2
This aligns with common code which already uses this flag. We have to add another local prototype to fix the failure, and add another local decl for the SIM_DESC type. Unwinding these will require a lot more work & conversions in the process, so going with the decl for now unblocks the warning unification.
2021-09-08sim: ppc: align format string settings with common codeMike Frysinger1-0/+6
This copies logic used in the common sim warning configure code to fix build errors for mingw targets. Turning format warnings on triggers a failure in the debug.c file, so apply a minor fix at the same time.
2021-07-01sim: unify reserved instruction bits settingsMike Frysinger1-13/+0
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-06-30sim: ppc: unify (most) compiler warnings with common codeMike Frysinger1-2/+27
Copy most of the common build warning logic over from the common code to help keep code behavior a bit consistent, and turn them on by default. We disable a few flags for now until we can clean the code up.
2021-06-20sim: move sim-inline to the common codeMike Frysinger1-36/+0
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-19sim: ppc: rename inline defines to match common codeMike Frysinger1-5/+5
Use the same basic names as the common sim inline logic so we can merge the two. We don't do that here, just prepare for it. The common code seems to be based on the ppc version but with slightly different names as it was cleaned up & generalized. I *think* these concepts are the same, so binding them together is OK, but maybe I'm misreading them. If so, can always tweak them later. REVEAL_MODULE -> H_REVEALS_MODULE INLINE_MODULE -> C_REVEALS_MODULE
2021-06-19sim: unify gettext/intl probing logicMike Frysinger1-6/+0
Move these options up to the common dir so we only test & export them once across all ports.
2021-06-19sim: unify toolchain probing logicMike Frysinger1-18/+7
Move these options up to the common dir so we only test & export them once across all ports.
2021-06-19sim: unify bfd library dependency testing logicMike Frysinger1-7/+0
Move these options up to the common dir so we only test & export them once across all ports.
2021-06-18sim: unify -Werror build settingsMike Frysinger1-22/+0
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-17sim: overhaul & unify endian settings managementMike Frysinger1-19/+0
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-16sim: drop obsolete AC_EXEEXT callMike Frysinger1-3/+0
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-16sim: ppc: use common sim-assert settingMike Frysinger1-13/+0
The common sim code already sets this up for us, so no need to duplicate the logic.
2021-06-16sim: ppc: convert to bfd_endianMike Frysinger1-6/+6
Rather than re-invent endian defines, as well as maintain our own list of OS & arch-specific includes, punt all that logic in favor of the bfd ones already set up and maintained elsewhere. We already rely on the bfd library, so leveraging the endian aspect should be fine. This was done for all the other ports years ago, so catch ppc up.
2021-06-16sim: ppc: drop host endian configure optionMike Frysinger1-24/+0
The --enable-sim-hostendian flag was purely so people had an escape route for when cross-compiling. This is because historically, AC_C_BIGENDIAN did not work in those cases. That was fixed a while ago though, so we can require that macro everywhere now and simplify a good bit of code. This was done for all the other ports years ago, so catch ppc up.
2021-06-12sim: overhaul alignment settings managementMike Frysinger1-14/+0
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-12sim: unify bug & package settingsMike Frysinger1-5/+0
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-12sim: unify debug/stdio/trace/profile build settingsMike Frysinger1-26/+0
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-12sim: ppc: unify header & function & type tests tooMike Frysinger1-17/+0
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.
2021-06-12sim: ppc: unify env settings tooMike Frysinger1-16/+1
The ppc port doesn't share a lot of the common logic, but there are a few bits that bleed across. Have it use the common configure for environment settings too to avoid duplicate define errors after the recent unification with the other ports.