-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Use pre-ino64 FreeBSD symbols to resolve binary compatibility. #937
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
Conversation
This follows the same method as other platforms like OSX and NetBSD. This will fix rustup and building from git (once libc is updated for bootstrap) on FreeBSD12 post-ino64 in freebsd/freebsd-src@f713b08. It also avoids having to hotpatch the stage0 compiler, and HOME/.cargo libc files on FreeBSD12 to build rust. The only real pitfall is that this will prevent interaction with inodes that have an ino_t above the 32-bit limit due to truncation. On the other hand Rust won't work at all on 12 without doing this currently. In general it should not be a problem for users and if they need 64-bit ino_t they can use a patched libc, rather than the current state of affairs in requiring a patched libc to use Rust on 12. A better, or complementary, approach would be something like proposed in rust-lang/rfcs#2048 to allow targetting a specific version of FreeBSD. This would allow Rust to default to this compatibility mode by targetting FreeBSD10 and still allow targetting FreeBSD12 for 64-bit ino_t. The symbol versions used were taken from the old version in freebsd/freebsd-src@f713b08#diff-61a32fcfb7ecd4517665fed591813c57 and freebsd/freebsd-src@f713b08#diff-7f67ccf8b5f44ff2f54eaab0207abb8d. The scope of functions versioned here differs from other platforms as not all structs were modified that were on others, such as DIR for `opendir`, `telldir`, etc. Only functions using dirent, stat, glob_t, and dev_t need the changes. Fixes rust-lang/rust#42681
(rust_highfive has picked a reviewer for you, use r? to override) |
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.
LGTM. This covers every function in FreeBSD's libc that was changed in 12, and that is already bound by the libc crate.
📌 Commit 78f9322 has been approved by |
Use pre-ino64 FreeBSD symbols to resolve binary compatibility. This follows the same method as other platforms like OSX and NetBSD. This will fix rustup and building from git (once libc is updated for bootstrap) on FreeBSD12 post-ino64 in freebsd/freebsd-src@f713b08. It also avoids having to hotpatch the stage0 compiler, and HOME/.cargo libc files on FreeBSD12 to build rust. The only real pitfall is that this will prevent interaction with inodes that have an ino_t above the 32-bit limit due to truncation. On the other hand Rust won't work at all on 12 without doing this currently. In general it should not be a problem for users and if they need 64-bit ino_t they can use a patched libc, rather than the current state of affairs in requiring a patched libc to use Rust on 12. A better, or complementary, approach would be something like proposed in rust-lang/rfcs#2048 to allow targetting a specific version of FreeBSD. This would allow Rust to default to this compatibility mode by targetting FreeBSD10 and still allow targetting FreeBSD12 for 64-bit ino_t. The symbol versions used were taken from the old version in freebsd/freebsd-src@f713b08#diff-61a32fcfb7ecd4517665fed591813c57 and freebsd/freebsd-src@f713b08#diff-7f67ccf8b5f44ff2f54eaab0207abb8d. The scope of functions versioned here differs from other platforms as not all structs were modified that were on others, such as DIR for `opendir`, `telldir`, etc. Only functions using dirent, stat, glob_t, and dev_t need the changes. Fixes rust-lang/rust#42681
☀️ Test successful - status-appveyor, status-travis |
This follows the same method as other platforms like OSX and NetBSD.
This will fix rustup and building from git (once libc is updated for bootstrap)
on FreeBSD12 post-ino64 in freebsd/freebsd-src@f713b08.
It also avoids having to hotpatch the stage0 compiler, and HOME/.cargo
libc files on FreeBSD12 to build rust.
The only real pitfall is that this will prevent interaction with inodes that
have an ino_t above the 32-bit limit due to truncation. On the other hand
Rust won't work at all on 12 without doing this currently. In general
it should not be a problem for users and if they need 64-bit ino_t they
can use a patched libc, rather than the current state of affairs in
requiring a patched libc to use Rust on 12.
A better, or complementary, approach would be something like proposed in
rust-lang/rfcs#2048 to allow targetting a specific
version of FreeBSD. This would allow Rust to default to this compatibility
mode by targetting FreeBSD10 and still allow targetting FreeBSD12 for 64-bit
ino_t.
The symbol versions used were taken from the old version in
freebsd/freebsd-src@f713b08#diff-61a32fcfb7ecd4517665fed591813c57
and
freebsd/freebsd-src@f713b08#diff-7f67ccf8b5f44ff2f54eaab0207abb8d.
The scope of functions versioned here differs from other platforms as
not all structs were modified that were on others, such as DIR for
opendir
,telldir
, etc. Only functions using dirent, stat, glob_t,and dev_t need the changes.
Fixes rust-lang/rust#42681