Skip to content

Commit b6f42d3

Browse files
committed
x86_64_x32 have 64 bit time_t
1 parent 545fc92 commit b6f42d3

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

build.rs

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,5 +314,35 @@ fn is_gnu_time64_abi() -> bool {
314314
}
315315
Err(_) => panic!("CARGO_CFG_TARGET_POINTER_WIDTH not set"),
316316
};
317+
// At this point, we _know_ it is *-*-linux-gnu* with 32 bit
318+
// pointers. Some 64 bit arch still have 32 bit pointers though.
319+
match env::var("TARGET") {
320+
Ok(target) => {
321+
// x86_64-unknown-linux-gnux32 and similar
322+
if target.contains("x86_64") && target.contains("x32") {
323+
return false;
324+
}
325+
}
326+
Err(_) => panic!("TARGET not set"),
327+
}
328+
// let _arch = match env::var("CARGO_CFG_TARGET_ARCH") {
329+
// Ok(arch) => match &arch[..] {
330+
// "aarch64" | "loongarch64" | "mips64" | "mips64r6" | "powerpc64" | "riscv64"
331+
// | "s390x" | "sparc64" | "x86_64"
332+
// if ptrbits == "32" =>
333+
// {
334+
// panic!(
335+
// "Unexpected 32 bit pointer arch {} target {}",
336+
// arch,
337+
// &env::var("TARGET").unwrap()
338+
// );
339+
// }
340+
// // "x86_64" => {
341+
// // return false;
342+
// // }
343+
// _ => arch,
344+
// },
345+
// Err(_) => panic!("CARGO_CFG_TARGET_ARCH not set"),
346+
// };
317347
return true;
318348
}

0 commit comments

Comments
 (0)