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.
30 files changed