summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2019-06-27 18:46:59 +0000
committerbors <bors@rust-lang.org>2019-06-27 18:46:59 +0000
commit8773f33c9561f30616fb1a90fb9b2fe9bd13029c (patch)
treec840989e19e05cc9936e1f828043ca442580606f
parent4f4e81a030c2b42a9ad2331bf26a3f44cc1a8eab (diff)
parentf6e48fc77c87fa51027e1bf6eb6ff2dc2f4845af (diff)
downloadrust-libc-8773f33c9561f30616fb1a90fb9b2fe9bd13029c.tar.gz
Auto merge of #1411 - acfoltzer:ucontext-compat, r=gnzlbg
Remove new field from ucontext_t for compatibility with earlier glibc versions Per discussion in #1410 with @gnzlbg, this is necessary to avoid struct size mismatches between Rust and C on systems with glibc < 2.28.
-rw-r--r--ci/style.rs4
-rw-r--r--libc-test/build.rs6
-rw-r--r--src/unix/linux_like/linux/gnu/b64/x86_64/mod.rs6
3 files changed, 13 insertions, 3 deletions
diff --git a/ci/style.rs b/ci/style.rs
index 481f57f74d..70fc0a0814 100644
--- a/ci/style.rs
+++ b/ci/style.rs
@@ -117,7 +117,7 @@ fn check_style(file: &str, path: &Path, err: &mut Errors) {
} else {
prev_blank = false;
}
- if line != line.trim_right() {
+ if line != line.trim_end() {
err.error(path, i, "trailing whitespace");
}
if line.contains("\t") {
@@ -139,7 +139,7 @@ fn check_style(file: &str, path: &Path, err: &mut Errors) {
}
}
- let line = line.trim_left();
+ let line = line.trim_start();
let is_pub = line.starts_with("pub ");
let line = if is_pub {&line[4..]} else {line};
diff --git a/libc-test/build.rs b/libc-test/build.rs
index 06386f81d2..722a513c32 100644
--- a/libc-test/build.rs
+++ b/libc-test/build.rs
@@ -2098,6 +2098,12 @@ fn test_linux(target: &str) {
// FIXME: musl version using by mips build jobs 1.0.15 is ancient:
"ifmap" | "ifreq" | "ifconf" if mips32_musl => true,
+ // FIXME: remove once Ubuntu 20.04 LTS is released, somewhere in 2020.
+ // ucontext_t added a new field as of glibc 2.28; our struct definition is
+ // conservative and omits the field, but that means the size doesn't match for newer
+ // glibcs (see https://github.com/rust-lang/libc/issues/1410)
+ "ucontext_t" if gnu => true,
+
_ => false,
}
});
diff --git a/src/unix/linux_like/linux/gnu/b64/x86_64/mod.rs b/src/unix/linux_like/linux/gnu/b64/x86_64/mod.rs
index 1318713a42..f3b10084fd 100644
--- a/src/unix/linux_like/linux/gnu/b64/x86_64/mod.rs
+++ b/src/unix/linux_like/linux/gnu/b64/x86_64/mod.rs
@@ -285,7 +285,11 @@ s_no_extra_traits! {
pub uc_mcontext: mcontext_t,
pub uc_sigmask: ::sigset_t,
__private: [u8; 512],
- __ssp: [::c_ulonglong; 4],
+ // FIXME: the shadow stack field requires glibc >= 2.28.
+ // Re-add once we drop compatibility with glibc versions older than
+ // 2.28.
+ //
+ // __ssp: [::c_ulonglong; 4],
}
}