Commit Graph

4350 Commits

Author SHA1 Message Date
Yuki Okushi 58cd70390c Fix platforms' links on the `Platform-specific documentation` section 2021-03-04 00:04:29 +09:00
bors 5786455a79 Auto merge of #2096 - JohnTitor:fix-semver-check, r=JohnTitor
Revert the solaris target renaming for semver check

The semver check uses an old nightly and it doesn't have the renamed target yet, I completely forgot it.
r? `@ghost`
2021-03-02 13:59:34 +00:00
Yuki Okushi d6c42cfda4 Revert the solaris target renaming for semver check 2021-03-02 22:27:30 +09:00
bors fd68b7c5c3 Auto merge of #2094 - KentaTada:add-fsmagic-for-security, r=JohnTitor
Add definitions for security related MAGIC

This commit adds definitions for security related MAGIC.
2021-03-02 11:47:20 +00:00
bors 105b99dac3 Auto merge of #2095 - JohnTitor:add-description, r=JohnTitor
Add description metadata to libc-test

Well, I forgot to add this.
r? `@ghost`
2021-03-02 10:30:51 +00:00
Yuki Okushi 1ebc29eb2e Add description metadata to libc-test 2021-03-02 19:22:52 +09:00
Kenta Tada 6be7fa8037 Add definitions for security related MAGIC
Signed-off-by: Kenta Tada <Kenta.Tada@sony.com>
2021-03-02 18:36:02 +09:00
bors db6bf6fb5a Auto merge of #2092 - JohnTitor:version-bump, r=JohnTitor
Bump up libc version to 0.2.87

r? `@ghost`
In order to unblock https://github.com/rust-lang/rust/issues/82400.
This also closes #2065.
2021-03-02 09:05:43 +00:00
bors e313587f1e Auto merge of #2093 - JohnTitor:solaris-default-target, r=JohnTitor
Replace `x86_64-sun-solaris` with `x86_64-pc-solaris`

Address the changes by https://github.com/rust-lang/rust/pull/82216. I didn't add `x86_64-sun-solaris` as it's now deprecated.
r? `@ghost`
2021-03-02 07:34:54 +00:00
Yuki Okushi d96c9a2d8e Replace `x86_64-sun-solaris` with `x86_64-pc-solaris` 2021-03-02 16:27:20 +09:00
Yuki Okushi 5cfe0a237c Update some metadata on libc-test to publish 2021-03-02 15:16:12 +09:00
Yuki Okushi 68d1e3a2d6 Bump up libc version to 0.2.87 2021-03-02 15:14:25 +09:00
bors a6dc5bc088 Auto merge of #2089 - KentaTada:add-selinuxfs, r=JohnTitor
Add definition of SELINUX_MAGIC

This commit adds the definition of SELINUX_MAGIC.
2021-03-01 18:22:22 +00:00
bors 1dbc85d4ab Auto merge of #2090 - JohnTitor:remove-rumprun-from-ci-stuff, r=JohnTitor
Remove CI support for `x86_64-rumprun-netbsd`

That target has been removed by https://github.com/rust-lang/rust/pull/82594.
This is intended to unblock CI and we could drop the actual library support for it like CloudABI.

r? `@ghost`
2021-03-01 17:20:06 +00:00
Yuki Okushi 966f3dfe75 Remove CI support for `x86_64-rumprun-netbsd` 2021-03-02 02:10:29 +09:00
Kenta Tada bdb1ab7b01 Add definition of SELINUX_MAGIC
Signed-off-by: Kenta Tada <Kenta.Tada@sony.com>
2021-03-01 21:49:48 +09:00
bors 04db260ac4 Auto merge of #2086 - JohnTitor:s390x-musl, r=JohnTitor
Move `s390x-unknown-linux-musl` to build.sh

