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 AB857379EE0; Tue, 7 Apr 2026 20:30:08 +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=1775593808; cv=none; b=HYBdreDw4UF1GikfweyH2aO9oy4fBKNzZf56fhAOpO3HD/aKy7QgOtgNcFXHCgj/y7sHqUBbJiSzFa1fG0qc981N05mISJdrrPeHLJTWIFmjYkXcMtWEWKfe2GDZ2DRxgfv4nCTg6I+xfzSsX+pIJbrBzEFO1pTGpFy8Z6nz5so= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775593808; c=relaxed/simple; bh=6oU+KsmOg3FjvhpOlW6GWV5dIaB2gE3o/TwTmnU4JRQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=cFcGpoXZ0icTY64JNuuBMdYiv/BdMllO22fbXypVf6bK9wAyZPE4IQI563qEvr7sYOkSrTLRyvFVNCk2m8Jq1b4EETE3L/IxLEtWNmWKajDad0wwJLUHl17uXsdEhX+tqHe90qPu8cKKoMV9n9AkmUwXRpSRHVLl8mtXVCXkB7o= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=FRtYElU/; 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="FRtYElU/" Received: by smtp.kernel.org (Postfix) with ESMTPSA id CCA56C116C6; Tue, 7 Apr 2026 20:30:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1775593808; bh=6oU+KsmOg3FjvhpOlW6GWV5dIaB2gE3o/TwTmnU4JRQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=FRtYElU/kXI+NioLUM3KfjiGZMhCOtfdxwGBPdAdW2CKA/uAaoFrzr5U3GvZYdGmT 5dKoHzbUVPMlYqstQb7ZrfUzufSXowJXddRXgUFynC3KlTFlmIhICELlR0BxiFqNhK toT396TjEmgXIa8HNXYVh/shfFqPiA8pBvtuwo+4pqnV8T6g0zHf+GYepO0ASqW+cV mQQ3p023zCAUMLicQKQvGI2R0WaTg5vEnCjHgUW2Z8DtGeaeBCh6ViUbGneLQ3IA8V icKnLsvKK8xdr4FWiAl/0Krq2Oe5wTGKCNadFw1pynm+uyMg59/rd6JgoyoYEHuXUl /y/i85vuN7rbw== Date: Tue, 7 Apr 2026 22:29:55 +0200 From: Nicolas Schier To: Mohamad Alsadhan Cc: Nathan Chancellor , 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 v6] kbuild: host: use single executable for rustc -C linker Message-ID: Mail-Followup-To: Nicolas Schier , Mohamad Alsadhan , Nathan Chancellor , 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 References: <20260331000802.380-1-mo@sdhn.cc> Precedence: bulk X-Mailing-List: linux-kbuild@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: <20260331000802.380-1-mo@sdhn.cc> On Tue, Mar 31, 2026 at 03:08:01AM +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 > exec 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 > --- > v5 -> v6: > - Add fix to `rust/Makefile` as well (Yoann) > - Include script to `.gitignore` and make clean (Nicolas) > - Add back the outer `exec` to the command What is the reason for re-adding the 'exec'? -- Nicolas