Re: [PATCH v7] kbuild: host: use single executable for rustc -C linker

From: Mohamad Alsadhan

Date: Sat May 09 2026 - 06:04:45 EST


Thanks for your input, good points.

On 26/04/29 06:01pm, Nathan Chancellor wrote:
> > - -Clinker-flavor=gcc -Clinker=$(HOSTCC) \
> > + -Clinker-flavor=gcc -Clinker=scripts/rustc-wrapper \
>
> I think this should use an explicit $(objtree)/ prefix to make it an
> absolute path.
>

I changed the rustc-facing path to `$(objtree)/scripts/rustc-wrapper`
in v8 for clarity. However, the make prerequisites stay as
`scripts/rustc-wrapper`, because the rule is defined for that
target name; using `$(objtree)/...` there breaks make dependency
resolution.

> I have not been following this series too closely but it feels weird
> that multiple rustc-wrapper files would be generated when their contents
> should be the exact same. Would other host programs have to copy the
> changes you made to .gitignore and Makefile under samples/rust/hostprogs?
> What was the issue with attempting to unify these?

I agree; per-directory wrappers were the wrong end state.

I have reworked v8 to use a single global wrapper under `scripts/`
for both `rust/Makefile` and generic host Rust builds.

The missing piece before was making sure that wrapper is always
generated when Rust is enabled, even if no Rust hostprog in `scripts/`
would otherwise build it. With that fixed, the local ignore/clean
changes are dropped.

v8 should follow soon. Apologies for this taking longer than needed,
it was my first kbuild patch. The feedback and patience are very much
appreciated.

--
Best,
mo