lkml.org 
[lkml]   [2023]   [Sep]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v2] rust: Respect HOSTCC when linking for host
From
On 9/18/23 20:43, Matthew Maurer wrote:
> 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.
>
> Signed-off-by: Matthew Maurer <mmaurer@google.com>
> ---
>
> 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.
> [...]
Reviewed-by: Martin Rodriguez Reboredo <yakoyoku@gmail.com>

\
 
 \ /
  Last update: 2023-09-19 21:19    [W:0.049 / U:0.036 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site