From 971027d5358aa034be9230fcd4c1ae981a32f5b5 Mon Sep 17 00:00:00 2001 From: gnzlbg <gonzalobg88@gmail.com> Date: Mon, 18 Feb 2019 21:25:19 +0100 Subject: [PATCH] Fix bitrig build --- ci/build.sh | 71 +++++++++---------- .../bsd/netbsdlike/openbsdlike/bitrig/x86.rs | 11 +++ .../netbsdlike/openbsdlike/bitrig/x86_64.rs | 11 +++ 3 files changed, 57 insertions(+), 36 deletions(-) diff --git a/ci/build.sh b/ci/build.sh index d98b3026..b33d89c4 100644 --- a/ci/build.sh +++ b/ci/build.sh @@ -52,42 +52,6 @@ test_target() { fi } -rustup component add rust-src || true -cargo install xargo || true - - -# FIXME: https://github.com/rust-lang/rust/issues/58564 -# sparc-unknown-linux-gnu -RUST_LINUX_NO_CORE_TARGETS="\ -x86_64-unknown-dragonfly \ -aarch64-pc-windows-msvc \ -aarch64-unknown-cloudabi \ -armv7-unknown-cloudabi-eabihf \ -i586-pc-windows-msvc \ -i686-pc-windows-gnu \ -i686-pc-windows-msvc \ -i686-unknown-cloudabi \ -i686-unknown-haiku \ -i686-unknown-netbsd \ -nvptx64-nvidia-cuda \ -powerpc-unknown-linux-gnuspe \ -riscv32imac-unknown-none-elf \ -riscv32imc-unknown-none-elf \ -sparc64-unknown-netbsd \ -thumbv8m.main-none-eabi \ -x86_64-pc-windows-gnu \ -x86_64-pc-windows-msvc -x86_64-unknown-bitrig \ -x86_64-unknown-haiku \ -x86_64-unknown-openbsd -" - -for TARGET in $RUST_LINUX_NO_CORE_TARGETS; do - if [ "${RUST}" = "nightly" ]; then - RUST_LIBC_NO_CORE_BUILD=1 test_target xargo "$TARGET" 1 - fi -done - RUST_LINUX_TARGETS="\ aarch64-linux-android \ aarch64-unknown-linux-gnu \ @@ -206,3 +170,38 @@ esac for TARGET in $TARGETS; do test_target cargo "$TARGET" done + +# FIXME: https://github.com/rust-lang/rust/issues/58564 +# sparc-unknown-linux-gnu +RUST_LINUX_NO_CORE_TARGETS="\ +x86_64-unknown-dragonfly \ +aarch64-pc-windows-msvc \ +aarch64-unknown-cloudabi \ +armv7-unknown-cloudabi-eabihf \ +i586-pc-windows-msvc \ +i686-pc-windows-gnu \ +i686-pc-windows-msvc \ +i686-unknown-cloudabi \ +i686-unknown-haiku \ +i686-unknown-netbsd \ +nvptx64-nvidia-cuda \ +powerpc-unknown-linux-gnuspe \ +riscv32imac-unknown-none-elf \ +riscv32imc-unknown-none-elf \ +sparc64-unknown-netbsd \ +thumbv8m.main-none-eabi \ +x86_64-pc-windows-gnu \ +x86_64-pc-windows-msvc +x86_64-unknown-bitrig \ +x86_64-unknown-haiku \ +x86_64-unknown-openbsd +" + +if [ "${RUST}" = "nightly" ]; then + rustup component add rust-src || true + cargo install xargo || true + + for TARGET in $RUST_LINUX_NO_CORE_TARGETS; do + RUST_LIBC_NO_CORE_BUILD=1 test_target xargo "$TARGET" 1 + done +fi diff --git a/src/unix/bsd/netbsdlike/openbsdlike/bitrig/x86.rs b/src/unix/bsd/netbsdlike/openbsdlike/bitrig/x86.rs index 9b0b338b..85a10622 100644 --- a/src/unix/bsd/netbsdlike/openbsdlike/bitrig/x86.rs +++ b/src/unix/bsd/netbsdlike/openbsdlike/bitrig/x86.rs @@ -1,2 +1,13 @@ pub type c_long = i32; pub type c_ulong = u32; + +// should be pub(crate), but that requires Rust 1.18.0 +cfg_if! { + if #[cfg(libc_const_size_of)] { + #[doc(hidden)] + pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_int>() - 1; + } else { + #[doc(hidden)] + pub const _ALIGNBYTES: usize = 4 - 1; + } +} diff --git a/src/unix/bsd/netbsdlike/openbsdlike/bitrig/x86_64.rs b/src/unix/bsd/netbsdlike/openbsdlike/bitrig/x86_64.rs index d3971aa3..b6ce54e2 100644 --- a/src/unix/bsd/netbsdlike/openbsdlike/bitrig/x86_64.rs +++ b/src/unix/bsd/netbsdlike/openbsdlike/bitrig/x86_64.rs @@ -8,3 +8,14 @@ pub const PT_GETREGS: ::c_int = PT_FIRSTMACH + 1; pub const PT_SETREGS: ::c_int = PT_FIRSTMACH + 2; pub const PT_GETFPREGS: ::c_int = PT_FIRSTMACH + 3; pub const PT_SETFPREGS: ::c_int = PT_FIRSTMACH + 4; + +// should be pub(crate), but that requires Rust 1.18.0 +cfg_if! { + if #[cfg(libc_const_size_of)] { + #[doc(hidden)] + pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_long>() - 1; + } else { + #[doc(hidden)] + pub const _ALIGNBYTES: usize = 8 - 1; + } +} -- GitLab