Re: [PATCH 1/6] kbuild: specify output names separately for each emission type from rustc
From: Gary Guo
Date: Sat Dec 31 2022 - 15:01:54 EST
On Sat, 31 Dec 2022 15:41:58 +0900
Masahiro Yamada <masahiroy@xxxxxxxxxx> wrote:
> diff --git a/scripts/Makefile.host b/scripts/Makefile.host
> index da133780b751..4434cdbf7b8e 100644
> --- a/scripts/Makefile.host
> +++ b/scripts/Makefile.host
> @@ -84,8 +84,8 @@ _hostc_flags = $(KBUILD_HOSTCFLAGS) $(HOST_EXTRACFLAGS) \
> $(HOSTCFLAGS_$(target-stem).o)
> _hostcxx_flags = $(KBUILD_HOSTCXXFLAGS) $(HOST_EXTRACXXFLAGS) \
> $(HOSTCXXFLAGS_$(target-stem).o)
> -_hostrust_flags = $(KBUILD_HOSTRUSTFLAGS) $(HOST_EXTRARUSTFLAGS) \
> - $(HOSTRUSTFLAGS_$(target-stem))
> +hostrust_flags = $(KBUILD_HOSTRUSTFLAGS) $(HOST_EXTRARUSTFLAGS) \
> + $(HOSTRUSTFLAGS_$(target-stem)) --emit=dep-info=$(depfile)
>
> # $(objtree)/$(obj) for including generated headers from checkin source files
> ifeq ($(KBUILD_EXTMOD),)
> @@ -97,7 +97,6 @@ endif
>
> hostc_flags = -Wp,-MMD,$(depfile) $(_hostc_flags)
> hostcxx_flags = -Wp,-MMD,$(depfile) $(_hostcxx_flags)
> -hostrust_flags = $(_hostrust_flags)
Would it be better to have `--emit=dep-info=$(depfile)` added here
instead so that it mimics c/cxx flags?
>
> #####
> # Compile programs on the host
> @@ -149,9 +148,7 @@ $(host-cxxobjs): $(obj)/%.o: $(src)/%.cc FORCE
> # host-rust -> Executable
> quiet_cmd_host-rust = HOSTRUSTC $@
> cmd_host-rust = \
> - $(HOSTRUSTC) $(hostrust_flags) --emit=dep-info,link \
> - --out-dir=$(obj)/ $<; \
> - mv $(obj)/$(target-stem).d $(depfile); \
> + $(HOSTRUSTC) $(hostrust_flags) --emit=link=$@ $<; \
> sed -i '/^\#/d' $(depfile)
> $(host-rust): $(obj)/%: $(src)/%.rs FORCE
> $(call if_changed_dep,host-rust)
Best,
Gary