Skip to content

Commit

Permalink
Rollup merge of rust-lang#44116 - alexcrichton:update-libc, r=Mark-Si…
Browse files Browse the repository at this point in the history
…mulacrum

Update the libc submodule

Brings in a few fixes for wasm/asmjs
  • Loading branch information
alexcrichton authored Aug 30, 2017
2 parents 63cc2dd + e5b123c commit bc6981b
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/liblibc
Submodule liblibc updated 83 files
+10 −3 .travis.yml
+221 −29 Cargo.lock
+1 −1 Cargo.toml
+1 −1 README.md
+1 −1 appveyor.yml
+13 −0 ci/docker/aarch64-linux-android/Dockerfile
+2 −2 ci/docker/aarch64-unknown-linux-gnu/Dockerfile
+13 −0 ci/docker/arm-linux-androideabi/Dockerfile
+2 −2 ci/docker/arm-unknown-linux-gnueabihf/Dockerfile
+20 −0 ci/docker/asmjs-unknown-emscripten/Dockerfile
+13 −0 ci/docker/i686-linux-android/Dockerfile
+2 −2 ci/docker/mips-unknown-linux-gnu/Dockerfile
+3 −3 ci/docker/mips-unknown-linux-musl/Dockerfile
+2 −2 ci/docker/mips64-unknown-linux-gnuabi64/Dockerfile
+3 −3 ci/docker/mipsel-unknown-linux-musl/Dockerfile
+2 −2 ci/docker/powerpc-unknown-linux-gnu/Dockerfile
+2 −2 ci/docker/powerpc64-unknown-linux-gnu/Dockerfile
+3 −0 ci/docker/s390x-unknown-linux-gnu/Dockerfile
+21 −0 ci/docker/wasm32-unknown-emscripten/Dockerfile
+11 −0 ci/docker/wasm32-unknown-emscripten/node-wrapper.sh
+5 −1 ci/docker/x86_64-rumprun-netbsd/Dockerfile
+54 −0 ci/docker/x86_64-rumprun-netbsd/runtest.rs
+0 −8 ci/docker/x86_64-unknown-openbsd/Dockerfile
+19 −0 ci/emscripten-entry.sh
+54 −0 ci/emscripten.sh
+1 −0 ci/run-docker.sh
+6 −122 ci/run.sh
+41 −0 ci/runtest-android.rs
+11 −1 libc-test/Cargo.toml
+0 −16 libc-test/build-generated.rs
+54 −11 libc-test/build.rs
+0 −16 libc-test/generate-files/Cargo.toml
+0 −19 libc-test/run-generated-Cargo.toml
+0 −9 libc-test/src/main-generated.rs
+7 −0 libc-test/test/linux_fcntl.rs
+1 −1 libc-test/test/main.rs
+6 −0 src/lib.rs
+0 −37 src/macros.rs
+31 −0 src/redox.rs
+5 −1 src/unix/bsd/apple/mod.rs
+17 −17 src/unix/bsd/freebsdlike/dragonfly/mod.rs
+2 −0 src/unix/bsd/freebsdlike/freebsd/aarch64.rs
+17 −17 src/unix/bsd/freebsdlike/freebsd/mod.rs
+2 −0 src/unix/bsd/freebsdlike/freebsd/x86_64.rs
+13 −2 src/unix/bsd/freebsdlike/mod.rs
+62 −12 src/unix/bsd/mod.rs
+15 −6 src/unix/bsd/netbsdlike/mod.rs
+8 −1 src/unix/bsd/netbsdlike/netbsd/mod.rs
+12 −0 src/unix/bsd/netbsdlike/openbsdlike/mod.rs
+78 −12 src/unix/haiku/mod.rs
+3 −41 src/unix/mod.rs
+58 −0 src/unix/newlib/mod.rs
+3 −0 src/unix/notbsd/android/b32/arm.rs
+29 −0 src/unix/notbsd/android/b32/mod.rs
+3 −0 src/unix/notbsd/android/b64/aarch64.rs
+30 −0 src/unix/notbsd/android/b64/mod.rs
+166 −3 src/unix/notbsd/android/mod.rs
+1,667 −0 src/unix/notbsd/emscripten.rs
+39 −1 src/unix/notbsd/linux/mips/mips32.rs
+34 −1 src/unix/notbsd/linux/mips/mips64.rs
+163 −6 src/unix/notbsd/linux/mod.rs
+33 −0 src/unix/notbsd/linux/musl/b32/arm.rs
+0 −348 src/unix/notbsd/linux/musl/b32/asmjs.rs
+39 −2 src/unix/notbsd/linux/musl/b32/mips.rs
+0 −5 src/unix/notbsd/linux/musl/b32/mod.rs
+31 −0 src/unix/notbsd/linux/musl/b32/x86.rs
+3 −0 src/unix/notbsd/linux/musl/b64/aarch64.rs
+30 −0 src/unix/notbsd/linux/musl/b64/mod.rs
+3 −0 src/unix/notbsd/linux/musl/b64/powerpc64.rs
+1 −9 src/unix/notbsd/linux/musl/mod.rs
+33 −0 src/unix/notbsd/linux/other/b32/arm.rs
+33 −0 src/unix/notbsd/linux/other/b32/powerpc.rs
+31 −0 src/unix/notbsd/linux/other/b32/x86.rs
+32 −0 src/unix/notbsd/linux/other/b64/aarch64.rs
+32 −0 src/unix/notbsd/linux/other/b64/powerpc64.rs
+30 −0 src/unix/notbsd/linux/other/b64/x86_64.rs
+0 −5 src/unix/notbsd/linux/other/mod.rs
+32 −5 src/unix/notbsd/linux/s390x.rs
+50 −133 src/unix/notbsd/mod.rs
+66 −20 src/unix/solaris/mod.rs
+70 −24 src/unix/uclibc/mod.rs
+46 −0 src/unix/uclibc/x86_64/l4re.rs
+78 −90 src/unix/uclibc/x86_64/mod.rs
6 changes: 2 additions & 4 deletions src/libstd/os/raw.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@

