diff options
| author | Matthew Maurer <[email protected]> | 2023-10-05 21:39:58 +0000 |
|---|---|---|
| committer | Masahiro Yamada <[email protected]> | 2023-10-14 09:26:28 +0000 |
| commit | 80bac83a739d36d227aa5c54f6ed417f13c086dd (patch) | |
| tree | d7e473e4c988e02ccf6685e42207fb217c007f24 /scripts/mod/file2alias.c | |
| parent | kbuild: rpm-pkg: generate kernel.spec in rpmbuild/SPECS/ (diff) | |
| download | kernel-80bac83a739d36d227aa5c54f6ed417f13c086dd.tar.gz kernel-80bac83a739d36d227aa5c54f6ed417f13c086dd.zip | |
rust: Respect HOSTCC when linking for host
Currently, rustc defaults to invoking `cc`, even if `HOSTCC` is defined,
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. The linker-flavor selects both which linker to search
for if the linker is unset, and which kind of linker flags to pass.
Without this flag, `rustc` would attempt to determine which flags to
pass based on the name of the binary passed as `HOSTCC`. `gcc` is the
name of the linker-flavor used by `rustc` for all C compilers, including
both `gcc` and `clang`.
Signed-off-by: Matthew Maurer <[email protected]>
Reviewed-by: Martin Rodriguez Reboredo <[email protected]>
Tested-by: Alice Ryhl <[email protected]>
Reviewed-by: Nick Desaulniers <[email protected]>
Acked-by: Miguel Ojeda <[email protected]>
Signed-off-by: Masahiro Yamada <[email protected]>
Diffstat (limited to 'scripts/mod/file2alias.c')
0 files changed, 0 insertions, 0 deletions
