-
Couldn't load subscription status.
- Fork 1.2k
Gnu time bits 64 #4433
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Gnu time bits 64 #4433
Conversation
|
It will take me a couple of days to go through everything but from a quick pass this looks great. Thank you for another extremely thorough PR. |
78239f1 to
979222c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everything looks pretty good to me! Mostly some style review.
ci/verify-build.sh
Outdated
| # Test with the equivalent of __USE_TIME_BITS64 | ||
| RUST_LIBC_UNSTABLE_LINUX_TIME_BITS64=1 $cmd | ||
| case "$target" in | ||
| # Test with the equivalent of __FILE_OFFSET_BITS=64 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment could use a small adjustment
|
|
||
| // linux x32 compatibility | ||
| // See https://sourceware.org/bugzilla/show_bug.cgi?id=16437 | ||
| pub struct timespec { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This struct has some complicated config. Maybe it would be easiest to split? Config the current one non-gnu and move the rest to linux/gnu.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
| __glibc_reserved4: crate::__syscall_ulong_t, | ||
| } | ||
|
|
||
| pub struct timex { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe this should be split in two to avoid interleaving fields?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
src/unix/mod.rs
Outdated
| // For 64 bit time on 32 bit linux glibc, suseconds_t is still | ||
| // a 32 bit type. Use i64 instead | ||
| #[cfg(gnu_time_bits64)] | ||
| pub tv_usec: i64, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For consistency, maybe suseconds64_t should be defined then used here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had to make it __suseconds64_t, which is what GNU libc uses.
|
For the above review |
|
Reminder, once the PR becomes ready for a review, use |
|
@rustbot ready |
|
@snogge I think this is fine (will do a final check within a couple of days) but this will need a rebase. |
|
Rebase complete. |
Add new jobs for i686 in test_tier1 and arm and powerpc in test_tier2 where RUST_LIBC_UNSTABLE_GNU_TIME_BITS=64. Use artifact-tag to avoid artifact name collisions.
Set the basic types correctly for gnu_time_bits64 (_TIME_BITS=64 and _FILE_OFFSET_BITS=64).
(backport <rust-lang#4433>) (cherry picked from commit 5f1eb6c)
Add new jobs for i686 in test_tier1 and arm and powerpc in test_tier2 where RUST_LIBC_UNSTABLE_GNU_TIME_BITS=64. Use artifact-tag to avoid artifact name collisions. (backport <rust-lang#4433>) (cherry picked from commit 352274a)
Set the basic types correctly for gnu_time_bits64 (_TIME_BITS=64 and _FILE_OFFSET_BITS=64). (backport <rust-lang#4433>) (cherry picked from commit 739873b)
Set the link names of relevant symbols to use be the same as when a C program is built against GNU libc with -D_TIME_BITS=64 -- which also requires -D_FILE_OFFSET_BITS=64. References: https://github.com/bminor/glibc/blob/e78caeb4ff812ae19d24d65f4d4d48508154277b/io/fcntl.h fcntl on line 190 https://github.com/bminor/glibc/blob/e78caeb4ff812ae19d24d65f4d4d48508154277b/io/sys/poll.h ppoll on line 71 https://github.com/bminor/glibc/blob/e78caeb4ff812ae19d24d65f4d4d48508154277b/io/sys/stat.h difftime on line 86 fstat on line 218 fstat64 on line 249 fstatat on line 270 fstatat64 on line 296 futimens on line 456 gmtime on line 140 gmtime_r on line 163 localtime on line 141 localtime_r on line 167 lstat on line 318 lstat64 on line 318 mktime on line 88 stat on line 214 stat64 on line 214 time on line 85 timegm on line 249 utimensat on line 439 https://github.com/bminor/glibc/blob/e78caeb4ff812ae19d24d65f4d4d48508154277b/io/utime.h utime on line 56 https://github.com/bminor/glibc/blob/e78caeb4ff812ae19d24d65f4d4d48508154277b/misc/sys/ioctl.h ioctl on line 45 https://github.com/bminor/glibc/blob/e78caeb4ff812ae19d24d65f4d4d48508154277b/misc/sys/select.h pselect on line 134 select on line 108 https://github.com/bminor/glibc/blob/e78caeb4ff812ae19d24d65f4d4d48508154277b/posix/glob.h glob on line 154 glob64 on line 174 globfree on line 160 globfree64 on line 180 https://github.com/bminor/glibc/blob/e78caeb4ff812ae19d24d65f4d4d48508154277b/posix/sched.h sched_rr_get_interval on line 81 https://github.com/bminor/glibc/blob/e78caeb4ff812ae19d24d65f4d4d48508154277b/posix/sys/wait.h wait4 on line 163 https://github.com/bminor/glibc/blob/e78caeb4ff812ae19d24d65f4d4d48508154277b/resource/sys/resource.h getrusage on line 93 https://github.com/bminor/glibc/blob/e78caeb4ff812ae19d24d65f4d4d48508154277b/rt/aio.h aio_suspend on line 197 https://github.com/bminor/glibc/blob/e78caeb4ff812ae19d24d65f4d4d48508154277b/rt/mqueue.h mq_timedreceive on line 91 mq_timedsend on line 99 https://github.com/bminor/glibc/blob/e78caeb4ff812ae19d24d65f4d4d48508154277b/signal/signal.h sigtimedwait on line 279 https://github.com/bminor/glibc/blob/e78caeb4ff812ae19d24d65f4d4d48508154277b/socket/sys/socket.h getsockopt on line 260 recvmmsg on line 219 recvmsg on line 219 sendmmsg on line 199 sendmsg on line 178 setsockopt on line 281 https://github.com/bminor/glibc/blob/e78caeb4ff812ae19d24d65f4d4d48508154277b/sysdeps/nptl/pthread.h pthread_cond_timedwait on line 1151 pthread_mutex_timedlock on line 805 https://github.com/bminor/glibc/blob/e78caeb4ff812ae19d24d65f4d4d48508154277b/sysdeps/pthread/semaphore.h sem_timedwait on line 68 https://github.com/bminor/glibc/blob/e78caeb4ff812ae19d24d65f4d4d48508154277b/sysdeps/unix/sysv/linux/bits/time.h clock_adjtime on line 82 https://github.com/bminor/glibc/blob/e78caeb4ff812ae19d24d65f4d4d48508154277b/sysdeps/unix/sysv/linux/sys/epoll.h epoll_pwait2 on line 146 https://github.com/bminor/glibc/blob/e78caeb4ff812ae19d24d65f4d4d48508154277b/sysdeps/unix/sysv/linux/sys/prctl.h prctl on line 45 https://github.com/bminor/glibc/blob/e78caeb4ff812ae19d24d65f4d4d48508154277b/sysdeps/unix/sysv/linux/sys/timerfd.h timerfd_gettime on line 67 timerfd_settime on line 52 https://github.com/bminor/glibc/blob/e78caeb4ff812ae19d24d65f4d4d48508154277b/sysdeps/unix/sysv/linux/sys/timex.h adjtimex on line 70 ntp_adjtime on line 76 ntp_gettime on line 72 https://github.com/bminor/glibc/blob/e78caeb4ff812ae19d24d65f4d4d48508154277b/sysvipc/sys/msg.h msgctl on line 65 https://github.com/bminor/glibc/blob/e78caeb4ff812ae19d24d65f4d4d48508154277b/sysvipc/sys/sem.h semctl on line 55 https://github.com/bminor/glibc/blob/e78caeb4ff812ae19d24d65f4d4d48508154277b/sysvipc/sys/shm.h shmctl on line 53 https://github.com/bminor/glibc/blob/e78caeb4ff812ae19d24d65f4d4d48508154277b/time/sys/time.h adjtime on line 102 futimes on line 200 gettimeofday on line 71 lutimes on line 196 settimeofday on line 98 utimes on line 176 https://github.com/bminor/glibc/blob/e78caeb4ff812ae19d24d65f4d4d48508154277b/time/time.h clock_getres on line 299 clock_gettime on line 302 clock_nanosleep on line 328 clock_settime on line 305 ctime_r on line 206 nanosleep on line 328 timer_gettime on line 366 timer_settime on line 361 (backport <rust-lang#4433>) (cherry picked from commit 4c58e4b)
References: Common definition for _TIME_BITS=64 https://github.com/bminor/glibc/blob/e78caeb4ff812ae19d24d65f4d4d48508154277b/sysdeps/unix/sysv/linux/bits/types/struct_shmid64_ds_helper.h Generic implementation used by x86 and arm: https://github.com/bminor/glibc/blob/e78caeb4ff812ae19d24d65f4d4d48508154277b/sysdeps/unix/sysv/linux/bits/types/struct_shmid_ds.h PowerPC: https://github.com/bminor/glibc/blob/e78caeb4ff812ae19d24d65f4d4d48508154277b/sysdeps/unix/sysv/linux/powerpc/bits/types/struct_shmid_ds.h MIPS: (no changes required) https://github.com/bminor/glibc/blob/e78caeb4ff812ae19d24d65f4d4d48508154277b/sysdeps/unix/sysv/linux/mips/bits/types/struct_shmid_ds.h SPARC: https://github.com/bminor/glibc/blob/e78caeb4ff812ae19d24d65f4d4d48508154277b/sysdeps/unix/sysv/linux/sparc/bits/types/struct_shmid_ds.h (backport <rust-lang#4433>) (cherry picked from commit 831b626)
References: Common definition for _TIME_BITS=64 https://github.com/bminor/glibc/blob/e78caeb4ff812ae19d24d65f4d4d48508154277b/sysdeps/unix/sysv/linux/bits/types/struct_msqid64_ds_helper.h Generic implementation used by x86 and arm: https://github.com/bminor/glibc/blob/e78caeb4ff812ae19d24d65f4d4d48508154277b/sysdeps/unix/sysv/linux/bits/types/struct_msqid_ds.h PowerPC: https://github.com/bminor/glibc/blob/e78caeb4ff812ae19d24d65f4d4d48508154277b/sysdeps/unix/sysv/linux/powerpc/bits/types/struct_msqid_ds.h MIPS: https://github.com/bminor/glibc/blob/e78caeb4ff812ae19d24d65f4d4d48508154277b/sysdeps/unix/sysv/linux/mips/bits/types/struct_msqid_ds.h SPARC: https://github.com/bminor/glibc/blob/e78caeb4ff812ae19d24d65f4d4d48508154277b/sysdeps/unix/sysv/linux/sparc/bits/types/struct_msqid_ds.h (backport <rust-lang#4433>) (cherry picked from commit bb5a84a)
References: Common definition for _TIME_BITS=64 https://github.com/bminor/glibc/blob/e78caeb4ff812ae19d24d65f4d4d48508154277b/sysdeps/unix/sysv/linux/bits/types/struct_semid64_ds_helper.h Generic implementation used by arm: https://github.com/bminor/glibc/blob/e78caeb4ff812ae19d24d65f4d4d48508154277b/sysdeps/unix/sysv/linux/bits/types/struct_semid_ds.h x86: https://github.com/bminor/glibc/blob/e78caeb4ff812ae19d24d65f4d4d48508154277b/sysdeps/unix/sysv/linux/x86/bits/types/struct_semid_ds.h PowerPC: https://github.com/bminor/glibc/blob/e78caeb4ff812ae19d24d65f4d4d48508154277b/sysdeps/unix/sysv/linux/powerpc/bits/types/struct_semid_ds.h MIPS: https://github.com/bminor/glibc/blob/e78caeb4ff812ae19d24d65f4d4d48508154277b/sysdeps/unix/sysv/linux/mips/bits/types/struct_semid_ds.h SPARC: https://github.com/bminor/glibc/blob/e78caeb4ff812ae19d24d65f4d4d48508154277b/sysdeps/unix/sysv/linux/sparc/bits/types/struct_semid_ds.h (backport <rust-lang#4433>) (cherry picked from commit a05a91c)
Use a GNU libc specific version of struct timespec in unix/linux_like/linux/gnu and keep the version in unix for all other unix libc's. Big-endian platforms wants 32 bits of padding before tv_nsec, little-endian after. GNU libc always uses long for tv_nsec. References: https://github.com/bminor/glibc/blob/e78caeb4ff812ae19d24d65f4d4d48508154277b/time/bits/types/struct_timespec.h (backport <rust-lang#4433>) (cherry picked from commit bbaa017)
Will make it easier to adapt for _TIME_BITS=64 (backport <rust-lang#4433>) (cherry picked from commit 87d9e20)
Refrences: https://github.com/bminor/glibc/blob/e78caeb4ff812ae19d24d65f4d4d48508154277b/sysdeps/unix/sysv/linux/bits/timex.h (backport <rust-lang#4433>) (cherry picked from commit 8d0f97b)
For 64 bit time on 32 bit linux glibc timeval.tv_usec is actually __suseconds64_t (64 bits) while suseconds_t is still 32 bits. References: https://github.com/bminor/glibc/blob/e78caeb4ff812ae19d24d65f4d4d48508154277b/time/bits/types/struct_timeval.h (backport <rust-lang#4433>) (cherry picked from commit b63a652)
References: ARM: https://github.com/bminor/glibc/blob/77930e0447e0b37a129db0e13c6c6f5e60a3019e/sysdeps/unix/sysv/linux/arm/bits/struct_stat.h MIPS: https://github.com/bminor/glibc/blob/77930e0447e0b37a129db0e13c6c6f5e60a3019e/sysdeps/unix/sysv/linux/mips/bits/struct_stat.h POWERPC: https://github.com/bminor/glibc/blob/77930e0447e0b37a129db0e13c6c6f5e60a3019e/sysdeps/unix/sysv/linux/powerpc/bits/struct_stat.h SPARC: https://github.com/bminor/glibc/blob/77930e0447e0b37a129db0e13c6c6f5e60a3019e/sysdeps/unix/sysv/linux/sparc/bits/struct_stat.h x86: https://github.com/bminor/glibc/blob/77930e0447e0b37a129db0e13c6c6f5e60a3019e/sysdeps/unix/sysv/linux/x86/bits/struct_stat.h Common definition for _TIME_BITS=64 https://github.com/bminor/glibc/blob/77930e0447e0b37a129db0e13c6c6f5e60a3019e/sysdeps/unix/sysv/linux/bits/struct_stat_time64_helper.h (backport <rust-lang#4433>) (cherry picked from commit 8995e0b)
References: ARM: https://github.com/bminor/glibc/blob/77930e0447e0b37a129db0e13c6c6f5e60a3019e/sysdeps/unix/sysv/linux/arm/bits/struct_stat.h MIPS: https://github.com/bminor/glibc/blob/77930e0447e0b37a129db0e13c6c6f5e60a3019e/sysdeps/unix/sysv/linux/mips/bits/struct_stat.h POWERPC: https://github.com/bminor/glibc/blob/77930e0447e0b37a129db0e13c6c6f5e60a3019e/sysdeps/unix/sysv/linux/powerpc/bits/struct_stat.h SPARC: https://github.com/bminor/glibc/blob/77930e0447e0b37a129db0e13c6c6f5e60a3019e/sysdeps/unix/sysv/linux/sparc/bits/struct_stat.h x86: https://github.com/bminor/glibc/blob/77930e0447e0b37a129db0e13c6c6f5e60a3019e/sysdeps/unix/sysv/linux/x86/bits/struct_stat.h Common definition for _TIME_BITS=64 https://github.com/bminor/glibc/blob/77930e0447e0b37a129db0e13c6c6f5e60a3019e/sysdeps/unix/sysv/linux/bits/struct_stat_time64_helper.h (backport <rust-lang#4433>) (cherry picked from commit 402a851)
| #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] | ||
| pub tv_nsec: c_long, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@snogge it seems like this config made the field disappear on 32-bit, rust-lang/rust#142535 (comment). Any chance you're able to put a fix up soon? If not, I'll post something today.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, hit this in nix-rust/nix#2642
(backport <rust-lang#4433>) (cherry picked from commit 5f1eb6c)
Set the basic types correctly for gnu_time_bits64 (_TIME_BITS=64 and _FILE_OFFSET_BITS=64). (backport <rust-lang#4433>) (cherry picked from commit 739873b)
References: Common definition for _TIME_BITS=64 https://github.com/bminor/glibc/blob/e78caeb4ff812ae19d24d65f4d4d48508154277b/sysdeps/unix/sysv/linux/bits/types/struct_shmid64_ds_helper.h Generic implementation used by x86 and arm: https://github.com/bminor/glibc/blob/e78caeb4ff812ae19d24d65f4d4d48508154277b/sysdeps/unix/sysv/linux/bits/types/struct_shmid_ds.h PowerPC: https://github.com/bminor/glibc/blob/e78caeb4ff812ae19d24d65f4d4d48508154277b/sysdeps/unix/sysv/linux/powerpc/bits/types/struct_shmid_ds.h MIPS: (no changes required) https://github.com/bminor/glibc/blob/e78caeb4ff812ae19d24d65f4d4d48508154277b/sysdeps/unix/sysv/linux/mips/bits/types/struct_shmid_ds.h SPARC: https://github.com/bminor/glibc/blob/e78caeb4ff812ae19d24d65f4d4d48508154277b/sysdeps/unix/sysv/linux/sparc/bits/types/struct_shmid_ds.h (backport <rust-lang#4433>) (cherry picked from commit 831b626)
References: Common definition for _TIME_BITS=64 https://github.com/bminor/glibc/blob/e78caeb4ff812ae19d24d65f4d4d48508154277b/sysdeps/unix/sysv/linux/bits/types/struct_msqid64_ds_helper.h Generic implementation used by x86 and arm: https://github.com/bminor/glibc/blob/e78caeb4ff812ae19d24d65f4d4d48508154277b/sysdeps/unix/sysv/linux/bits/types/struct_msqid_ds.h PowerPC: https://github.com/bminor/glibc/blob/e78caeb4ff812ae19d24d65f4d4d48508154277b/sysdeps/unix/sysv/linux/powerpc/bits/types/struct_msqid_ds.h MIPS: https://github.com/bminor/glibc/blob/e78caeb4ff812ae19d24d65f4d4d48508154277b/sysdeps/unix/sysv/linux/mips/bits/types/struct_msqid_ds.h SPARC: https://github.com/bminor/glibc/blob/e78caeb4ff812ae19d24d65f4d4d48508154277b/sysdeps/unix/sysv/linux/sparc/bits/types/struct_msqid_ds.h (backport <rust-lang#4433>) (cherry picked from commit bb5a84a)
References: Common definition for _TIME_BITS=64 https://github.com/bminor/glibc/blob/e78caeb4ff812ae19d24d65f4d4d48508154277b/sysdeps/unix/sysv/linux/bits/types/struct_semid64_ds_helper.h Generic implementation used by arm: https://github.com/bminor/glibc/blob/e78caeb4ff812ae19d24d65f4d4d48508154277b/sysdeps/unix/sysv/linux/bits/types/struct_semid_ds.h x86: https://github.com/bminor/glibc/blob/e78caeb4ff812ae19d24d65f4d4d48508154277b/sysdeps/unix/sysv/linux/x86/bits/types/struct_semid_ds.h PowerPC: https://github.com/bminor/glibc/blob/e78caeb4ff812ae19d24d65f4d4d48508154277b/sysdeps/unix/sysv/linux/powerpc/bits/types/struct_semid_ds.h MIPS: https://github.com/bminor/glibc/blob/e78caeb4ff812ae19d24d65f4d4d48508154277b/sysdeps/unix/sysv/linux/mips/bits/types/struct_semid_ds.h SPARC: https://github.com/bminor/glibc/blob/e78caeb4ff812ae19d24d65f4d4d48508154277b/sysdeps/unix/sysv/linux/sparc/bits/types/struct_semid_ds.h (backport <rust-lang#4433>) (cherry picked from commit a05a91c)
Use a GNU libc specific version of struct timespec in unix/linux_like/linux/gnu and keep the version in unix for all other unix libc's. Big-endian platforms wants 32 bits of padding before tv_nsec, little-endian after. GNU libc always uses long for tv_nsec. References: https://github.com/bminor/glibc/blob/e78caeb4ff812ae19d24d65f4d4d48508154277b/time/bits/types/struct_timespec.h (backport <rust-lang#4433>) (cherry picked from commit bbaa017)
Will make it easier to adapt for _TIME_BITS=64 (backport <rust-lang#4433>) (cherry picked from commit 87d9e20)
Refrences: https://github.com/bminor/glibc/blob/e78caeb4ff812ae19d24d65f4d4d48508154277b/sysdeps/unix/sysv/linux/bits/timex.h (backport <rust-lang#4433>) (cherry picked from commit 8d0f97b)
For 64 bit time on 32 bit linux glibc timeval.tv_usec is actually __suseconds64_t (64 bits) while suseconds_t is still 32 bits. References: https://github.com/bminor/glibc/blob/e78caeb4ff812ae19d24d65f4d4d48508154277b/time/bits/types/struct_timeval.h (backport <rust-lang#4433>) (cherry picked from commit b63a652)
References: ARM: https://github.com/bminor/glibc/blob/77930e0447e0b37a129db0e13c6c6f5e60a3019e/sysdeps/unix/sysv/linux/arm/bits/struct_stat.h MIPS: https://github.com/bminor/glibc/blob/77930e0447e0b37a129db0e13c6c6f5e60a3019e/sysdeps/unix/sysv/linux/mips/bits/struct_stat.h POWERPC: https://github.com/bminor/glibc/blob/77930e0447e0b37a129db0e13c6c6f5e60a3019e/sysdeps/unix/sysv/linux/powerpc/bits/struct_stat.h SPARC: https://github.com/bminor/glibc/blob/77930e0447e0b37a129db0e13c6c6f5e60a3019e/sysdeps/unix/sysv/linux/sparc/bits/struct_stat.h x86: https://github.com/bminor/glibc/blob/77930e0447e0b37a129db0e13c6c6f5e60a3019e/sysdeps/unix/sysv/linux/x86/bits/struct_stat.h Common definition for _TIME_BITS=64 https://github.com/bminor/glibc/blob/77930e0447e0b37a129db0e13c6c6f5e60a3019e/sysdeps/unix/sysv/linux/bits/struct_stat_time64_helper.h (backport <rust-lang#4433>) (cherry picked from commit 8995e0b)
References: ARM: https://github.com/bminor/glibc/blob/77930e0447e0b37a129db0e13c6c6f5e60a3019e/sysdeps/unix/sysv/linux/arm/bits/struct_stat.h MIPS: https://github.com/bminor/glibc/blob/77930e0447e0b37a129db0e13c6c6f5e60a3019e/sysdeps/unix/sysv/linux/mips/bits/struct_stat.h POWERPC: https://github.com/bminor/glibc/blob/77930e0447e0b37a129db0e13c6c6f5e60a3019e/sysdeps/unix/sysv/linux/powerpc/bits/struct_stat.h SPARC: https://github.com/bminor/glibc/blob/77930e0447e0b37a129db0e13c6c6f5e60a3019e/sysdeps/unix/sysv/linux/sparc/bits/struct_stat.h x86: https://github.com/bminor/glibc/blob/77930e0447e0b37a129db0e13c6c6f5e60a3019e/sysdeps/unix/sysv/linux/x86/bits/struct_stat.h Common definition for _TIME_BITS=64 https://github.com/bminor/glibc/blob/77930e0447e0b37a129db0e13c6c6f5e60a3019e/sysdeps/unix/sysv/linux/bits/struct_stat_time64_helper.h (backport <rust-lang#4433>) (cherry picked from commit 402a851)
Description
Add a new cfg
gnu_time_bits64corresponding to-D_TIME_BITS=64.The cfg can also be enabled by setting the environment variable
RUST_LIBC_UNSTABLE_GNU_TIME_BITS64=1.This is the third part of what was #3175 .
Sources
Sources are listed listed in each commit message.
struct stat64:ARM:
https://github.com/bminor/glibc/blob/77930e0447e0b37a129db0e13c6c6f5e60a3019e/sysdeps/unix/sysv/linux/arm/bits/struct_stat.h
MIPS:
https://github.com/bminor/glibc/blob/77930e0447e0b37a129db0e13c6c6f5e60a3019e/sysdeps/unix/sysv/linux/mips/bits/struct_stat.h
POWERPC:
https://github.com/bminor/glibc/blob/77930e0447e0b37a129db0e13c6c6f5e60a3019e/sysdeps/unix/sysv/linux/powerpc/bits/struct_stat.h
SPARC:
https://github.com/bminor/glibc/blob/77930e0447e0b37a129db0e13c6c6f5e60a3019e/sysdeps/unix/sysv/linux/sparc/bits/struct_stat.h
x86:
https://github.com/bminor/glibc/blob/77930e0447e0b37a129db0e13c6c6f5e60a3019e/sysdeps/unix/sysv/linux/x86/bits/struct_stat.h
Common definition for _TIME_BITS=64
https://github.com/bminor/glibc/blob/77930e0447e0b37a129db0e13c6c6f5e60a3019e/sysdeps/unix/sysv/linux/bits/struct_stat_time64_helper.h
struct stat:ARM:
https://github.com/bminor/glibc/blob/77930e0447e0b37a129db0e13c6c6f5e60a3019e/sysdeps/unix/sysv/linux/arm/bits/struct_stat.h
MIPS:
https://github.com/bminor/glibc/blob/77930e0447e0b37a129db0e13c6c6f5e60a3019e/sysdeps/unix/sysv/linux/mips/bits/struct_stat.h
POWERPC:
https://github.com/bminor/glibc/blob/77930e0447e0b37a129db0e13c6c6f5e60a3019e/sysdeps/unix/sysv/linux/powerpc/bits/struct_stat.h
SPARC:
https://github.com/bminor/glibc/blob/77930e0447e0b37a129db0e13c6c6f5e60a3019e/sysdeps/unix/sysv/linux/sparc/bits/struct_stat.h
x86:
https://github.com/bminor/glibc/blob/77930e0447e0b37a129db0e13c6c6f5e60a3019e/sysdeps/unix/sysv/linux/x86/bits/struct_stat.h
Common definition for _TIME_BITS=64
https://github.com/bminor/glibc/blob/77930e0447e0b37a129db0e13c6c6f5e60a3019e/sysdeps/unix/sysv/linux/bits/struct_stat_time64_helper.h
struct timeval
https://github.com/bminor/glibc/blob/e78caeb4ff812ae19d24d65f4d4d48508154277b/time/bits/types/struct_timeval.h
struct timex:https://github.com/bminor/glibc/blob/e78caeb4ff812ae19d24d65f4d4d48508154277b/sysdeps/unix/sysv/linux/bits/timex.h
struct timespec
https://github.com/bminor/glibc/blob/e78caeb4ff812ae19d24d65f4d4d48508154277b/time/bits/types/struct_timespec.h
struct semid_ds:Common definition for _TIME_BITS=64
https://github.com/bminor/glibc/blob/e78caeb4ff812ae19d24d65f4d4d48508154277b/sysdeps/unix/sysv/linux/bits/types/struct_semid64_ds_helper.h
Generic implementation used by arm:
https://github.com/bminor/glibc/blob/e78caeb4ff812ae19d24d65f4d4d48508154277b/sysdeps/unix/sysv/linux/bits/types/struct_semid_ds.h
x86:
https://github.com/bminor/glibc/blob/e78caeb4ff812ae19d24d65f4d4d48508154277b/sysdeps/unix/sysv/linux/x86/bits/types/struct_semid_ds.h
PowerPC:
https://github.com/bminor/glibc/blob/e78caeb4ff812ae19d24d65f4d4d48508154277b/sysdeps/unix/sysv/linux/powerpc/bits/types/struct_semid_ds.h
MIPS:
https://github.com/bminor/glibc/blob/e78caeb4ff812ae19d24d65f4d4d48508154277b/sysdeps/unix/sysv/linux/mips/bits/types/struct_semid_ds.h
SPARC:
https://github.com/bminor/glibc/blob/e78caeb4ff812ae19d24d65f4d4d48508154277b/sysdeps/unix/sysv/linux/sparc/bits/types/struct_semid_ds.h
struct msqid_ds:Common definition for _TIME_BITS=64
https://github.com/bminor/glibc/blob/e78caeb4ff812ae19d24d65f4d4d48508154277b/sysdeps/unix/sysv/linux/bits/types/struct_msqid64_ds_helper.h
Generic implementation used by x86 and arm:
https://github.com/bminor/glibc/blob/e78caeb4ff812ae19d24d65f4d4d48508154277b/sysdeps/unix/sysv/linux/bits/types/struct_msqid_ds.h
PowerPC:
https://github.com/bminor/glibc/blob/e78caeb4ff812ae19d24d65f4d4d48508154277b/sysdeps/unix/sysv/linux/powerpc/bits/types/struct_msqid_ds.h
MIPS:
https://github.com/bminor/glibc/blob/e78caeb4ff812ae19d24d65f4d4d48508154277b/sysdeps/unix/sysv/linux/mips/bits/types/struct_msqid_ds.h
SPARC:
https://github.com/bminor/glibc/blob/e78caeb4ff812ae19d24d65f4d4d48508154277b/sysdeps/unix/sysv/linux/sparc/bits/types/struct_msqid_ds.h
struct shmid_ds:Common definition for _TIME_BITS=64
https://github.com/bminor/glibc/blob/e78caeb4ff812ae19d24d65f4d4d48508154277b/sysdeps/unix/sysv/linux/bits/types/struct_shmid64_ds_helper.h
Generic implementation used by x86 and arm:
https://github.com/bminor/glibc/blob/e78caeb4ff812ae19d24d65f4d4d48508154277b/sysdeps/unix/sysv/linux/bits/types/struct_shmid_ds.h
PowerPC:
https://github.com/bminor/glibc/blob/e78caeb4ff812ae19d24d65f4d4d48508154277b/sysdeps/unix/sysv/linux/powerpc/bits/types/struct_shmid_ds.h
MIPS: (no changes required)
https://github.com/bminor/glibc/blob/e78caeb4ff812ae19d24d65f4d4d48508154277b/sysdeps/unix/sysv/linux/mips/bits/types/struct_shmid_ds.h
SPARC:
https://github.com/bminor/glibc/blob/e78caeb4ff812ae19d24d65f4d4d48508154277b/sysdeps/unix/sysv/linux/sparc/bits/types/struct_shmid_ds.h
glibc symbols:
https://github.com/bminor/glibc/blob/e78caeb4ff812ae19d24d65f4d4d48508154277b/io/fcntl.h
fcntlon line 190https://github.com/bminor/glibc/blob/e78caeb4ff812ae19d24d65f4d4d48508154277b/io/sys/poll.h
ppollon line 71https://github.com/bminor/glibc/blob/e78caeb4ff812ae19d24d65f4d4d48508154277b/io/sys/stat.h
difftimeon line 86fstaton line 218fstat64on line 249fstataton line 270fstatat64on line 296futimenson line 456gmtimeon line 140gmtime_ron line 163localtimeon line 141localtime_ron line 167lstaton line 318lstat64on line 318mktimeon line 88staton line 214stat64on line 214timeon line 85timegmon line 249utimensaton line 439https://github.com/bminor/glibc/blob/e78caeb4ff812ae19d24d65f4d4d48508154277b/io/utime.h
utimeon line 56https://github.com/bminor/glibc/blob/e78caeb4ff812ae19d24d65f4d4d48508154277b/misc/sys/ioctl.h
ioctlon line 45https://github.com/bminor/glibc/blob/e78caeb4ff812ae19d24d65f4d4d48508154277b/misc/sys/select.h
pselecton line 134selecton line 108https://github.com/bminor/glibc/blob/e78caeb4ff812ae19d24d65f4d4d48508154277b/posix/glob.h
globon line 154glob64on line 174globfreeon line 160globfree64on line 180https://github.com/bminor/glibc/blob/e78caeb4ff812ae19d24d65f4d4d48508154277b/posix/sched.h
sched_rr_get_intervalon line 81https://github.com/bminor/glibc/blob/e78caeb4ff812ae19d24d65f4d4d48508154277b/posix/sys/wait.h
wait4on line 163https://github.com/bminor/glibc/blob/e78caeb4ff812ae19d24d65f4d4d48508154277b/resource/sys/resource.h
getrusageon line 93https://github.com/bminor/glibc/blob/e78caeb4ff812ae19d24d65f4d4d48508154277b/rt/aio.h
aio_suspendon line 197https://github.com/bminor/glibc/blob/e78caeb4ff812ae19d24d65f4d4d48508154277b/rt/mqueue.h
mq_timedreceiveon line 91mq_timedsendon line 99https://github.com/bminor/glibc/blob/e78caeb4ff812ae19d24d65f4d4d48508154277b/signal/signal.h
sigtimedwaiton line 279https://github.com/bminor/glibc/blob/e78caeb4ff812ae19d24d65f4d4d48508154277b/socket/sys/socket.h
getsockopton line 260recvmmsgon line 219recvmsgon line 219sendmmsgon line 199sendmsgon line 178setsockopton line 281https://github.com/bminor/glibc/blob/e78caeb4ff812ae19d24d65f4d4d48508154277b/sysdeps/nptl/pthread.h
pthread_cond_timedwaiton line 1151pthread_mutex_timedlockon line 805https://github.com/bminor/glibc/blob/e78caeb4ff812ae19d24d65f4d4d48508154277b/sysdeps/pthread/semaphore.h
sem_timedwaiton line 68https://github.com/bminor/glibc/blob/e78caeb4ff812ae19d24d65f4d4d48508154277b/sysdeps/unix/sysv/linux/bits/time.h
clock_adjtimeon line 82https://github.com/bminor/glibc/blob/e78caeb4ff812ae19d24d65f4d4d48508154277b/sysdeps/unix/sysv/linux/sys/epoll.h
epoll_pwait2on line 146https://github.com/bminor/glibc/blob/e78caeb4ff812ae19d24d65f4d4d48508154277b/sysdeps/unix/sysv/linux/sys/prctl.h
prctlon line 45https://github.com/bminor/glibc/blob/e78caeb4ff812ae19d24d65f4d4d48508154277b/sysdeps/unix/sysv/linux/sys/timerfd.h
timerfd_gettimeon line 67timerfd_settimeon line 52https://github.com/bminor/glibc/blob/e78caeb4ff812ae19d24d65f4d4d48508154277b/sysdeps/unix/sysv/linux/sys/timex.h
adjtimexon line 70ntp_adjtimeon line 76ntp_gettimeon line 72https://github.com/bminor/glibc/blob/e78caeb4ff812ae19d24d65f4d4d48508154277b/sysvipc/sys/msg.h
msgctlon line 65https://github.com/bminor/glibc/blob/e78caeb4ff812ae19d24d65f4d4d48508154277b/sysvipc/sys/sem.h
semctlon line 55https://github.com/bminor/glibc/blob/e78caeb4ff812ae19d24d65f4d4d48508154277b/sysvipc/sys/shm.h
shmctlon line 53https://github.com/bminor/glibc/blob/e78caeb4ff812ae19d24d65f4d4d48508154277b/time/sys/time.h
adjtimeon line 102futimeson line 200gettimeofdayon line 71lutimeson line 196settimeofdayon line 98utimeson line 176https://github.com/bminor/glibc/blob/e78caeb4ff812ae19d24d65f4d4d48508154277b/time/time.h
clock_getreson line 299clock_gettimeon line 302clock_nanosleepon line 328clock_settimeon line 305ctime_ron line 206nanosleepon line 328timer_gettimeon line 366timer_settimeon line 361Checklist
libc-test/semverhave been updated*LASTor*MAXareincluded (see rust-lang/libc#3131)
cd libc-test && cargo test --target mytarget);especially relevant for platforms that may not be checked in CI
I've tested this as widely as possible, but I have not been able to
run the sparc tests. mips and powerpc tests have been run on rust
1.83 using the yocto project, but it's not a fully compatible
environment for some reason.