From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B872936F420; Mon, 11 May 2026 11:19:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778498381; cv=none; b=LnEB7VJeZ9QEu9zlx8FXbAkx9SHU1wV5/g0zXV7zvcyqUWaTkW1igdmZx8bvEbPszJm00okb6mBr+I7W2zWL8qgP+zvFnkEY9gIUOrgz4ITQfDVaoFqS2rGNtZqtfkZdp7HpOUmfhJLH/tlWbfn5n2CDd7UMt7EhtBAMrmTerrk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778498381; c=relaxed/simple; bh=GsUPCYi4SORcFaQFEndkeNQ2nUKT1wDYw+f9Cu06Mjw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=dYQlFGpvdz/CxQTB3NyTftk84BsAivOFsLSn6L5wLeZ7tmq455iswC34NKMI+VAW0G4srofF0ho/uQ9kLxXo9lWZb/eR1R5Ww+ELJKDF2UTUvIc6N9aV0fU8/6yFsRkFqd76BbdXDJzPk2s9m1mMOTVNwphO9tGTO6xHbnM55pI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=A1WH+oj1; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="A1WH+oj1" Received: by smtp.kernel.org (Postfix) with ESMTPSA id DBE80C2BCB0; Mon, 11 May 2026 11:19:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1778498381; bh=GsUPCYi4SORcFaQFEndkeNQ2nUKT1wDYw+f9Cu06Mjw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=A1WH+oj1G1Dp7jQBiCCCAwer7NTCZ62gqjvMrR69NepDEfypGn0iEo0PUAYgMnM7o 3xJpU748e9DHFcS6vWgjHJQQyAbfMkuoPg+MQFPuIpH+Cv9e7HfYn8Dn2ADJtHVYe0 CKGJ+0Qet7m44T6GQAz+tJ61ixA+TuixBch65KTtY6AHDAW1h0J+4jndeYJNhoSw6M Ln9aaeB1dmzfT4dRwPUhj3W28Fk+bMIJSC2clOB/oSmnMM6x5YJSHDi/Khdrr0tbe4 MuHCEiJ9Yeq9cW5u/iWzn/yMUmAbwavUWJTlJb9X/Sq3Zqde7Do9/Niy6Rq7YCAQLq 9Y3G9XV2+U8WQ== Date: Mon, 11 May 2026 13:18:41 +0200 From: Nicolas Schier To: Nathan Chancellor Cc: Mohamad Alsadhan , Miguel Ojeda , Boqun Feng , Gary Guo , =?iso-8859-1?Q?Bj=F6rn?= Roy Baron , Benno Lossin , Andreas Hindborg , Alice Ryhl , Trevor Gross , Danilo Krummrich , Yoann Congal , linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, rust-for-linux@vger.kernel.org Subject: Re: [PATCH v8] kbuild: host: use single executable for rustc -C linker Message-ID: References: <20260509101939.27108-1-mo@sdhn.cc> <20260511065915.GA325559@ax162> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260511065915.GA325559@ax162> On Mon, May 11, 2026 at 03:59:15PM +0900, Nathan Chancellor wrote: > Hi Mohamad, > > On Sat, May 09, 2026 at 01:19:38PM +0300, Mohamad Alsadhan wrote: > > rustc's -C linker= option expects a single executable path. When > > HOSTCC contains a wrapper (e.g. "ccache gcc"), passing > > `-Clinker=$(HOSTCC)` results in the shell splitting the value into > > multiple words, and rustc interprets the additional word as an > > input filename: > > > > error: multiple input filenames provided ... > > > > Generate a small wrapper script and pass it to -Clinker e.g. > > > > ``` > > #!/bin/sh > > ccache gcc "$@" > > ``` > > > > Note that the wrapper intentionally avoids a leading `exec` to > > naturally support leading environment assignments such as: > > `VAR=VAL ccache gcc`. > > > > This fix should be general enough to address most if not all cases > > (incl. wrappers or subcommands) and avoids surprises of simpler fixes > > like just defaulting to gcc. > > > > This avoids passing the user command as an environment variable as > > that would be more challenging to trace and debug shell expansions. > > > > Link: https://github.com/Rust-for-Linux/linux/issues/1224 > > Suggested-by: Yoann Congal > > Signed-off-by: Mohamad Alsadhan > > Thanks, this seems reasonable from a Kbuild perspective (although > Nicolas may have other comments) and it appears to work for me. I expect > this to go via the Rust tree. > > Acked-by: Nathan Chancellor > Tested-by: Nathan Chancellor > > > diff --git a/Makefile b/Makefile > > index 1a219bf1c..5ebeef67f 100644 > > --- a/Makefile > > +++ b/Makefile > > @@ -1651,7 +1651,8 @@ CLEAN_FILES += vmlinux.symvers modules-only.symvers \ > > modules.builtin.ranges vmlinux.o.map vmlinux.unstripped \ > > compile_commands.json rust/test \ > > rust-project.json .vmlinux.objs .vmlinux.export.c \ > > - .builtin-dtbs-list .builtin-dtb.S > > + .builtin-dtbs-list .builtin-dtb.S \ (If it'd go through kbuild, I'd fix the spaces-only here during patch application.) Thanks, no further objections. Reviewed-by: Nicolas Schier -- Nicolas