Skip to content

Commit

Permalink
ci: add CI for Linux/aarch64/musl and fix its build (#2510)
Browse files Browse the repository at this point in the history
* ci: add CI for Linux/aarch64/musl

* fix: enable RegisterSet and RegisterSetValue for aarch64/musl

* fix: cfg

* fix: cfg

* style: make clippy happy
  • Loading branch information
SteveLauC authored Nov 18, 2024
1 parent 47c0f42 commit ba4e496
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 24 deletions.
8 changes: 7 additions & 1 deletion .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,18 @@ task:
# Tasks for Linux aarch64 native builds
task:
matrix:
- name: Linux aarch64
- name: Linux aarch64 gnu
arm_container:
image: rust:1.69.0
cpu: 1
env:
TARGET: aarch64-unknown-linux-gnu
- name: Linux aarch64 musl
arm_container:
image: rust:1.69.0
cpu: 1
env:
TARGET: aarch64-unknown-linux-musl
setup_script:
- rustup target add $TARGET
- rustup component add clippy
Expand Down
61 changes: 43 additions & 18 deletions src/sys/ptrace/linux.rs
Original file line number Diff line number Diff line change
Expand Up @@ -173,13 +173,21 @@ libc_enum! {

#[cfg(all(
target_os = "linux",
target_env = "gnu",
any(
target_arch = "x86_64",
target_arch = "x86",
target_arch = "aarch64",
target_arch = "riscv64",
)
all(
target_env = "gnu",
any(
target_arch = "x86_64",
target_arch = "x86",
target_arch = "aarch64",
target_arch = "riscv64",
)
),
all(
target_env = "musl",
target_arch = "aarch64",
)
),
))]
libc_enum! {
#[repr(i32)]
Expand All @@ -196,13 +204,21 @@ libc_enum! {

#[cfg(all(
target_os = "linux",
target_env = "gnu",
any(
target_arch = "x86_64",
target_arch = "x86",
target_arch = "aarch64",
target_arch = "riscv64",
)
all(
target_env = "gnu",
any(
target_arch = "x86_64",
target_arch = "x86",
target_arch = "aarch64",
target_arch = "riscv64",
)
),
all(
target_env = "musl",
target_arch = "aarch64",
)
),
))]
/// Represents register set areas, such as general-purpose registers or
/// floating-point registers.
Expand All @@ -219,15 +235,24 @@ pub unsafe trait RegisterSet {
type Regs;
}


#[cfg(all(
target_os = "linux",
target_env = "gnu",
any(
target_arch = "x86_64",
target_arch = "x86",
target_arch = "aarch64",
target_arch = "riscv64",
)
all(
target_env = "gnu",
any(
target_arch = "x86_64",
target_arch = "x86",
target_arch = "aarch64",
target_arch = "riscv64",
)
),
all(
target_env = "musl",
target_arch = "aarch64",
)
),
))]
/// Register sets used in [`getregset`] and [`setregset`]
pub mod regset {
Expand Down
15 changes: 10 additions & 5 deletions test/sys/test_ptrace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -179,12 +179,17 @@ fn test_ptrace_interrupt() {
// ptrace::{setoptions, getregs} are only available in these platforms
#[cfg(all(
target_os = "linux",
target_env = "gnu",
any(
target_arch = "x86_64",
target_arch = "x86",
target_arch = "aarch64",
target_arch = "riscv64",
all(
target_env = "gnu",
any(
target_arch = "x86_64",
target_arch = "x86",
target_arch = "aarch64",
target_arch = "riscv64"
)
),
all(target_env = "musl", target_arch = "aarch64")
)
))]
#[test]
Expand Down

0 comments on commit ba4e496

Please sign in to comment.