Skip to content

Commit 0ca05d1

Browse files
committed
chore: wip
1 parent e7b9bed commit 0ca05d1

2 files changed

Lines changed: 14 additions & 6 deletions

File tree

build.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -133,11 +133,6 @@ fn main() {
133133
}
134134
}
135135

136-
let uclibc_use_time64 = env_flag("CARGO_CFG_LIBC_UNSTABLE_UCLIBC_TIME64");
137-
if target_env == "uclibc" && uclibc_use_time64 {
138-
set_cfg("linux_time_bits64");
139-
}
140-
141136
let linux_time_bits64 = env::var("RUST_LIBC_UNSTABLE_LINUX_TIME_BITS64").is_ok();
142137
println!("cargo:rerun-if-env-changed=RUST_LIBC_UNSTABLE_LINUX_TIME_BITS64");
143138
if linux_time_bits64 {
@@ -182,7 +177,9 @@ fn main() {
182177
}
183178
}
184179

185-
if target_env == "uclibc" && env::var("CARGO_CFG_LIBC_UNSTABLE_UCLIBC_FILE_OFFSET_BITS").is_ok()
180+
if target_env == "uclibc"
181+
&& target_ptr_width == "32"
182+
&& env::var("CARGO_CFG_LIBC_UNSTABLE_UCLIBC_FILE_OFFSET_BITS").is_ok()
186183
{
187184
set_cfg("uclibc_file_offset_bits64");
188185
}

ci/verify-build.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)