Skip to content

ci: add CI for Linux/aarch64/musl and fix its build #2510

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Nov 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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