Add new cfg gnu_file_offset_bits64 corresponding to _FILE_OFFSET_BITS=64#4345
Add new cfg gnu_file_offset_bits64 corresponding to _FILE_OFFSET_BITS=64#4345tgross35 merged 21 commits intorust-lang:mainfrom
Conversation
tgross35
left a comment
There was a problem hiding this comment.
I haven't checked the type changes in detail but this looks pretty good to me. Left a handful of comments mostly related to configuration.
Thank you so much for working on this!
aba1e20 to
cf9c316
Compare
|
@rustbot ready |
tgross35
left a comment
There was a problem hiding this comment.
I left one nit and I think it needs a rebase, but overall this looks great to me.
| set_cfg("gnu_file_offset_bits64"); | ||
| } | ||
| } | ||
| _ => {} |
There was a problem hiding this comment.
Could you add something like Ok(val) if val != "32" => panic!("RUST_LIBC_UNSTABLE_GNU_FILE_OFFSET_BITS may only be set to '32' or '64'),?
There was a problem hiding this comment.
I've added that check for both build.rs and libc-test/build.rs.
cf9c316 to
125f4bf
Compare
|
@rustbot ready |
tgross35
left a comment
There was a problem hiding this comment.
Thanks for moving this along!
|
...I have no idea why ctest is suddenly failing on musl. Probably not related to this PR. |
Less commands makes for a cleaner `set -x` log. And it is more efficient.
Variables set with `env` in the matrix never propagated into the environment. Add a step in test_tier1 and test_tier2 that reads the env context from the matrix and adds the variables to the environment used by later steps.
The `Create I artifacts` step is always run, whether earlier steps succeeds or not. But the upload step would only run if all preceeding steps wer successfull. Add a conditional to always run except if artifact creation failed.
125f4bf to
4a7c9a9
Compare
|
Discussion about off_t and time_t in 32-bit archs happens here right now: https://rust-lang.zulipchat.com/#narrow/channel/219381-t-libs/topic/Questions.20and.20polls.20about.20.60libc.60.201.2E0 |
Less commands makes for a cleaner `set -x` log. And it is more efficient. (backport <rust-lang#4345>) (cherry picked from commit afa5c65)
Variables set with `env` in the matrix never propagated into the environment. Add a step in test_tier1 and test_tier2 that reads the env context from the matrix and adds the variables to the environment used by later steps. (backport <rust-lang#4345>) (cherry picked from commit 84a04a1)
The `Create I artifacts` step is always run, whether earlier steps succeeds or not. But the upload step would only run if all preceeding steps wer successfull. Add a conditional to always run except if artifact creation failed. (backport <rust-lang#4345>) (cherry picked from commit f10e8e4)
(backport <rust-lang#4345>) (cherry picked from commit a184436)
Add new jobs for i686 in test_tier1 and arm and powerpc in test_tier2 where RUST_LIBC_UNSTABLE_GNU_FILE_OFFSET_BITS=64. Use artifact-tag to avoid artifact name collisions. (backport <rust-lang#4345>) (cherry picked from commit 874e399)
Set the basic types correctly for gnu_file_offset_bits64 (_FILE_OFFSET_BITS=64). (backport <rust-lang#4345>) (cherry picked from commit f44fdc1)
gnu_file_offset_bits64 means _FILE_OFFSET_BITS=64. (backport <rust-lang#4345>) (cherry picked from commit 862ba8a)
(backport <rust-lang#4345>) (cherry picked from commit 6ed2bc8)
(backport <rust-lang#4345>) (cherry picked from commit 5c5c364)
When _FILE_OFFSET_BITS=64, glibc redirects some function calls to 64 bit versions. These symbols are sometimes the public LFS variants, sometimes hidden variants. (backport <rust-lang#4345>) (cherry picked from commit 2b4fafb)
Like mips, the stat struct will become different once support for gnu_file_offset_bits64 is added. (backport <rust-lang#4345>) (cherry picked from commit 0c6d56c)
Like mips and powerpc, the stat struct will become different once support for gnu_file_offset_bits64 is added. (backport <rust-lang#4345>) (cherry picked from commit e134959)
Change the __padX members in b32/mod.rs from short to uint even though they are actually unsigned short in C. Using unsigned int will give the same alignment, and make the struct equivalent to stat64 when gnu_file_offset_bits64 is set. (backport <rust-lang#4345>) (cherry picked from commit 5a5abc2)
(backport <rust-lang#4345>) (cherry picked from commit 96e81e7)
(backport <rust-lang#4345>) (cherry picked from commit 169d50b)
Struct stat and stat64 needs to match when gnu_file_offset_bits64 is set. (backport <rust-lang#4345>) (cherry picked from commit 22ac02c)
The __f_unused field should be the same in statvfs and statvfs64 (where it was already included) as can be seen in https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/unix/sysv/linux/bits/statvfs.h;h=1aed2f54aa86e43ac1c1d3a33197b3232be76580;hb=HEAD (backport <rust-lang#4345>) (cherry picked from commit 131efe9)
(backport <rust-lang#4345>) (cherry picked from commit c1e4812)
(backport <rust-lang#4345>) (cherry picked from commit 872642a)
(backport <rust-lang#4345>) (cherry picked from commit 7ba56f2)
(backport <rust-lang#4345>) (cherry picked from commit 4a7c9a9)
Description
Add a new cfg
gnu_file_offset_bits64corresponding to-D_FILE_OFFSET_BITS=64.The cfg can also be enabled by setting the environment variable
RUST_LIBC_UNSTABLE_GNU_FILE_OFFSET_BITS64=1.This is the second part of what was #3175 .
Sources
off_tino_tblkcnt_tfsblkcnt_tfsfilcnt_trlim_tF_GETLKF_SETLKandF_SETLKWRLIM_INFINITYgetrlimit,setrlimit,prlimitpread,pwrite,preadv2,pwritev2aio_read,aio_write,aio_error,aio_return,aio_cancel,lio_listiofallocate,posix_fallocate,posix_fadvise,open,creat,fcntl,lockf,openatglob,globfreemkstemps,mkostemp,mkostemps,mkstempsendfilestatfs,fstatfsfopen,freopen,tmpfile,fgetpos,fsetpos,fseeko,ftellostat,fstat,fstatat,lstatstatfs,fstatfsreaddir,readdir_rlseek,pread,pwrite, truncate,ftruncatemmapstruct statvfs,struct fstatvfsstruct stat,struct stat64struct statfs,struct statfs64struct fpos_t,struct fpos64_tstruct aiocbstruct flockChecklist
libc-test/semverhave been updated*LASTor*MAXareincluded (see #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.85 using the yocto project, but it's not a fully compatible
environment for some reason.