@@ -242,8 +242,15 @@ def run(
242242 args : Sequence [str | Path ],
243243 * ,
244244 env : Optional [dict [str , str ]] = None ,
245+ extra_rustflags : Optional [str ] = None ,
245246 check : bool = True ,
246247) -> sp .CompletedProcess :
248+ if env is None :
249+ env = os .environ .copy ()
250+
251+ if extra_rustflags is not None :
252+ env ["RUSTFLAGS" ] = env .get ("RUSTFLAGS" , "" ) + " " + extra_rustflags
253+
247254 xtrace (args , env = env )
248255 return sp .run (args , env = env , check = check )
249256
@@ -401,6 +408,10 @@ def test_target(cfg: Cfg, target: Target) -> TargetResult:
401408 # Check with breaking changes from musl, including 64-bit time_t on 32-bit
402409 run (cmd , env = env | {"RUST_LIBC_UNSTABLE_MUSL_V1_2_3" : "1" })
403410
411+ if "uclibc" in target_env and target_bits == "32" :
412+ # Equivalent to __USE_FILE_OFFSET64.
413+ run (cmd , extra_rustflags = env ["RUSTFLAGS" ] + "--cfg=libc_unstable_uclibc_file_offset_bits" )
414+
404415 # Test again without default features, i.e. without `std`
405416 run ([* cmd , "--no-default-features" ])
406417 run ([* cmd , "--no-default-features" , "--features=extra_traits" ])
0 commit comments