@@ -3656,6 +3656,9 @@ fn test_linux(target: &str) {
3656
3656
let wasm32 = target. contains ( "wasm32" ) ;
3657
3657
let uclibc = target. contains ( "uclibc" ) ;
3658
3658
3659
+ let musl_v1_2_3 = env:: var ( "RUST_LIBC_UNSTABLE_MUSL_V1_2_3" ) . is_ok ( ) ;
3660
+ let old_musl = musl && !musl_v1_2_3;
3661
+
3659
3662
let mut cfg = ctest_cfg ( ) ;
3660
3663
cfg. define ( "_GNU_SOURCE" , None ) ;
3661
3664
// This macro re-defines fscanf,scanf,sscanf to link to the symbols that are
@@ -4222,9 +4225,9 @@ fn test_linux(target: &str) {
4222
4225
if name == "PR_GET_MDWE" || name == "PR_MDWE_NO_INHERIT" || name == "PR_MDWE_REFUSE_EXEC_GAIN" || name == "PR_SET_MDWE" {
4223
4226
return true ;
4224
4227
}
4225
- // FIXME(musl): Requires musl >= 1.2
4226
- if name == "SO_PREFER_BUSY_POLL"
4227
- || name == "SO_BUSY_POLL_BUDGET"
4228
+ // Requires musl >= 1.2
4229
+ if old_musl && ( name == "SO_PREFER_BUSY_POLL"
4230
+ || name == "SO_BUSY_POLL_BUDGET" )
4228
4231
{
4229
4232
return true ;
4230
4233
}
@@ -4648,18 +4651,18 @@ fn test_linux(target: &str) {
4648
4651
"getnameinfo" if uclibc => true ,
4649
4652
4650
4653
// FIXME(musl): This needs musl 1.2.2 or later.
4651
- "gettid" if musl => true ,
4654
+ "gettid" if old_musl => true ,
4652
4655
4653
4656
// Needs glibc 2.33 or later.
4654
4657
"mallinfo2" => true ,
4655
4658
4656
- "reallocarray" if musl => true ,
4659
+ "reallocarray" if old_musl => true ,
4657
4660
4658
4661
// Not defined in uclibc as of 1.0.34
4659
4662
"gettid" if uclibc => true ,
4660
4663
4661
4664
// Needs musl 1.2.3 or later.
4662
- "pthread_getname_np" if musl => true ,
4665
+ "pthread_getname_np" if old_musl => true ,
4663
4666
4664
4667
// pthread_sigqueue uses sigval, which was initially declared
4665
4668
// as a struct but should be defined as a union. However due
0 commit comments