@@ -70,9 +70,8 @@ fn main() {
7070 //
7171 // On CI, we detect the actual FreeBSD version and match its ABI exactly,
7272 // running tests to ensure that the ABI is correct.
73- println ! ( "cargo:rerun-if-env-changed=RUST_LIBC_UNSTABLE_FREEBSD_VERSION" ) ;
7473 // Allow overriding the default version for testing
75- let which_freebsd = if let Ok ( version) = env:: var ( "RUST_LIBC_UNSTABLE_FREEBSD_VERSION " ) {
74+ let which_freebsd = if let Ok ( version) = env:: var ( "CARGO_CFG_LIBC_UNSTABLE_FREEBSD_VERSION " ) {
7675 let vers = version. parse ( ) . unwrap ( ) ;
7776 println ! ( "cargo:warning=setting FreeBSD version to {vers}" ) ;
7877 vers
@@ -104,8 +103,7 @@ fn main() {
104103 _ => ( ) ,
105104 }
106105
107- let mut musl_v1_2_3 = env_flag ( "RUST_LIBC_UNSTABLE_MUSL_V1_2_3" ) ;
108- println ! ( "cargo:rerun-if-env-changed=RUST_LIBC_UNSTABLE_MUSL_V1_2_3" ) ;
106+ let mut musl_v1_2_3 = env_flag ( "CARGO_CFG_LIBC_UNSTABLE_MUSL_V1_2_3" ) ;
109107
110108 // OpenHarmony uses a fork of the musl libc
111109 let musl = target_env == "musl" || target_env == "ohos" ;
@@ -123,8 +121,6 @@ fn main() {
123121 }
124122 }
125123
126- println ! ( "cargo:rerun-if-env-changed=RUST_LIBC_UNSTABLE_GNU_FILE_OFFSET_BITS" ) ;
127- println ! ( "cargo:rerun-if-env-changed=RUST_LIBC_UNSTABLE_GNU_TIME_BITS" ) ;
128124 if target_env == "gnu"
129125 && target_os == "linux"
130126 && target_ptr_width == "32"
@@ -133,25 +129,33 @@ fn main() {
133129 {
134130 let defaultbits = "32" . to_string ( ) ;
135131 let ( timebits, filebits) = match (
136- env:: var ( "RUST_LIBC_UNSTABLE_GNU_TIME_BITS " ) ,
137- env:: var ( "RUST_LIBC_UNSTABLE_GNU_FILE_OFFSET_BITS " ) ,
132+ env:: var ( "CARGO_CFG_LIBC_UNSTABLE_GNU_TIME_BITS " ) ,
133+ env:: var ( "CARGO_CFG_LIBC_UNSTABLE_GNU_FILE_OFFSET_BITS " ) ,
138134 ) {
139- ( Ok ( _) , Ok ( _) ) => panic ! ( "Do not set both RUST_LIBC_UNSTABLE_GNU_TIME_BITS and RUST_LIBC_UNSTABLE_GNU_FILE_OFFSET_BITS" ) ,
135+ ( Ok ( _) , Ok ( _) ) => panic ! (
136+ "Do not set both `libc_unstable_gnu_time_bits` and \
137+ `libc_unstable_gnu_file_offset_bits`"
138+ ) ,
140139 ( Err ( _) , Err ( _) ) => ( defaultbits. clone ( ) , defaultbits. clone ( ) ) ,
141140 ( Ok ( tb) , Err ( _) ) if tb == "64" => ( tb. clone ( ) , tb. clone ( ) ) ,
142141 ( Ok ( tb) , Err ( _) ) if tb == "32" => ( tb, defaultbits. clone ( ) ) ,
143- ( Ok ( _) , Err ( _) ) => panic ! ( "Invalid value for RUST_LIBC_UNSTABLE_GNU_TIME_BITS, must be 32 or 64" ) ,
142+ ( Ok ( _) , Err ( _) ) => {
143+ panic ! ( "Invalid value for libc_unstable_gnu_time_bits, must be 32 or 64" )
144+ }
144145 ( Err ( _) , Ok ( fb) ) if fb == "32" || fb == "64" => ( defaultbits. clone ( ) , fb) ,
145- ( Err ( _) , Ok ( _) ) => panic ! ( "Invalid value for RUST_LIBC_UNSTABLE_GNU_FILE_OFFSET_BITS, must be 32 or 64" ) ,
146+ ( Err ( _) , Ok ( _) ) => {
147+ panic ! ( "Invalid value for `libc_unstable_gnu_file_offset_bits`, must be 32 or 64" )
148+ }
146149 } ;
147150 let valid_bits = [ "32" , "64" ] ;
148151 assert ! (
149152 valid_bits. contains( & filebits. as_str( ) ) && valid_bits. contains( & timebits. as_str( ) ) ,
150- "Invalid value for RUST_LIBC_UNSTABLE_GNU_TIME_BITS or RUST_LIBC_UNSTABLE_GNU_FILE_OFFSET_BITS, must be 32, 64 or unset"
153+ "Invalid value for `libc_unstable_gnu_time_bits` or `libc_unstable_gnu_file_offset_bits`, \
154+ must be 32, 64 or unset"
151155 ) ;
152156 assert ! (
153157 !( filebits == "32" && timebits == "64" ) ,
154- "RUST_LIBC_UNSTABLE_GNU_FILE_OFFSET_BITS must be 64 or unset if RUST_LIBC_UNSTABLE_GNU_TIME_BITS is 64"
158+ "`libc_unstable_gnu_file_offset_bits` must be 64 or unset if `libc_unstable_gnu_time_bits` is 64"
155159 ) ;
156160 if timebits == "64" {
157161 set_cfg ( "linux_time_bits64" ) ;
0 commit comments