about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbjorn3 <17426603+bjorn3@users.noreply.github.com>2022-09-27 11:16:09 +0200
committerGitHub <noreply@github.com>2022-09-27 11:16:09 +0200
commitd04ea0ff1921fcf4f4bf1dc6f088b29471c34f95 (patch)
tree4577f4f3295d7376a815f3eda28e746f9ade125f
parentde0b511daa91469dd251e736fb8914d2360ac0ec (diff)
downloadrust-d04ea0ff1921fcf4f4bf1dc6f088b29471c34f95.tar.gz
rust-d04ea0ff1921fcf4f4bf1dc6f088b29471c34f95.zip
Allow passing rustix_use_libc cfg using RUSTFLAGS
Before this would error with

```
error: unexpected `rustix_use_libc` as condition name
  |
  = note: `-D unexpected-cfgs` implied by `-D warnings`
  = help: was set with `--cfg` but isn't in the `--check-cfg` expected names
```

I'm setting rustix_use_libc when testing bootstrapping rustc with cg_clif as I'm disabling inline asm here.
-rw-r--r--src/bootstrap/lib.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/bootstrap/lib.rs b/src/bootstrap/lib.rs
index c83490316b6..b20d43a3332 100644
--- a/src/bootstrap/lib.rs
+++ b/src/bootstrap/lib.rs
@@ -229,6 +229,8 @@ const EXTRA_CHECK_CFGS: &[(Option<Mode>, &'static str, Option<&[&'static str]>)]
     // FIXME: Used by proc-macro2, but we should not be triggering on external dependencies.
     (Some(Mode::Rustc), "span_locations", None),
     (Some(Mode::ToolRustc), "span_locations", None),
+    // Can be passed in RUSTFLAGS to prevent direct syscalls in rustix.
+    (None, "rustix_use_libc", None),
 ];
 
 /// A structure representing a Rust compiler.