Commit graph

2405 commits

Author SHA1 Message Date
bors d13f3461ce Auto merge of #1082 - IsaacWoods:core_cvoid, r=alexcrichton
Re-export core::ffi::c_void if it exists

This is the second part of the implementation of [RFC 2521](https://github.com/rust-lang/rfcs/pull/2521), replacing the definition of `c_void` in libc with a re-export of the type from `core::ffi::c_void` on builds it exists for.

This uses the re-export for rustc version `1.31.0` or greater, as `1.30.x` was the current nightly when [the PR for the changes to libcore and libstd](https://github.com/rust-lang/rust/pull/53910) was merged, so I'm assuming the first nightly they will appear in will be `1.31.0`; is this acceptable?

cc rust-lang/rust#53856
2018-09-19 18:28:49 +00:00
Isaac Woods 79c80c4ec4
Re-export core::ffi::c_void if supported 2018-09-18 19:50:36 +01:00
bors 878e6aea1f Auto merge of #1075 - tbu-:pr_test_statics, r=alexcrichton
Theoretically test statics

There are none of them in `libc` except for `__progname` on Android, but
that one cannot be tested because it's not present in any header files.
2018-09-13 15:45:32 +00:00
Tobias Bucher eb6bdf35dd Revert accidentally committed test ignores 2018-09-13 07:24:47 +02:00
Tobias Bucher 45f191d192 Update to non-yanked version of ctest 2018-09-12 23:27:28 +02:00
bors 995d7daf2b Auto merge of #1078 - johalun:so_reuseport_lb, r=alexcrichton
Add new FreeBSD socket option SO_REUSEPORT_LB.

FreeBSD 12, which is scheduled to be released soon, has a new socket option SO_REUSEPORT_LB.
From setsockopt man page:
     SO_REUSEPORT_LB allows completely duplicate bindings by multiple
     processes if they all set SO_REUSEPORT_LB before binding the port.
     Incoming TCP and UDP connections are distributed among the sharing
     processes based on a hash function of local port number, foreign IP
     address and port number. A maximum of 256 processes can share one socket.
2018-09-10 23:59:22 +00:00
Johannes Lundberg f80b024850 Add SO_REUSEPORT_LB to whitelist for build tests 2018-09-10 20:35:07 +01:00
Johannes Lundberg 2f218e9f8c Add new FreeBSD socket option SO_REUSEPORT_LB. 2018-09-10 09:41:18 +01:00
bors caee85653e Auto merge of #1077 - jhwgh1968:mips-uclibc, r=alexcrichton
Fix mips-unknown-linux-uclibc target

The mips(el)-unknown-linux-uclibc target has apparently been broken in one way or another for over a year. This PR is the patch it took to successfully build a beta toolchain that could support it.

I am pretty sure these fixes are the right answer, after considerable digging in both the libc crate source (_pub-use pub-use everywhere, and not a hint to link_) and the uClibc source (_it's not POSIX, but they've shipped it since 2007, so close enough_).

For those who don't know, the *-uClibc targets are the only way (AFAIK) to create Rust binaries which run on Linux kernels prior to 2.6. It is a use case that is getting quite rare these days, but is still present in embedded ecosystems where chip vendors never migrated their hardware support to newer kernel versions.

Here's hoping these Rust toolchain targets find a maintainer someday.

cc rust-lang/rust#43503
2018-09-09 19:22:17 +00:00
bors 63eb3b7a2f Auto merge of #1076 - sfackler:more-elf, r=alexcrichton
Add a couple more ELF types
2018-09-09 17:42:55 +00:00
jhwgh1968 361e4549fa uClibc: add missing fd exports 2018-09-08 16:23:28 -05:00
jhwgh1968 19914fe76b uClibc: fix mips signal constants 2018-09-08 16:23:03 -05:00
Steven Fackler 0f461200d4 Add a couple more ELF types 2018-09-08 10:03:33 -07:00
Tobias Bucher 8b1d846444 Theoretically test statics
There are none of them in `libc` except for `__progname` on Android, but
that one cannot be tested because it's not present in any header files.
2018-09-05 09:48:49 +02:00
bors 267375e999 Auto merge of #1072 - sfackler:more-elf, r=alexcrichton
Add some more elf types
2018-09-03 17:14:12 +00:00
Steven Fackler 063c721c96 Add some more elf types 2018-09-02 22:08:44 -07:00
bors b9a0e23e84 Auto merge of #1071 - Lytigas:master, r=alexcrichton
Add mallopt

First time contributor. Thanks for the excellent contributing guide.
I'm not quite sure I put the method in the right place. [The GNULib docs](https://www.gnu.org/software/gnulib/manual/html_node/mallopt.html) say its not on Android 7.1, but there are [mentions of it in some android headers](https://android.googlesource.com/platform/bionic/+/master/libc/include/malloc.h).
2018-09-02 15:50:32 +00:00
Josh Hejna a9590b5590 Move mallopt to exclude from musl 2018-09-02 01:56:00 -07:00
Josh Hejna 7192ecb2cd Add mallopt 2018-09-02 01:06:55 -07:00
bors ac7201bc02 Auto merge of #1070 - redox-os:relibc, r=alexcrichton
Add additional Redox OS functions

This adds `chown`, `fchown`, `setenv`, and `unsetenv` to the `redox` module, and reorders the functions by name
2018-08-24 21:38:38 +00:00
Jeremy Soller 919dd7c8fc Fix style 2018-08-24 14:49:54 -06:00
Jeremy Soller 15085c211e
Merge branch 'master' into relibc 2018-08-24 13:55:14 -06:00
Alex Crichton 1844a772b6
Merge pull request #1069 from cramertj/undo-fuchsia-repr-fix
Undo division of in6_addr on Fuchsia
2018-08-24 11:45:32 -07:00
Taylor Cramer a0a4f8cc04 Undo division of in6_addr on Fuchsia 2018-08-24 11:41:02 -07:00
bors f8e6b002b2 Auto merge of #1068 - gnzlbg:patch-1, r=alexcrichton
sparc64 tests are passing again

Closes #1064 .
2018-08-24 16:19:56 +00:00
gnzlbg 381d3e908b
sparc64 tests are passing again
Closes #1064 .
2018-08-24 13:29:30 +02:00
bors 0f2d4f993c Auto merge of #1067 - cramertj:fuchsia-fixes, r=alexcrichton
Fix and cleanup Fuchsia

Remove false support for power and mips.
Fix aarch64 definitions of nlink_t and blksize_t.

r? @alexcrichton

cc @sulanov
2018-08-22 23:14:52 +00:00
Taylor Cramer 2f593709ca Fix and cleanup Fuchsia
Remove false support for power and mips.
Fix aarch64 definitions of nlink_t and blksize_t.
2018-08-22 12:32:10 -07:00
Jeremy Soller 660a4feb87 Add chown/fchown 2018-08-19 11:37:40 -06:00
bors 7a9f031d87 Auto merge of #1065 - eeyun:eeyun/solaris_termios, r=alexcrichton
Add TIOCGWINSZ accessor to solaris module

Signed-off-by: Ian Henry <ihenry@chef.io>

I recently noticed downstream that these request values were unavailable and needed for things like [the pb crate](https://github.com/a8m/pb). To get access to the request value I ran the following simple C code:
```
#include <sys/ioctl.h>
#include <stdio.h>
#include <sys/termios.h>

int main(int argc, char **argv) {
    printf("Code: 0x%04lx\n", TIOCGWINSZ);
    printf("Code: 0x%04lx\n", TIOCSWINSZ);
    return 0;
}
```
To then validate the change I ran the following simple rust:
```
extern crate libc;

use libc::{ioctl, winsize, STDOUT_FILENO, TIOCGWINSZ};

fn main() {
    let mut wsize = winsize {
        ws_row: 0,
        ws_col: 0,
        ws_xpixel: 0,
        ws_ypixel: 0,
    };
    unsafe {
        ioctl(STDOUT_FILENO, TIOCGWINSZ, &mut wsize);
    }
    println!("Sizes: {{ rows: {}, cols: {}, xpixel: {}, ypixel: {} }}",
             wsize.ws_row,
             wsize.ws_col,
             wsize.ws_xpixel,
             wsize.ws_ypixel);
}
```
2018-08-16 17:31:15 +00:00
Ian Henry a3c843bc7f Add TIOCGWINSZ accessor to solaris module
Signed-off-by: Ian Henry <ihenry@chef.io>
2018-08-16 12:59:52 -04:00
Alex Crichton b9c613f3dc Fix allow_failures section 2018-08-16 09:33:02 -07:00
Alex Crichton f31d0f7795 Allow sparc64 to fail on CI 2018-08-15 17:14:37 -07:00
Alex Crichton b6dacea4e7
Merge pull request #1063 from jakllsch/netbsd-time50-fixes
NetBSD: correct link_name of some time-related functions
2018-08-15 17:13:34 -07:00
Alex Crichton 78f1dd2ce3
Merge pull request #1052 from debris/exchangedata
Add exchangedata for osx
2018-08-15 17:13:04 -07:00
Jonathan A. Kollasch c0fab38966 NetBSD: correct link_name of some time-related functions
The futimes(), lutimes(), mq_timedreceive(), and mq_timedsend()
functions were linking against legacy library symbols that need 32-bit
time_t in structures, resulting in an ABI mismatch with 64-bit time_t.
2018-08-15 12:20:57 -05:00
debris 504f286960 Push function into lower modules 2018-08-15 10:49:08 +02:00
debris 56dde29582 Two variants of exchangedata 2018-08-14 16:20:15 +02:00
debris 195d63a017 Merge branch 'master' of github.com:rust-lang/libc into exchangedata 2018-08-14 16:13:13 +02:00
debris c67224eb82 Use u32 for exchangedata 2018-08-14 12:55:55 +02:00
bors 2c063c243f Auto merge of #1062 - alexcrichton:update-ctest, r=alexcrichton
Update ctest to 0.2
2018-08-13 23:59:19 +00:00
Alex Crichton e72f187cd4 Update ctest to 0.2 2018-08-13 16:58:13 -07:00
Jeremy Soller 81e250f471 Add setenv/unsetenv 2018-08-11 16:44:04 -06:00
bors 9be97c961f Auto merge of #1050 - MegatonHammer:master, r=alexcrichton
Add libc definitions for Megaton-Hammer, a Switch Homebrew toolchain

I'm working on a pure-rust toolchain to write homebrew for the Nintendo Switch called [Megaton-Hammer](http://github.com/megatonhammer/megaton-hammer). I'm hoping to get those definitions upstreamed to simplify my life :).

This toolchain does not depend on a C compiler or a libc (it reimplements everything in rust) - but given many crates in the Rust ecosystem rely on the libc crate for the definition of various common types, this is what I came up with.

I was wondering what a good target triple would be ? I currently gate the implementation behind `target_os = "switch"`, but if this goes upstream I figure that might cause trouble for people using the Nintendo SDK (they might already be using `target_os = "switch"` for some things). Would it be better to go with `target_env = "megatonhammer"`?
2018-08-07 14:01:55 +00:00
bors fc8db9602e Auto merge of #1058 - jakllsch:netbsd-283b36ac-fab0-4e5f-b620-4325f8cedc80, r=alexcrichton
NetBSD: add basic types for aarch64
2018-08-07 05:58:59 +00:00
Jonathan A. Kollasch 0478c6059b NetBSD: add basic types for aarch64 2018-08-06 14:59:35 -05:00
bors 27114a96af Auto merge of #1057 - jakllsch:netbsd-5298beff-d081-4368-ab2a-0987e84c6d02, r=alexcrichton
NetBSD: correct c_char signedness on arm and powerpc
2018-08-06 19:10:09 +00:00
Jonathan A. Kollasch 80f2d7d999 fix syntax error in previous 2018-08-06 13:41:30 -05:00
Jonathan A. Kollasch 174888fd56 NetBSD: correct c_char signedness on arm and powerpc 2018-08-06 12:15:45 -05:00
bors 6bdbf5dc93 Auto merge of #1056 - faern:release, r=alexcrichton
Bump version to 0.2.43

Would be nice to have the new align feature from #1044 available for general use. But mostly I want this released since I have problems using the align feature for a PR on libstd, and I suspect it's somehow because I try to use an unpublished libc (https://github.com/rust-lang/rust/pull/52872).
2018-08-06 01:25:19 +00:00