sim: use build-gnulib with build-time tools [PR sim/30882]
Some of our build-time tools are fairly complicated and require some
POSIX APIs that the build system doesn't provide. Leverage the new
build-gnulib tree to provide fallback implementations automatically.
gnulib: enable a --build setup for sim [PR sim/30882]
The sim tree has some build-time programs for generating source files
that are a bit complicated and expect a POSIX-compatible system. Use
the existing gnulib project to provide missing APIs.
gnulib: support building for --build [PR sim/30882]
The sim tree has some build-time programs for generating source files
that are a bit complicated and expect a POSIX-compatible system. But
some targets (e.g. mingw) might not provide up-to-date support. Since
we already have gnulib in the tree, leverage that to also build for
the --build system.
The top-level configure logic will pass down --with-build-subdir when
the subdir is built for it. Use that to adjust the output variable
names and paths. This allows us to include the gnulib makefile frags
for both --host and --build simultaneously.
The common igen code provides the same misc APIs as the ppc version,
so delete the ppc code and pull in the common one. There is one
minor difference: the ppc code has a unique dumpf function. The
common code switched to lf_printf for the same functionality, but
since that requires changes throughout the igen codebase, delay that
cleanup for now so we can merge the rest.
We want to avoid conflicts with the common igen enums. This should
get migrated over to the common parsing logic, but for now, switch
the name to avoid redefinition.
sim: ppc: unify igen filter_filename implementations
Now that both igen implementations are in the top-level, we can unify
the filter_filename implementation between them since they're the same
(literally the same code).
The lbasename function from libiberty provides the same API as this
custom function. The common/ code already made the switch, so make
the same change to the ppc code to avoid target duplication.