linux/rust
Matthew Maurer 80bac83a73 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 <mmaurer@google.com>
Reviewed-by: Martin Rodriguez Reboredo <yakoyoku@gmail.com>
Tested-by: Alice Ryhl <aliceryhl@google.com>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Acked-by: Miguel Ojeda <ojeda@kernel.org>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2023-10-14 18:26:28 +09:00
..
alloc rust: upgrade to Rust 1.71.1 2023-08-14 17:50:02 +02:00
bindings linux-kselftest-kunit-6.6-rc1 2023-08-28 18:56:38 -07:00
kernel Rust changes for v6.6 2023-08-29 08:19:46 -07:00
macros Rust changes for v6.6 2023-08-29 08:19:46 -07:00
uapi rust: upgrade to Rust 1.68.2 2023-05-31 17:35:03 +02:00
.gitignore rust: support running Rust documentation tests as KUnit ones 2023-07-19 09:32:53 -06:00
bindgen_parameters rust: bindgen: Add alt_instr as opaque type 2023-03-02 22:44:15 +01:00
build_error.rs rust: add build_error crate 2022-12-04 01:59:16 +01:00
compiler_builtins.rs rust: upgrade to Rust 1.71.1 2023-08-14 17:50:02 +02:00
exports.c rust: add build_error crate 2022-12-04 01:59:16 +01:00
helpers.c Rust changes for v6.6 2023-08-29 08:19:46 -07:00
Makefile rust: Respect HOSTCC when linking for host 2023-10-14 18:26:28 +09:00