From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f52.google.com (mail-wr1-f52.google.com [209.85.221.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 833F21922F1 for ; Wed, 9 Oct 2024 11:44:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.52 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728474248; cv=none; b=rc0NIJwHN6JHv6/I/WT1kS/wI/ciYOgvzIxf6+ayeFqRpMRBjYD2go84LKDJgsA7mP/5d/l/77bjsMDMQqB9laSRur2P25e8k1w2Mg8meZiLyDQJeZYiGJ4Rx4F0Ls5fBZbdJxewe1Zo0iLISsnJtfpoAMXhoMNBDJFiJ9y1sus= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728474248; c=relaxed/simple; bh=g/MMrVGuKitFnhQKoUQnuxLzP+zAlkse9vLSVVra1uQ=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=ZN33ek09qStDSaoyzYLkg8ZFbOYjIt714dkD4+qZC+D+uBiA1Q3hWkvHCzG8ZmkKZnk2owKD3RyegpY3h1R/NiAEEWRtrFAob3n73Q5lujo1ej7dVDeP5FXTsRelA6J5W6KKU+u2k9tn3A6AP3TtyUFWGTx8MlZTt9T/ekVUQgM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=hjDR6zFf; arc=none smtp.client-ip=209.85.221.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="hjDR6zFf" Received: by mail-wr1-f52.google.com with SMTP id ffacd0b85a97d-37d3297b7deso1135077f8f.2 for ; Wed, 09 Oct 2024 04:44:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1728474245; x=1729079045; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=qrCBXn8OEnLkQ8bOSvLpB3bghVcDr825c4fvC0xS41A=; b=hjDR6zFfRn6MZC4Gb/VA1AGaXL7U1zJ5z3iPfxeAQOFy++cR1UZx8/k252inBBv/2v U/4BvtXtfeQt8ZTgqzxzg6kUubVTI3xuq4eeBlddUkJYlCDKskHTH1M/FtspARxQSnxC rHJPOIDTvieiEdD7uY8jEVgrn1lgCIxw0l9KI8XYl0bJY4hLwvPul12TYSynaISe0Et/ Kf9opcp7kKME0exhNHI3Y5WHYBAdhWQ7vkMYp9a0Fm86fZ8CIvE7mW75iwjoUtmrhJhC skJzsw7HknsPXXjKOdB1cX8q3oBQTzXrAN2sRhE8LNgAYQz930YkgUUIs31CwCjqe80M 5ieQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728474245; x=1729079045; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=qrCBXn8OEnLkQ8bOSvLpB3bghVcDr825c4fvC0xS41A=; b=XhZYrLEs4uvpIUdYvkmTnjYKcdPMP0J+MDbuKCwGA4jhsNm2NOxS1unFrI07+EG8G5 e49nYE8qnrw+C2dbvXc2vRompZgFjvA8YrAxEjarDT1wH/Tk/+tuH36Zn2EllZBHTAM6 Z4z/7KMlzXYvb78gbTlNjdyk4ql9zMncvHMIs3FYw7B4VvQbv85Ag5hoE7KVSx2tinw4 g+ItXlJMtWXGCef5xWUbtUUnq2VW0TmUh6h4M+Qho90uABQ5jktfhtpq2hWwDO+wg8sX tDEZfJqEVdKw15jEddMIIaWINtRtkJxXnf8MJEEEwobJ6vU6yE+nErFNbRl2x0vOeWoI 3oRw== X-Forwarded-Encrypted: i=1; AJvYcCXBLXKkWAc1BIOvibVINK++PASyfB5gyNZXmGqzgtUtrZpgJzXibQFdub/7+SmyK5TIBEdwc4a0ItjacSUmRQ==@vger.kernel.org X-Gm-Message-State: AOJu0YzpO/RUfSgek6MpwMCz3mkNciMzKsnqf9BuLWzw8o/npn9enFse AVB8gslipYbc96DNQpkNRs2co7LE2ttdDB7ZTghnhVonYwWquvxvuxGVcyItEc8nWPzBgXVxOue l7g4bo4WBcKqw5gB4yQ2e/uHThe7JKKs63tfo X-Google-Smtp-Source: AGHT+IEC35A5m1UDxY1lu3ETx4PWm6TK94Y/0Tw3NpnNGSCOgs4PXnOMWpDy2rkhXGvULGSApTbUZzCnN3vEFJxFFe4= X-Received: by 2002:a5d:438b:0:b0:374:c7a3:3349 with SMTP id ffacd0b85a97d-37d3aaa3053mr1323357f8f.51.1728474244687; Wed, 09 Oct 2024 04:44:04 -0700 (PDT) Precedence: bulk X-Mailing-List: rust-for-linux@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20241008-rustc-option-bootstrap-v2-1-e6e155b8f9f3@google.com> In-Reply-To: <20241008-rustc-option-bootstrap-v2-1-e6e155b8f9f3@google.com> From: Alice Ryhl Date: Wed, 9 Oct 2024 13:43:52 +0200 Message-ID: Subject: Re: [PATCH v2] Kbuild: fix issues with rustc-option To: Masahiro Yamada , Nathan Chancellor , Nicolas Schier , Miguel Ojeda , Matthew Maurer Cc: Alex Gaynor , Boqun Feng , Gary Guo , =?UTF-8?Q?Bj=C3=B6rn_Roy_Baron?= , Benno Lossin , Andreas Hindborg , Trevor Gross , linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, rust-for-linux@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, Oct 8, 2024 at 7:32=E2=80=AFPM Alice Ryhl wr= ote: > > Fix a few different compiler errors that cause rustc-option to give > wrong results. > > If KBUILD_RUSTFLAGS or the flags being tested contain any -Z flags, then > the error below is generated. The RUSTC_BOOTSTRAP environment variable > is added to fix this error. > > error: the option `Z` is only accepted on the nightly compiler > help: consider switching to a nightly toolchain: `rustup default = nightly` > note: selecting a toolchain with `+toolchain` arguments require a= rustup proxy; > see > note: for more information about Rust's stability policy, see > > error: 1 nightly option were parsed > > The probe may also fail incorrectly with the below error message. To fix > it, the /dev/null argument is replaced with a new rust/probe.rs file > that doesn't need even the core part of the standard library. > > error[E0463]: can't find crate for `std` > | > =3D note: the `aarch64-unknown-none` target may not be installed > =3D help: consider downloading the target with `rustup target add aarch= 64-unknown-none` > =3D help: consider building the standard library from source with `carg= o build -Zbuild-std` > > The -o and --out-dir parameters are altered to fix this warning: > > warning: ignoring --out-dir flag due to -o flag > > I verified that the Kconfig version of rustc-option doesn't have the > same issues. > > Fixes: c42297438aee ("kbuild: rust: Define probing macros for rustc") > Signed-off-by: Alice Ryhl > --- > Changes in v2: > - Add `export` to RUSTC_BOOTSTRAP. > - Fix error about core being missing. > - Fix warning about -o flag. > - Link to v1: https://lore.kernel.org/r/20241008-rustc-option-bootstrap-v= 1-1-9eb06261d4f7@google.com v3 sent here: https://lore.kernel.org/all/20241009-rustc-option-bootstrap-v3-1-5fa0d520ef= ba@google.com/ Alice