From d6e3a32a557db5902e714604def8015d6bb7e0f7 Mon Sep 17 00:00:00 2001 From: Urgau <3616612+Urgau@users.noreply.github.com> Date: Mon, 1 Jul 2024 11:23:58 +0200 Subject: [PATCH] Update new target check-cfg instructions --- src/building/new-target.md | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/building/new-target.md b/src/building/new-target.md index ac838c6c29948..4c58f303f7923 100644 --- a/src/building/new-target.md +++ b/src/building/new-target.md @@ -86,12 +86,18 @@ unexpected because stage0 doesn't know about the new target specification and we pass `--check-cfg` in order to tell it to check. To fix the errors you will need to manually add the unexpected value to the -`EXTRA_CHECK_CFGS` list in `src/bootstrap/src/lib.rs`. Here is an example for -adding `NEW_TARGET_OS` as `target_os`: +different `Cargo.toml` in `library/{std,alloc,core}/Cargo.toml`. Here is an +example for adding `NEW_TARGET_ARCH` as `target_arch`: + +*`library/std/Cargo.toml`*: ```diff -- (Some(Mode::Std), "target_os", Some(&["watchos"])), -+ // #[cfg(bootstrap)] NEW_TARGET_OS -+ (Some(Mode::Std), "target_os", Some(&["watchos", "NEW_TARGET_OS"])), + [lints.rust.unexpected_cfgs] + level = "warn" + check-cfg = [ + 'cfg(bootstrap)', +- 'cfg(target_arch, values("xtensa"))', ++ # #[cfg(bootstrap)] NEW_TARGET_ARCH ++ 'cfg(target_arch, values("xtensa", "NEW_TARGET_ARCH"))', ``` To use this target in bootstrap, we need to explicitly add the target triple to the `STAGE0_MISSING_TARGETS`