Skip to content

Update libc and some fixes for x86_64-unknown-linux-gnux32 #45391

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

Merged
merged 2 commits into from
Oct 21, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 6 additions & 8 deletions src/libcore/tests/hash/sip.rs
Original file line number Diff line number Diff line change
Expand Up @@ -243,24 +243,22 @@ fn test_siphash_2_4() {
t += 1;
}
}
#[test] #[cfg(target_arch = "arm")]

#[test]
#[cfg(target_pointer_width = "32")]
fn test_hash_usize() {
let val = 0xdeadbeef_deadbeef_u64;
assert!(hash(&(val as u64)) != hash(&(val as usize)));
assert_eq!(hash(&(val as u32)), hash(&(val as usize)));
}
#[test] #[cfg(target_arch = "x86_64")]

#[test]
#[cfg(target_pointer_width = "64")]
fn test_hash_usize() {
let val = 0xdeadbeef_deadbeef_u64;
assert_eq!(hash(&(val as u64)), hash(&(val as usize)));
assert!(hash(&(val as u32)) != hash(&(val as usize)));
}
#[test] #[cfg(target_arch = "x86")]
fn test_hash_usize() {
let val = 0xdeadbeef_deadbeef_u64;
assert!(hash(&(val as u64)) != hash(&(val as usize)));
assert_eq!(hash(&(val as u32)), hash(&(val as usize)));
}

