Skip to content
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

musl 1.2.x support #2088

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion ci/install-musl.sh
Expand Up @@ -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:
Expand Down
34 changes: 10 additions & 24 deletions 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;
Expand Down Expand Up @@ -269,30 +260,25 @@ 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],
pub ut_user: [::c_char; 32],
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],
Expand Down