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 f713b08c02.
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
https://github.com/rust-lang/rfcs/pull/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
f713b08c02 (diff-61a32fcfb7ecd4517665fed591813c57)
and
f713b08c02 (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 https://github.com/rust-lang/rust/issues/42681
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 f713b08c02.
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
https://github.com/rust-lang/rfcs/pull/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
f713b08c02 (diff-61a32fcfb7ecd4517665fed591813c57)
and
f713b08c02 (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 https://github.com/rust-lang/rust/issues/42681
Link against kevent@FBSD_1.0 to fix ABI compat with FreeBSD12.
struct kevent was modified in FreeBSD12. The @FBSD_1.0 symbol supports the old
structure ABI still.
This allows the `mio` crate tests to now pass on FreeBSD12.
struct kevent was modified in FreeBSD12. The @FBSD_1.0 symbol supports the old
structure ABI still.
This allows the `mio` crate tests to now pass on FreeBSD12.
Add netfilter/nftables fields
Adding a few missing `NF_` constants to more complete the story around that header. Then most importantly add a lot of `NFT_` constants needed in my nftables library. Some were added back in #911, but as the library grew I realized I needed more constants.
The `d_type` field of `struct dirent` can be `DT_UNKNOWN` if a
filesystem doesn't support returning the file type in directory entries.
Linux's readdir(3) man page, for example, says: "Currently, only some
filesystems [...] have full support for returning the file type in
d_type. All applications must properly handle a return of DT_UNKNOWN."
added EPOLL(5) for Illumos (Solaris fork)
EPOLL(5) is being used in crates like mio and iovec , this change allows those crates and other that depends on EPOLL(5) to be built in illumos systems.
Add time_t for CloudABI.
Even though this data type is not used by libstd in any platform
independent code, one of the unit tests in src/libstd/time/mod.rs refers
to it. Instead of making that unit test more complicated, simply add
time_t, matching the type used by the C library.
Even though this data type is not used by libstd in any platform
independent code, one of the unit tests in src/libstd/time/mod.rs refers
to it. Instead of making that unit test more complicated, simply add
time_t, matching the type used by the C library.
This constant is not used by the C library, which is why I didn't add it
initially. It is, however, used by libtest to determine the parallelism
for the execution of tests.
Add support for CloudABI.
CloudABI is a sandboxed UNIX-like runtime environment, based on the
principle of capability-based security. As CloudABI is intended to be
cross-platform, the system call layer is specified here:
https://github.com/NuxiNL/cloudabi/blob/master/cloudabi.txt
From these definitions, we automatically generate C and Rust bindings.
The latter is published on crates.io:
https://crates.io/crates/cloudabi
My goal is to implement libstd for CloudABI in such a way that it uses
the C library as little as possible; only in places where it would ease
interfacing with C code (e.g., thread creation). In places where
constants in the C library are directly based on the CloudABI
specification (e.g., errnos), use the constants provided by the cloudabi
crate.
CloudABI is a sandboxed UNIX-like runtime environment, based on the
principle of capability-based security. As CloudABI is intended to be
cross-platform, the system call layer is specified here:
https://github.com/NuxiNL/cloudabi/blob/master/cloudabi.txt
From these definitions, we automatically generate C and Rust bindings.
The latter is published on crates.io:
https://crates.io/crates/cloudabi
My goal is to implement libstd for CloudABI in such a way that it uses
the C library as little as possible; only in places where it would ease
interfacing with C code (e.g., thread creation). In places where
constants in the C library are directly based on the CloudABI
specification (e.g., errnos), use the constants provided by the cloudabi
crate.
Change deprecated constants into hidden constants
rustc, an important libc consumer, has a policy that they can't use any
crates with deprecated symbols. Replace libc's two deprecated symbols
with hidden symbols instead.
rustc, an important libc consumer, has a policy that they can't use any
crates with deprecated symbols. Replace libc's two deprecated symbols
with hidden symbols instead.
Add additional aarch64 linux syscalls
I've noticed some syscalls are missing for aarch64 linux, I've added those I needed. The numbers have been taken from a raspberry pi 3.
Adds:
- `SYS_fcntl`
- `SYS_lseek`
- `SYS_newfstatat`
- `SYS_fstat`
- `SYS_mmap`
- `SYS_open`
- `SYS_stat`
- `SYS_lstat`
- `SYS_pipe`
- `SYS_getdents`
- `SYS_poll`