Skip to content

Commit 8e5434c

Browse files
authored
ci: add CI for Linux/aarch64/musl and fix its build (#2510)
* ci: add CI for Linux/aarch64/musl * fix: enable RegisterSet and RegisterSetValue for aarch64/musl * fix: cfg * fix: cfg * style: make clippy happy
1 parent 47c0f42 commit 8e5434c

File tree

3 files changed

+60
-24
lines changed

3 files changed

+60
-24
lines changed

.cirrus.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,18 @@ task:
6868
# Tasks for Linux aarch64 native builds
6969
task:
7070
matrix:
71-
- name: Linux aarch64
71+
- name: Linux aarch64 gnu
7272
arm_container:
7373
image: rust:1.69.0
7474
cpu: 1
7575
env:
7676
TARGET: aarch64-unknown-linux-gnu
77+
- name: Linux aarch64 musl
78+
arm_container:
79+
image: rust:1.69.0
80+
cpu: 1
81+
env:
82+
TARGET: aarch64-unknown-linux-musl
7783
setup_script:
7884
- rustup target add $TARGET
7985
- rustup component add clippy

src/sys/ptrace/linux.rs

Lines changed: 43 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -173,13 +173,21 @@ libc_enum! {
173173

174174
#[cfg(all(
175175
target_os = "linux",
176-
target_env = "gnu",
177176
any(
178-
target_arch = "x86_64",
179-
target_arch = "x86",
180-
target_arch = "aarch64",
181-
target_arch = "riscv64",
182-
)
177+
all(
178+
target_env = "gnu",
179+
any(
180+
target_arch = "x86_64",
181+
target_arch = "x86",
182+
target_arch = "aarch64",
183+
target_arch = "riscv64",
184+
)
185+
),
186+
all(
187+
target_env = "musl",
188+
target_arch = "aarch64",
189+
)
190+
),
183191
))]
184192
libc_enum! {
185193
#[repr(i32)]
@@ -196,13 +204,21 @@ libc_enum! {
196204

197205
#[cfg(all(
198206
target_os = "linux",
199-
target_env = "gnu",
200207
any(
201-
target_arch = "x86_64",
202-
target_arch = "x86",
203-
target_arch = "aarch64",
204-
target_arch = "riscv64",
205-
)
208+
all(
209+
target_env = "gnu",
210+
any(
211+
target_arch = "x86_64",
212+
target_arch = "x86",
213+
target_arch = "aarch64",
214+
target_arch = "riscv64",
215+
)
216+
),
217+
all(
218+
target_env = "musl",
219+
target_arch = "aarch64",
220+
)
221+
),
206222
))]
207223
/// Represents register set areas, such as general-purpose registers or
208224
/// floating-point registers.
@@ -219,15 +235,24 @@ pub unsafe trait RegisterSet {
219235
type Regs;
220236
}
221237

238+
222239
#[cfg(all(
223240
target_os = "linux",
224-
target_env = "gnu",
225241
any(
226-
target_arch = "x86_64",
227-
target_arch = "x86",
228-
target_arch = "aarch64",
229-
target_arch = "riscv64",
230-
)
242+
all(
243+
target_env = "gnu",
244+
any(
245+
target_arch = "x86_64",
246+
target_arch = "x86",
247+
target_arch = "aarch64",
248+
target_arch = "riscv64",
249+
)
250+
),
251+
all(
252+
target_env = "musl",
253+
target_arch = "aarch64",
254+
)
255+
),
231256
))]
232257
/// Register sets used in [`getregset`] and [`setregset`]
233258
pub mod regset {

test/sys/test_ptrace.rs

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -179,12 +179,17 @@ fn test_ptrace_interrupt() {
179179
// ptrace::{setoptions, getregs} are only available in these platforms
180180
#[cfg(all(
181181
target_os = "linux",
182-
target_env = "gnu",
183182
any(
184-
target_arch = "x86_64",
185-
target_arch = "x86",
186-
target_arch = "aarch64",
187-
target_arch = "riscv64",
183+
all(
184+
target_env = "gnu",
185+
any(
186+
target_arch = "x86_64",
187+
target_arch = "x86",
188+
target_arch = "aarch64",
189+
target_arch = "riscv64"
190+
)
191+
),
192+
all(target_env = "musl", target_arch = "aarch64")
188193
)
189194
))]
190195
#[test]

0 commit comments

Comments
 (0)