@@ -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
@@ -4226,9 +4229,9 @@ fn test_linux(target: &str) {
4226
4229
if name == "PR_GET_MDWE" || name == "PR_MDWE_NO_INHERIT" || name == "PR_MDWE_REFUSE_EXEC_GAIN" || name == "PR_SET_MDWE" {
4227
4230
return true ;
4228
4231
}
4229
- // FIXME(musl): Requires musl >= 1.2
4230
- if name == "SO_PREFER_BUSY_POLL"
4231
- || name == "SO_BUSY_POLL_BUDGET"
4232
+ // Requires musl >= 1.2
4233
+ if old_musl && ( name == "SO_PREFER_BUSY_POLL"
4234
+ || name == "SO_BUSY_POLL_BUDGET" )
4232
4235
{
4233
4236
return true ;
4234
4237
}
@@ -4657,18 +4660,18 @@ fn test_linux(target: &str) {
4657
4660
"getnameinfo" if uclibc => true ,
4658
4661
4659
4662
// FIXME(musl): This needs musl 1.2.2 or later.
4660
- "gettid" if musl => true ,
4663
+ "gettid" if old_musl => true ,
4661
4664
4662
4665
// Needs glibc 2.33 or later.
4663
4666
"mallinfo2" => true ,
4664
4667
4665
- "reallocarray" if musl => true ,
4668
+ "reallocarray" if old_musl => true ,
4666
4669
4667
4670
// Not defined in uclibc as of 1.0.34
4668
4671
"gettid" if uclibc => true ,
4669
4672
4670
4673
// Needs musl 1.2.3 or later.
4671
- "pthread_getname_np" if musl => true ,
4674
+ "pthread_getname_np" if old_musl => true ,
4672
4675
4673
4676
// pthread_sigqueue uses sigval, which was initially declared
4674
4677
// as a struct but should be defined as a union. However due
0 commit comments