Skip to content

Commit dba4138

Browse files
committed
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.
1 parent 40c73a6 commit dba4138

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

libc-test/build.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1950,7 +1950,6 @@ fn test_linux(target: &str) {
19501950
"syslog.h",
19511951
"termios.h",
19521952
"time.h",
1953-
"ucontext.h",
19541953
"unistd.h",
19551954
"utime.h",
19561955
"utmp.h",
@@ -1968,6 +1967,10 @@ fn test_linux(target: &str) {
19681967
// <execinfo.h> is not supported by musl:
19691968
// https://www.openwall.com/lists/musl/2015/04/09/3
19701969
[!musl]: "execinfo.h",
1970+
// ucontext_t added a new field as of glibc 2.28; our struct definition is
1971+
// conservative and omits the field, but that means the size doesn't match for newer
1972+
// glibcs
1973+
[!gnu]: "ucontext.h",
19711974
}
19721975

19731976
// Include linux headers at the end:

src/unix/linux_like/linux/gnu/b64/x86_64/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,6 @@ s_no_extra_traits! {
285285
pub uc_mcontext: mcontext_t,
286286
pub uc_sigmask: ::sigset_t,
287287
__private: [u8; 512],
288-
__ssp: [::c_ulonglong; 4],
289288
}
290289
}
291290

0 commit comments

Comments
 (0)