Currently, rustc defaults to invoking `cc`, even if `HOSTCC` is defined,Reviewed-by: Martin Rodriguez Reboredo <yakoyoku@xxxxxxxxx>
resulting in build failures in hermetic environments where `cc` does not
exist. This includes both hostprogs and proc-macros.
Since we are setting the linker to `HOSTCC`, we set the linker flavor to
`gcc` explicitly.
Signed-off-by: Matthew Maurer <mmaurer@xxxxxxxxxx>
---
Updated the patch to reflect Nick's comment that KBUILD_HOSTLDFLAGS
should be respected as well.
I did not switch it to use HOSTLD for two reasons:
* That variable is not globally defined - it is only available in two
subdirectories of tools/
* C host scripts are linked by HOSTCC as well, even when linking a
collection of object files. It *prints* HOSTLD, but invokes HOSTCC.
See scripts/Makefile.host cmd_host-cmulti for an example.
[...]