From 05c268e4d152664401ebe32d56885de335274213 Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Sun, 28 Feb 2021 15:19:43 +0000 Subject: [PATCH 1/3] ci: install-musl: upgrade to 1.2.2 --- ci/install-musl.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/install-musl.sh b/ci/install-musl.sh index 54fd343f07b37..dcdbb07a8f273 100644 --- a/ci/install-musl.sh +++ b/ci/install-musl.sh @@ -5,7 +5,7 @@ set -ex -MUSL_VERSION=1.1.24 +MUSL_VERSION=1.2.2 MUSL="musl-${MUSL_VERSION}" # Download, configure, build, and install musl: From b133c0648db930fc64d2faf1deb01b2ffb747d88 Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Sun, 28 Feb 2021 15:31:22 +0000 Subject: [PATCH 2/3] musl: define time_t as i64 type. musl 1.1 maintenance has for all practical purposes ended. Accordingly, there is no point in supporting both 1.1 and 1.2 in the libc crate, so follow the time_t type transition to 64-bit. --- src/unix/linux_like/linux/musl/mod.rs | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/src/unix/linux_like/linux/musl/mod.rs b/src/unix/linux_like/linux/musl/mod.rs index 5331a28bf0b94..5b0b57d532524 100644 --- a/src/unix/linux_like/linux/musl/mod.rs +++ b/src/unix/linux_like/linux/musl/mod.rs @@ -1,15 +1,6 @@ pub type pthread_t = *mut ::c_void; pub type clock_t = c_long; -#[cfg_attr( - not(feature = "rustc-dep-of-std"), - deprecated( - since = "0.2.80", - note = "This type is changed to 64-bit in musl 1.2.0, \ - we'll follow that change in the future release. \ - See #1848 for more info." - ) -)] -pub type time_t = c_long; +pub type time_t = i64; pub type suseconds_t = c_long; pub type ino_t = u64; pub type off_t = i64; From 18753f7c1708bb4b1f9f1063232ccc23661b4a5d Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Sun, 28 Feb 2021 15:36:29 +0000 Subject: [PATCH 3/3] musl: fix utmpx struct layout - add padding members for musl 1.2 - ensure the padding members have an appropriate type (always c_int) --- src/unix/linux_like/linux/musl/mod.rs | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/src/unix/linux_like/linux/musl/mod.rs b/src/unix/linux_like/linux/musl/mod.rs index 5b0b57d532524..3df6a9c4e0a96 100644 --- a/src/unix/linux_like/linux/musl/mod.rs +++ b/src/unix/linux_like/linux/musl/mod.rs @@ -260,14 +260,9 @@ s_no_extra_traits! { pub __reserved: [::c_char; 256], } - // FIXME: musl added paddings and adjusted - // layout in 1.2.0 but our CI is still 1.1.24. - // So, I'm leaving some fields as comments for now. - // ref. https://github.com/bminor/musl/commit/ - // 1e7f0fcd7ff2096904fd93a2ee6d12a2392be392 pub struct utmpx { pub ut_type: ::c_short, - //__ut_pad1: ::c_short, + __ut_pad1: ::c_short, pub ut_pid: ::pid_t, pub ut_line: [::c_char; 32], pub ut_id: [::c_char; 4], @@ -275,15 +270,15 @@ s_no_extra_traits! { pub ut_host: [::c_char; 256], pub ut_exit: __exit_status, - //#[cfg(target_endian = "little")] - pub ut_session: ::c_long, - //#[cfg(target_endian = "little")] - //__ut_pad2: ::c_long, + #[cfg(target_endian = "little")] + pub ut_session: ::c_int, + #[cfg(target_endian = "little")] + __ut_pad2: ::c_int, - //#[cfg(not(target_endian = "little"))] - //__ut_pad2: ::c_int, - //#[cfg(not(target_endian = "little"))] - //pub ut_session: ::c_int, + #[cfg(not(target_endian = "little"))] + __ut_pad2: ::c_int, + #[cfg(not(target_endian = "little"))] + pub ut_session: ::c_int, pub ut_tv: ::timeval, pub ut_addr_v6: [::c_uint; 4],