Fixes #2085
r? `@ghost`
2021-02-28 19:44:44 +00:00
Yuki Okushi 9f2acfaa53 Fix build for `s390x-unknown-linux-musl` 2021-03-01 04:13:17 +09:00
Yuki Okushi 9fca60945a Move `s390x-unknown-linux-musl` to build.sh 2021-02-28 17:09:06 +09:00
bors 5fd6540db9 Auto merge of #2071 - kaniini:s390x-musl, r=Amanieu
add definitions for s390x musl targets

Add support for s390x musl targets to libc.

I haven't added CI because I am not familiar with the pipelines, but would be glad to do so if somebody outlines what needs to be done.
2021-02-28 04:14:47 +00:00
Ariadne Conill 41cda2abdc bors: disable s390x-unknown-linux-musl for now 2021-02-28 02:57:59 +00:00
Ariadne Conill f23086220d add s390x-unknown-linux-musl to bors 2021-02-28 01:17:15 +00:00
Ariadne Conill dcbc3d15d1 discard no longer used s390x-linux-musl.json 2021-02-28 01:03:07 +00:00
Ariadne Conill a46111bc8e ci: install-musl: add missing ;; 2021-02-28 00:41:49 +00:00
Ariadne Conill 344b409989 ci: add support for s390x-unknown-linux-musl 2021-02-28 00:38:58 +00:00
bors 1524495dcf Auto merge of #2082 - landfillbaby:patch-1, r=Amanieu
use GNU/Linux siginfo_t on Android

Bionic uses an unchanged siginfo.h from the upstream linux so why not? :)
I literally just copied everything with siginfo_t from unix/linux_like/linux/gnu/mod.rs to unix/linux_like/android/mod.rs
2021-02-28 00:38:00 +00:00
Ariadne Conill dbb0e6cce9
musl: s390x: use c_int instead of c_ulong for terminal-related ioctl constants
Co-authored-by: Jubilee <46493976+workingjubilee@users.noreply.github.com>
2021-02-27 17:36:02 -07:00
Ariadne Conill db9d4cfe1c
musl: s390x: use c_int instead of c_ulong for ioctl constants
Co-authored-by: Jubilee <46493976+workingjubilee@users.noreply.github.com>
2021-02-27 17:35:22 -07:00
Lucy Phipps 51461b1bbe
use GNU/Linux siginfo_t on Android
needs testing
2021-02-27 17:17:21 +00:00
bors add972649f Auto merge of #2079 - de-vri-es:android-x86-accept4, r=joshtriplett,JohnTitor
Implement accept4 on x86 android with `socketcall` syscall.

Linux x86 kernels before 4.3 only support the `socketcall` syscall rather than individual syscalls for socket operations. Since `libc` does a raw syscall for `accept4` on Android, it doesn't work on x86 systems.

This PR instead implements `accept4` for x86 android using `socketcall`. The value for `SYS_ACCEPT4` (in contrast to `SYS_accept4` 👀) is taken from the `linux/net.h` header.

Also note that the `socketcall` syscall takes all arguments as array of long ints. I've double checked with `glibc` to check how they pass arguments, since the Linux man page only says this: "args points to a block containing the actual arguments" and "only standard library implementors and kernel hackers need to know about socketcall()".

This should fix https://github.com/rust-lang/rust/issues/82400
2021-02-27 13:11:19 +00:00
bors 31a2777d8f Implement accept4 on x86 android with `socketcall` syscall.
Linux x86 kernels before 4.3 only support the `socketcall` syscall rather than individual syscalls for socket operations. Since `libc` does a raw syscall for `accept4` on Android, it doesn't work on x86 systems.

This PR instead implements `accept4` for x86 android using `socketcall`. The value for `SYS_ACCEPT4` (in contrast to `SYS_accept4` 👀) is taken from the `linux/net.h` header.

Also note that the `socketcall` syscall takes all arguments as array of long ints. I've double checked with `glibc` to check how they pass arguments, since the Linux man page only says this: "args points to a block containing the actual arguments" and "only standard library implementors and kernel hackers need to know about socketcall()".

