-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Non-LFS functions on 32-bit platforms #94173
Comments
mmap is a non-LFS function and due to its usage here will appear in binaries produced by rustc. This is relevant to rust-lang/rust#94173.
mmap is a non-LFS function and due to its usage here will appear in binaries produced by rustc. This is relevant to rust-lang/rust#94173.
On Linux, use mmap64, open64, openat64, and sendfile64 in place of their non-LFS counterparts. This is relevant to rust-lang#94173. With these changes (together with rust-lang/backtrace-rs#501), the simple binaries I produce with rustc seem to have no non-LFS functions, so maybe rust-lang#94173 is fixed. But I can't be sure if I've missed something and maybe some non-LFS functions could sneak in somehow.
Use more LFS functions. On Linux, use mmap64, open64, openat64, and sendfile64 in place of their non-LFS counterparts. This is relevant to rust-lang#94173. With these changes (together with rust-lang/backtrace-rs#501), the simple binaries I produce with rustc seem to have no non-LFS functions, so maybe rust-lang#94173 is fixed. But I can't be sure if I've missed something and maybe some non-LFS functions could sneak in somehow.
mmap is a non-LFS function and due to its usage here will appear in binaries produced by rustc. This is relevant to rust-lang/rust#94173.
This currently breaks musl libc builds at the linking stage. Please consider |
see rust-lang#94173 and commit 27011b4.
std: only use LFS function on glibc see rust-lang#94173 and commit 27011b4.
mmap is a non-LFS function and due to its usage here will appear in binaries produced by rustc. This is relevant to rust-lang/rust#94173.
Before: nm hello | grep 'mmap'
U mmap64@GLIBC_2.2.5
U mmap@GLIBC_2.2.5 After #113176: nm hello | grep 'mmap'
U mmap64@GLIBC_2.2.5 That PR brings in rust-lang/backtrace-rs#501 which should be the last subject of concern for Rust binaries, as it should have the correct fix for both glibc and musl. The libc alias shim should serve for addressing the immediate problem for code we emit as part of our bindings, and we can address how we want to update to move with any future libc changes as a separate subject. Please let me know if we are actually secretly missing something, or reopen this issue if for some reason that PR fails. |
Also as a remark on possible false positives: we will likely still include a reference to |
On Linux, use mmap64, open64, openat64, and sendfile64 in place of their non-LFS counterparts. This is relevant to rust-lang#94173. With these changes (together with rust-lang/backtrace-rs#501), the simple binaries I produce with rustc seem to have no non-LFS functions, so maybe rust-lang#94173 is fixed. But I can't be sure if I've missed something and maybe some non-LFS functions could sneak in somehow.
see rust-lang#94173 and commit 27011b4.
On Linux, use mmap64, open64, openat64, and sendfile64 in place of their non-LFS counterparts. This is relevant to rust-lang#94173. With these changes (together with rust-lang/backtrace-rs#501), the simple binaries I produce with rustc seem to have no non-LFS functions, so maybe rust-lang#94173 is fixed. But I can't be sure if I've missed something and maybe some non-LFS functions could sneak in somehow.
see rust-lang#94173 and commit 27011b4.
On Linux, use mmap64, open64, openat64, and sendfile64 in place of their non-LFS counterparts. This is relevant to rust-lang#94173. With these changes (together with rust-lang/backtrace-rs#501), the simple binaries I produce with rustc seem to have no non-LFS functions, so maybe rust-lang#94173 is fixed. But I can't be sure if I've missed something and maybe some non-LFS functions could sneak in somehow.
see rust-lang#94173 and commit 27011b4.
As of 1.58.1 rustc compiles with non-LFS functions on 32-bit platforms.
Linux kernel have special 64-bit versions of some important syscalls that 32-bit programs could use if they want to access large files. In C (and glibc) there is transparent function & syscall replacement if program is compiled with
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
.Example list of functions that should not be used and replaced with their 64-bit versions if LFS is enabled:
fallocate fcntl fopen fstat fstatfs ftruncate getrlimit glob globfree lseek lstat mkstemp mmap open openat posix_fadvise posix_fallocate pread pwrite readdir setrlimit stat statfs
. For example, instead ofopenat
should be usedopenat64
.There are related issues:
But their solutions are seems incomplete.
Simplest reproducer:
As you can see there is
open
present which mean that there is still non-LFS compliant usage.The text was updated successfully, but these errors were encountered: