hadrian doesn't use inplace mingw toolchain on Windows
While looking at #18550 (closed), I noticed that Hadrian (and perhaps make
) does not use the in-place mingw toolchain on Windows. Specifically, only builds that are run using ghc
as the driver will benefit from the inplace toolchain.
Use of the in-place toolchain is achieved through logic in the FP_SETTINGS
function in aclocal.m4
, which sets SettingsCCompilerCommand
, among other things. However, it does not set Hadrian's system-cc
or make
's CC
and CC_STAGE0
variables. Consequently any builds (or linking jobs) which call the C compiler or linker directly will use the wrong toolchain on Windows. I wonder if this is in part to blame for our Windows path length issues: some of our builds aren't using the patched toolchain.
Fixing this is a bit tricky since GHC has special logic to resolve the $tooldir
token that appears in SettingsCCompilerCommand
and friends. I don't think we want to replicate this in Hadrian/make.