Skip to content

Commit e38313d

Browse files
committed
build.rs: Enable linux_time_bits64 with RUST_LIBC_UNSTABLE_LINUX_TIME_BITS64
Verify linux_time_bits64 from verify-build.sh.
1 parent e2418ec commit e38313d

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

build.rs

+5
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ fn main() {
4141
let rustc_dep_of_std = env::var("CARGO_FEATURE_RUSTC_DEP_OF_STD").is_ok();
4242
let libc_ci = env::var("LIBC_CI").is_ok();
4343
let libc_check_cfg = env::var("LIBC_CHECK_CFG").is_ok() || rustc_minor_ver >= 80;
44+
let linux_time_bits64 = env::var("RUST_LIBC_UNSTABLE_LINUX_TIME_BITS64").is_ok();
4445

4546
// The ABI of libc used by std is backward compatible with FreeBSD 12.
4647
// The ABI of libc from crates.io is backward compatible with FreeBSD 12.
@@ -70,6 +71,10 @@ fn main() {
7071
Some(_) | None => (),
7172
}
7273

74+
if linux_time_bits64 {
75+
set_cfg("linux_time_bits64");
76+
}
77+
7378
// On CI: deny all warnings
7479
if libc_ci {
7580
set_cfg("libc_deny_warnings");

ci/verify-build.sh

+5
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,11 @@ test_target() {
6565
$cmd --features const-extern-fn
6666
$cmd --features extra_traits
6767

68+
if [ "$os" = "linux" ]; then
69+
# Test with the equivalent of __USE_TIME_BITS64
70+
RUST_LIBC_UNSTABLE_LINUX_TIME_BITS64=1 $cmd
71+
fi
72+
6873
# Test again without default features, i.e. without "std"
6974
$cmd --no-default-features
7075
$cmd --no-default-features --features extra_traits

0 commit comments

Comments
 (0)