Skip to content

Commit 448db09

Browse files
committed
compiler-builtins: Emit rustc-check-cfg earlier
The `build.rs` entrypoint returns early for some targets, so emscripten and OpenBSD were not getting check-cfg set. Emit these earlier to avoid the `unexpected_cfgs` lint.
1 parent 889d3f6 commit 448db09

File tree

1 file changed

+3
-2
lines changed
  • library/compiler-builtins/compiler-builtins

1 file changed

+3
-2
lines changed

library/compiler-builtins/compiler-builtins/build.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ fn main() {
2222

2323
println!("cargo:compiler-rt={}", cwd.join("compiler-rt").display());
2424

25+
println!("cargo::rustc-check-cfg=cfg(kernel_user_helpers)");
26+
println!("cargo::rustc-check-cfg=cfg(feature, values(\"mem-unaligned\"))");
27+
2528
// Emscripten's runtime includes all the builtins
2629
if target.os == "emscripten" {
2730
return;
@@ -47,7 +50,6 @@ fn main() {
4750
}
4851

4952
// These targets have hardware unaligned access support.
50-
println!("cargo::rustc-check-cfg=cfg(feature, values(\"mem-unaligned\"))");
5153
if target.arch.contains("x86_64")
5254
|| target.arch.contains("x86")
5355
|| target.arch.contains("aarch64")
@@ -78,7 +80,6 @@ fn main() {
7880
// Only emit the ARM Linux atomic emulation on pre-ARMv6 architectures. This
7981
// includes the old androideabi. It is deprecated but it is available as a
8082
// rustc target (arm-linux-androideabi).
81-
println!("cargo::rustc-check-cfg=cfg(kernel_user_helpers)");
8283
if llvm_target[0] == "armv4t"
8384
|| llvm_target[0] == "armv5te"
8485
|| target.triple == "arm-linux-androideabi"

0 commit comments

Comments
 (0)