diff --git a/ci/build.sh b/ci/build.sh
index d98b30267459081c271dbbd192026d8ced11d5dd..b33d89c40fc37fe1ba6ef380239a66f038e34bb6 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 9b0b338b91e5b52050c6d0edab5b3d5ea0263037..85a106227e0f1837f580b858465943b4dc5c3af2 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 d3971aa35b87b94d834d4526ea5453b3e21eb301..b6ce54e2c2641050d8e22a1a11ad2df52a6165c5 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;
+    }
+}