This should fix https://github.com/rust-lang/rust/issues/82400
2021-02-27 13:11:19 +00:00
bors d8fc4b2d5c Auto merge of #2083 - jasonbking:illumos, r=JohnTitor
Add additional illumos and Solaris constants

This adds some additional constants for `fcntl(2)` and `setsockopt(3SOCKET)`.
2021-02-27 11:56:14 +00:00
Jason King 0f8e3d054c Add several IPsec related options 2021-02-27 06:24:22 +00:00
Jason King 5ab626984f Additional solaris fcntl values 2021-02-27 06:14:26 +00:00
bors 83d8c39f54 Auto merge of #2080 - jbit:freebsd-bpf, r=JohnTitor
Add FreeBSD BPF structures

This PR adds BPF structures that are common between [FreeBSD 11](https://github.com/freebsd/freebsd-src/blob/release/11.0.0/sys/net/bpf.h), [FreeBSD 12](https://github.com/freebsd/freebsd-src/blob/release/12.0.0/sys/net/bpf.h), [FreeBSD mainline/13](https://github.com/freebsd/freebsd-src/blob/main/sys/net/bpf.h) and [DragonFlyBSD 5.9](https://github.com/DragonFlyBSD/DragonFlyBSD/blob/v5.9.0/sys/net/bpf.h).

It also fixes the definition of `BPF_ALIGNMENT`, which should be equal to `sizeof(long)`, which is `4` on 32bit FreeBSD.

https://www.freebsd.org/cgi/man.cgi?query=arch&sektion=7
> All supported ABIs can be	divided	into two groups:
> * ILP32: `int`, `long`, `void *` types machine representations all have 4-byte size.
> * LP64: `int` type machine representation uses 4 bytes, while `long` and `void *` are 8 bytes.

I introduced the private `SIZEOF_LONG` const, since I didn't want to introduce a dependency on rust 1.24+ by depending on `libc_const_size_of`.

These changes allow my experimental crate to build on FreeBSD: https://github.com/jbit/powerline
2021-02-26 18:22:44 +00:00
bors 8a88b7df1e Auto merge of #2078 - workingjubilee:fix-mips64-musl, r=Amanieu
Fix mips64-musl ioctl consts to c_int

This arch was overlooked or unspecified in earlier PRs that fixed
c_ulong to c_int for ioctl.h consts for musl, see PR #289, PR #301,
or PR #1097 for such prior art, however these are still args to
fn ioctl on mips64-musl, which is expecting c_ints.

Some numbers acquired casts to reflect the fact the data is being
used and (so should be written as) an unsized bitfield, even if
the value is greater than i32::MAX.

Currently rustc is not building on mips64-linux-musl because of this error.
2021-02-26 00:48:05 +00:00
Jubilee Young 9807fad7ac Stop directory-not-there errors in dox.sh 2021-02-25 16:22:58 -08:00
Jubilee Young fcae5a7a1a Disable aarch64-linux-android in CI 2021-02-25 13:31:02 -08:00
James Lee 4b55c8715c Add BPF structures for FreeBSD 2021-02-25 17:18:07 +11:00
James Lee ed1256a366 Fix BPF_ALIGNMENT for 32bit FreeBSD 2021-02-25 17:17:50 +11:00
Jubilee Young 5c07fcfd1c Add trace to CI 2021-02-24 17:46:29 -08:00
Jubilee Young 104154738c Fix mips64-musl ioctl consts to c_int
This arch was overlooked or unspecified in earlier PRs that fixed
c_ulong to c_int for ioctl.h consts for musl, see PR #289, PR #301,
or PR #1097 for such prior art, however these are still args to
fn ioctl on mips64-musl, which is expecting c_ints.

Some numbers acquired casts to reflect the fact the data is being
used and (so should be written as) an unsized bitfield, even if
the value is greater than i32::MAX.
2021-02-23 12:34:04 -08:00
bors ec101fadd6 Auto merge of #2075 - sunfishcode:sunfishcode/wasi-at-fdcwd, r=JohnTitor
WASI: define `AT_FDCWD` and update to latest WASI libc

Update to the latest WASI libc, define `AT_FDCWD`, update the signature
for __wasilibc_find_relpath, and add declarations for various
`__wasilibc_` utility functions.
2021-02-19 02:39:25 +00:00
Dan Gohman 197d9227cb WASI: define `AT_FDCWD` and update to latest WASI libc
Update to the latest WASI libc, define `AT_FDCWD`, update the signature
for __wasilibc_find_relpath, and add declarations for various
`__wasilibc_` utility functions.
2021-02-18 14:07:17 -08:00
bors f9562dd768 Auto merge of #2072 - smklein:solarish_directory, r=Amanieu
Add O_DIRECTORY to solarish

FYI `@pfmooney` . I was trying to port [nix](https://crates.io/crates/nix) to illumos, and noticed this in the illumos-gate [headers](221e47fb90/usr/src/uts/common/sys/fcntl.h), but not in libc.
2021-02-16 16:11:01 +00:00
Sean Klein 6873e2f930 Add O_DIRECTORY to solarish 2021-02-16 03:30:57 +00:00
Ariadne Conill 88de3880fb add definitions for s390x musl targets 2021-02-15 22:37:14 +00:00
bors b035574949 Auto merge of #2070 - nielx:haiku-raw-pointers, r=JohnTitor
Haiku: use raw pointers instead of references in convenience functions

The Haiku API has some convenience macros to make it easier to call certain
functions. In the libc implementation, these are implemented as unsafe
functions. The previous choice was to take certain pointer parameters as
references, and do the conversion to raw pointers when the actual external
function was called.

However, this causes issues with the image_info struct, which needs to be
initialized in Rust, before a native API call is used to enter data. Since
part of this structure consists of function pointers, mem::zeroed() cannot be
used, since in Rust function pointers cannot be NULL. Thus one needs to use the
MaybeUnit<T> API to properly initialize it. This then makes it problematic to
use the convenience functions, as a MaybeUnit<image_info> cannot be converted
into an &mut image_info before it is marked as initialized with valid data. It can
be converted into a raw *mut image_info, so if the function accepts this as a
parameter it can be used.

For consistency, all convenience functions have been converted from using
references to using raw pointers.
2021-02-14 07:55:01 +00:00
bors d4080d15c5 Auto merge of #1975 - skrap:feature/move-uclibc-under-linux, r=JohnTitor
Move uclibc under linux

This is a first cut at moving uclibc under linux, alongside `musl` and `gnu`.

All tests pass on a vexpress a9 running in qemu.  I am working on testing the other tier 3 uclibc targets: `mips-unknown-linux-uclibc` and `mipsel-unknown-linux-uclibc`.  ~Not having access to these platforms, I am working on getting them running in qemu, but it may take a bit.~

The style check doesn't pass.  I would appreciate some direction here.  Many of these constants are defined under 2-of-3 out of musl/glibc/uclibc, so I'm not sure whether I should transform:

```rust
#[cfg(not(target_env = "uclibc"))]
pub fn foo();
```
into 2 separate declarations, one each in `musl/mod.rs` and `gnu/mod.rs` or use a `cfg_if` block for each one (which explodes 2 lines into 5).

- [x] Help me choose which fix to use for the items defined in musl and gnu but not uclibc.

It's my guess that exploding into the `cfg_if` block is better for long-term maintainability, but I'd really appreciate opinions from the maintainers.
2021-02-13 21:16:19 +00:00
Jonah Petri 3378f0cebf style fixes to satisfy new rustfmt 2021-02-13 15:04:45 -05:00