File tree 1 file changed +9
-0
lines changed
1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -1718,6 +1718,15 @@ impl<'a> Builder<'a> {
1718
1718
1719
1719
cargo. env ( "RUSTC_VERBOSE" , self . verbosity . to_string ( ) ) ;
1720
1720
1721
+ // Downstream forks of the Rust compiler might want to use a custom libc to add support for
1722
+ // targets that are not yet available upstream. Adding a patch to replace libc with a
1723
+ // custom one would cause compilation errors though, because Cargo would interpret the
1724
+ // custom libc as part of the workspace, and apply the check-cfg lints on it.
1725
+ //
1726
+ // The libc build script emits check-cfg flags only when this environment variable is set,
1727
+ // so this line allows the use of custom libcs.
1728
+ cargo. env ( "LIBC_CHECK_CFG" , "1" ) ;
1729
+
1721
1730
if source_type == SourceType :: InTree {
1722
1731
let mut lint_flags = Vec :: new ( ) ;
1723
1732
// When extending this list, add the new lints to the RUSTFLAGS of the
You can’t perform that action at this time.
0 commit comments