use fmt;

#[cfg(any(target_os = "emscripten",
all(target_os = "linux", any(target_arch = "aarch64",
#[cfg(any(all(target_os = "linux", any(target_arch = "aarch64",
target_arch = "arm",
target_arch = "powerpc",
target_arch = "powerpc64",
Expand All @@ -24,8 +23,7 @@ use fmt;
target_arch = "arm")),
all(target_os = "fuchsia", target_arch = "aarch64")))]
#[stable(feature = "raw_os", since = "1.1.0")] pub type c_char = u8;
#[cfg(not(any(target_os = "emscripten",
all(target_os = "linux", any(target_arch = "aarch64",
#[cfg(not(any(all(target_os = "linux", any(target_arch = "aarch64",
target_arch = "arm",
target_arch = "powerpc",
target_arch = "powerpc64",
Expand Down
28 changes: 22 additions & 6 deletions src/libstd/sys/unix/fd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,21 @@ impl FileDesc {
#[cfg(target_os = "android")]
use super::android::cvt_pread64;

#[cfg(not(target_os = "android"))]
#[cfg(target_os = "emscripten")]
unsafe fn cvt_pread64(fd: c_int, buf: *mut c_void, count: usize, offset: i64)
-> io::Result<isize>
{
#[cfg(any(target_os = "linux", target_os = "emscripten"))]
use libc::pread64;
#[cfg(not(any(target_os = "linux", target_os = "emscripten")))]
cvt(pread64(fd, buf, count, offset as i32))
}

#[cfg(not(any(target_os = "android", target_os = "emscripten")))]
unsafe fn cvt_pread64(fd: c_int, buf: *mut c_void, count: usize, offset: i64)
-> io::Result<isize>
{
#[cfg(target_os = "linux")]
use libc::pread64;
#[cfg(not(target_os = "linux"))]
use libc::pread as pread64;
cvt(pread64(fd, buf, count, offset))
}
Expand All @@ -104,13 +112,21 @@ impl FileDesc {
#[cfg(target_os = "android")]
use super::android::cvt_pwrite64;

#[cfg(not(target_os = "android"))]
#[cfg(target_os = "emscripten")]
unsafe fn cvt_pwrite64(fd: c_int, buf: *const c_void, count: usize, offset: i64)
-> io::Result<isize>
{
use libc::pwrite64;
cvt(pwrite64(fd, buf, count, offset as i32))
}

#[cfg(not(any(target_os = "android", target_os = "emscripten")))]
unsafe fn cvt_pwrite64(fd: c_int, buf: *const c_void, count: usize, offset: i64)
-> io::Result<isize>
{
#[cfg(any(target_os = "linux", target_os = "emscripten"))]
#[cfg(target_os = "linux")]
use libc::pwrite64;
#[cfg(not(any(target_os = "linux", target_os = "emscripten")))]
#[cfg(not(target_os = "linux"))]
use libc::pwrite as pwrite64;
cvt(pwrite64(fd, buf, count, offset))
}
Expand Down
2 changes: 2 additions & 0 deletions src/libstd/sys/unix/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -514,6 +514,8 @@ impl File {
SeekFrom::End(off) => (libc::SEEK_END, off),
SeekFrom::Current(off) => (libc::SEEK_CUR, off),
};
#[cfg(target_os = "emscripten")]
let pos = pos as i32;
let n = cvt(unsafe { lseek64(self.0.raw(), pos, whence) })?;
Ok(n as u64)
}
Expand Down
5 changes: 3 additions & 2 deletions src/libstd/sys/unix/process/process_unix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

use io::{self, Error, ErrorKind};
use libc::{self, c_int, gid_t, pid_t, uid_t};
use mem;
use ptr;

use sys::cvt;
Expand Down Expand Up @@ -184,7 +183,9 @@ impl Command {
}

// NaCl has no signal support.
if cfg!(not(any(target_os = "nacl", target_os = "emscripten"))) {
#[cfg(not(any(target_os = "nacl", target_os = "emscripten")))]
{
use mem;
// Reset signal handling so the child process starts in a
// standardized state. libstd ignores SIGPIPE, and signal-handling
// libraries often set a mask. Child processes inherit ignored
Expand Down

0 comments on commit bc6981b

Please sign in to comment.