Skip to content

Commit ec7cb08

Browse files
committed
Fix bitrig build
1 parent fd162c5 commit ec7cb08

File tree

3 files changed

+57
-36
lines changed

3 files changed

+57
-36
lines changed

ci/build.sh

Lines changed: 35 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -52,42 +52,6 @@ test_target() {
5252
fi
5353
}
5454

55-
rustup component add rust-src || true
56-
cargo install xargo || true
57-
58-
59-
# FIXME: https://github.com/rust-lang/rust/issues/58564
60-
# sparc-unknown-linux-gnu
61-
RUST_LINUX_NO_CORE_TARGETS="\
62-
x86_64-unknown-dragonfly \
63-
aarch64-pc-windows-msvc \
64-
aarch64-unknown-cloudabi \
65-
armv7-unknown-cloudabi-eabihf \
66-
i586-pc-windows-msvc \
67-
i686-pc-windows-gnu \
68-
i686-pc-windows-msvc \
69-
i686-unknown-cloudabi \
70-
i686-unknown-haiku \
71-
i686-unknown-netbsd \
72-
nvptx64-nvidia-cuda \
73-
powerpc-unknown-linux-gnuspe \
74-
riscv32imac-unknown-none-elf \
75-
riscv32imc-unknown-none-elf \
76-
sparc64-unknown-netbsd \
77-
thumbv8m.main-none-eabi \
78-
x86_64-pc-windows-gnu \
79-
x86_64-pc-windows-msvc
80-
x86_64-unknown-bitrig \
81-
x86_64-unknown-haiku \
82-
x86_64-unknown-openbsd
83-
"
84-
85-
for TARGET in $RUST_LINUX_NO_CORE_TARGETS; do
86-
if [ "${RUST}" = "nightly" ]; then
87-
RUST_LIBC_NO_CORE_BUILD=1 test_target xargo "$TARGET" 1
88-
fi
89-
done
90-
9155
RUST_LINUX_TARGETS="\
9256
aarch64-linux-android \
9357
aarch64-unknown-linux-gnu \
@@ -206,3 +170,38 @@ esac
206170
for TARGET in $TARGETS; do
207171
test_target cargo "$TARGET"
208172
done
173+
174+
# FIXME: https://github.com/rust-lang/rust/issues/58564
175+
# sparc-unknown-linux-gnu
176+
RUST_LINUX_NO_CORE_TARGETS="\
177+
x86_64-unknown-dragonfly \
178+
aarch64-pc-windows-msvc \
179+
aarch64-unknown-cloudabi \
180+
armv7-unknown-cloudabi-eabihf \
181+
i586-pc-windows-msvc \
182+
i686-pc-windows-gnu \
183+
i686-pc-windows-msvc \
184+
i686-unknown-cloudabi \
185+
i686-unknown-haiku \
186+
i686-unknown-netbsd \
187+
nvptx64-nvidia-cuda \
188+
powerpc-unknown-linux-gnuspe \
189+
riscv32imac-unknown-none-elf \
190+
riscv32imc-unknown-none-elf \
191+
sparc64-unknown-netbsd \
192+
thumbv8m.main-none-eabi \
193+
x86_64-pc-windows-gnu \
194+
x86_64-pc-windows-msvc
195+
x86_64-unknown-bitrig \
196+
x86_64-unknown-haiku \
197+
x86_64-unknown-openbsd
198+
"
199+
200+
if [ "${RUST}" = "nightly" ]; then
201+
rustup component add rust-src || true
202+
cargo install xargo || true
203+
204+
for TARGET in $RUST_LINUX_NO_CORE_TARGETS; do
205+
RUST_LIBC_NO_CORE_BUILD=1 test_target xargo "$TARGET" 1
206+
done
207+
fi
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,13 @@
11
pub type c_long = i32;
22
pub type c_ulong = u32;
3+
4+
// should be pub(crate), but that requires Rust 1.18.0
5+
cfg_if! {
6+
if #[cfg(libc_const_size_of)] {
7+
#[doc(hidden)]
8+
pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_int>() - 1;
9+
} else {
10+
#[doc(hidden)]
11+
pub const _ALIGNBYTES: usize = 4 - 1;
12+
}
13+
}

src/unix/bsd/netbsdlike/openbsdlike/bitrig/x86_64.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,14 @@ pub const PT_GETREGS: ::c_int = PT_FIRSTMACH + 1;
88
pub const PT_SETREGS: ::c_int = PT_FIRSTMACH + 2;
99
pub const PT_GETFPREGS: ::c_int = PT_FIRSTMACH + 3;
1010
pub const PT_SETFPREGS: ::c_int = PT_FIRSTMACH + 4;
11+
12+
// should be pub(crate), but that requires Rust 1.18.0
13+
cfg_if! {
14+
if #[cfg(libc_const_size_of)] {
15+
#[doc(hidden)]
16+
pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_long>() - 1;
17+
} else {
18+
#[doc(hidden)]
19+
pub const _ALIGNBYTES: usize = 8 - 1;
20+
}
21+
}

0 commit comments

Comments
 (0)