#[test]
fn test_hash_idempotent() {
Expand Down
2 changes: 1 addition & 1 deletion src/liblibc
Submodule liblibc updated 54 files
+4 −1 .travis.yml
+40 −56 Cargo.lock
+2 −2 Cargo.toml
+3 −0 README.md
+0 −4 appveyor.yml
+1 −1 ci/README.md
+1 −1 ci/android-install-sdk.sh
+27 −0 ci/docker/aarch64-unknown-linux-musl/Dockerfile
+25 −0 ci/docker/arm-unknown-linux-musleabihf/Dockerfile
+1 −1 libc-test/Cargo.toml
+38 −6 libc-test/build.rs
+37 −62 src/dox.rs
+38 −30 src/redox/mod.rs
+110 −0 src/redox/net.rs
+26 −0 src/unix/bsd/apple/mod.rs
+18 −0 src/unix/bsd/freebsdlike/freebsd/mod.rs
+10 −0 src/unix/bsd/mod.rs
+2 −0 src/unix/bsd/netbsdlike/mod.rs
+64 −0 src/unix/bsd/netbsdlike/netbsd/mod.rs
+296 −49 src/unix/haiku/mod.rs
+23 −10 src/unix/mod.rs
+9 −0 src/unix/newlib/mod.rs
+345 −0 src/unix/notbsd/android/b32/arm.rs
+265 −3 src/unix/notbsd/android/b64/aarch64.rs
+43 −0 src/unix/notbsd/android/mod.rs
+366 −5 src/unix/notbsd/linux/mips/mips32.rs
+326 −4 src/unix/notbsd/linux/mips/mips64.rs
+40 −0 src/unix/notbsd/linux/mips/mod.rs
+29 −6 src/unix/notbsd/linux/mod.rs
+371 −8 src/unix/notbsd/linux/musl/b32/arm.rs
+375 −6 src/unix/notbsd/linux/musl/b32/mips.rs
+16 −0 src/unix/notbsd/linux/musl/b32/mod.rs
+16 −0 src/unix/notbsd/linux/musl/b32/x86.rs
+338 −4 src/unix/notbsd/linux/musl/b64/aarch64.rs
+11 −49 src/unix/notbsd/linux/musl/b64/mod.rs
+76 −0 src/unix/notbsd/linux/musl/b64/powerpc64.rs
+71 −0 src/unix/notbsd/linux/musl/b64/x86_64.rs
+12 −16 src/unix/notbsd/linux/musl/mod.rs
+366 −5 src/unix/notbsd/linux/other/b32/arm.rs
+11 −0 src/unix/notbsd/linux/other/b32/mod.rs
+371 −5 src/unix/notbsd/linux/other/b32/powerpc.rs
+12 −0 src/unix/notbsd/linux/other/b32/x86.rs
+293 −5 src/unix/notbsd/linux/other/b64/aarch64.rs
+19 −12 src/unix/notbsd/linux/other/b64/mod.rs
+25 −0 src/unix/notbsd/linux/other/b64/not_x32.rs
+375 −5 src/unix/notbsd/linux/other/b64/powerpc64.rs
+24 −0 src/unix/notbsd/linux/other/b64/sparc64.rs
+2 −0 src/unix/notbsd/linux/other/b64/x32.rs
+18 −17 src/unix/notbsd/linux/other/b64/x86_64.rs
+32 −9 src/unix/notbsd/linux/other/mod.rs
+335 −5 src/unix/notbsd/linux/s390x.rs
+17 −0 src/unix/notbsd/mod.rs
+13 −0 src/unix/solaris/mod.rs
+8 −0 src/unix/uclibc/mod.rs
5 changes: 3 additions & 2 deletions src/libstd/sys/unix/condvar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,14 +92,15 @@ impl Condvar {
assert_eq!(r, 0);

// Nanosecond calculations can't overflow because both values are below 1e9.
let nsec = dur.subsec_nanos() as libc::c_long + now.tv_nsec as libc::c_long;
let nsec = dur.subsec_nanos() + now.tv_nsec as u32;

let sec = saturating_cast_to_time_t(dur.as_secs())
.checked_add((nsec / 1_000_000_000) as libc::time_t)
.and_then(|s| s.checked_add(now.tv_sec));
let nsec = nsec % 1_000_000_000;

let timeout = sec.map(|s| {
libc::timespec { tv_sec: s, tv_nsec: nsec }
libc::timespec { tv_sec: s, tv_nsec: nsec as _}
}).unwrap_or(TIMESPEC_MAX);

let r = libc::pthread_cond_timedwait(self.inner.get(), mutex::raw(mutex),
Expand Down
4 changes: 2 additions & 2 deletions src/libstd/sys/unix/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,14 +132,14 @@ impl FileAttr {
pub fn modified(&self) -> io::Result<SystemTime> {
Ok(SystemTime::from(libc::timespec {
tv_sec: self.stat.st_mtime as libc::time_t,
tv_nsec: self.stat.st_mtime_nsec as libc::c_long,
tv_nsec: self.stat.st_mtime_nsec as _,
}))
}

pub fn accessed(&self) -> io::Result<SystemTime> {
Ok(SystemTime::from(libc::timespec {
tv_sec: self.stat.st_atime as libc::time_t,
tv_nsec: self.stat.st_atime_nsec as libc::c_long,
tv_nsec: self.stat.st_atime_nsec as _,
}))
}

Expand Down
2 changes: 1 addition & 1 deletion src/libstd/sys/unix/thread.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ impl Thread {

pub fn sleep(dur: Duration) {
let mut secs = dur.as_secs();
let mut nsecs = dur.subsec_nanos() as libc::c_long;
let mut nsecs = dur.subsec_nanos() as _;

// If we're awoken with a signal then the return value will be -1 and
// nanosleep will fill in `ts` with the remaining time.
Expand Down
4 changes: 2 additions & 2 deletions src/libstd/sys/unix/time.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ impl Timespec {
Timespec {
t: libc::timespec {
tv_sec: secs,
tv_nsec: nsec as libc::c_long,
tv_nsec: nsec as _,
},
}
}
Expand All @@ -83,7 +83,7 @@ impl Timespec {
Timespec {
t: libc::timespec {
tv_sec: secs,
tv_nsec: nsec as libc::c_long,
tv_nsec: nsec as _,
},
}
}
Expand Down
1 change: 1 addition & 0 deletions src/test/codegen/issue-37945.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
// ignore-x86
// ignore-arm
// ignore-emscripten
// ignore-gnux32
// ignore 32-bit platforms (LLVM has a bug with them)

// See issue #37945.
Expand Down
2 changes: 1 addition & 1 deletion src/tools/compiletest/src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ pub fn get_env(triple: &str) -> Option<&str> {
}

pub fn get_pointer_width(triple: &str) -> &'static str {
if triple.contains("64") || triple.starts_with("s390x") {
if (triple.contains("64") && !triple.ends_with("gnux32")) || triple.starts_with("s390x") {
"64bit"
} else {
"32bit"
Expand Down