summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam C. Foltzer <acfoltzer@fastly.com>2019-06-26 15:51:08 -0700
committerAdam C. Foltzer <acfoltzer@fastly.com>2019-06-26 15:52:56 -0700
commitdba4138305c5cd28e33775d6d4059a1c5fe2292d (patch)
treeda90974769d2c2755adce96f2878de26a91d5d78
parent40c73a6eed61d4e02391161af2c175098b92a70e (diff)
downloadrust-libc-dba4138305c5cd28e33775d6d4059a1c5fe2292d.tar.gz
remove newer `__ssp` field from `ucontext_t` for earlier glib compat
Per discussion in #1410, this is necessary to avoid struct size mismatches between Rust and C on systems with glibc < 2.28.
-rw-r--r--libc-test/build.rs5
-rw-r--r--src/unix/linux_like/linux/gnu/b64/x86_64/mod.rs1
2 files changed, 4 insertions, 2 deletions
diff --git a/libc-test/build.rs b/libc-test/build.rs
index 06386f81d2..dc4fcc7344 100644
--- a/libc-test/build.rs
+++ b/libc-test/build.rs
@@ -1950,7 +1950,6 @@ fn test_linux(target: &str) {
"syslog.h",
"termios.h",
"time.h",
- "ucontext.h",
"unistd.h",
"utime.h",
"utmp.h",
@@ -1968,6 +1967,10 @@ fn test_linux(target: &str) {
// <execinfo.h> is not supported by musl:
// https://www.openwall.com/lists/musl/2015/04/09/3
[!musl]: "execinfo.h",
+ // 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
+ [!gnu]: "ucontext.h",
}
// Include linux headers at the end:
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..10d74e4125 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,6 @@ s_no_extra_traits! {
pub uc_mcontext: mcontext_t,
pub uc_sigmask: ::sigset_t,
__private: [u8; 512],
- __ssp: [::c_ulonglong; 4],
}
}