hadrian: Ensure that settings is regenerated during bindist installation
Previously Hadrian would simply install the settings file generated in
the build environment during the binary distribution installation. This
is wrong since these environments may differ (e.g. different cc
versions).
We noticed on Darwin when installation of a binary distribution produced
on a newer Darwin release resulted in a broken compiler due to the
installed settings
file incorrectly claiming that cc
supported
-no-pie
.
Fixing this sadly requires a bit of code duplication since settings
is
produced by Hadrian and not configure
. For now I have simply
duplicated the settings
generation logic used by the Make build system
into Hadrian's bindist Makefile.
Ultimately the solution will probably involve shipping a freestanding
utility to replace configure
's toolchain probing logic and generate a
toolchain description file (similar to settings
) as described
in #19877 (closed).
Fixes #20253 (closed).