Repository navigation
105 lines (92 loc) · 3.76 KB
/
Copy pathksuinit.yml
File metadata and controls
105 lines (92 loc) · 3.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
name: Build ksuinit
on:
workflow_call:
inputs:
os:
required: false
type: string
default: ubuntu-latest
jobs:
build:
runs-on: ${{ inputs.os }}
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
- name: Setup rustup
run: |
rustup update stable
rustup target add aarch64-linux-android
rustup target add x86_64-linux-android
- uses: nttld/setup-ndk@v1
id: setup-ndk
with:
ndk-version: r29
- uses: Swatinem/rust-cache@v2
with:
workspaces: userspace/ksuinit
cache-targets: false
- name: Build ksuinit
env:
ANDROID_NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }}
run: |
LLVM_BIN=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin
export CLANG_PATH="$LLVM_BIN/aarch64-linux-android26-clang"
export CARGO_TARGET_AARCH64_LINUX_ANDROID_LINKER="$CLANG_PATH"
BUILTINS="$($CLANG_PATH --print-resource-dir)/lib/linux/libclang_rt.builtins-aarch64-android.a"
export RUSTFLAGS="-C target-feature=+crt-static -C link-arg=-Wl,-z,max-page-size=16384 -C link-arg=-Wno-unused-command-line-argument -C link-arg=$BUILTINS"
cd userspace/ksuinit
cargo build --target=aarch64-linux-android --release
- name: Upload ksuinit artifact
uses: actions/upload-artifact@v7
with:
name: ksuinit-aarch64
path: userspace/ksuinit/target/aarch64-linux-android/release/ksuinit*
- name: Build ksuinit x64
env:
ANDROID_NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }}
run: |
LLVM_BIN=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin
export CLANG_PATH="$LLVM_BIN/x86_64-linux-android26-clang"
export CARGO_TARGET_X86_64_LINUX_ANDROID_LINKER="$CLANG_PATH"
BUILTINS="$($CLANG_PATH --print-resource-dir)/lib/linux/libclang_rt.builtins-x86_64-android.a"
export RUSTFLAGS="-C target-feature=+crt-static -C link-arg=-Wl,-z,max-page-size=16384 -C link-arg=-Wno-unused-command-line-argument -C link-arg=$BUILTINS"
cd userspace/ksuinit
cargo build --target=x86_64-linux-android --release
- name: Upload x64 ksuinit artifact
uses: actions/upload-artifact@v7
with:
name: ksuinit-x86_64
path: userspace/ksuinit/target/x86_64-linux-android/release/ksuinit*
build-riscv64:
runs-on: ${{ inputs.os }}
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
- name: Setup Rust
run: rustup toolchain install nightly-2026-09-23 --profile minimal --component rust-src
- uses: nttld/setup-ndk@v1
id: setup-ndk
with:
ndk-version: r29
- uses: Swatinem/rust-cache@v2
with:
workspaces: userspace/ksuinit
cache-targets: false
- name: Build RISC-V ksuinit
env:
ANDROID_NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }}
run: |
LLVM_BIN=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin
export CLANG_PATH="$LLVM_BIN/riscv64-linux-android35-clang"
export CARGO_TARGET_RISCV64_LINUX_ANDROID_LINKER="$CLANG_PATH"
BUILTINS="$($CLANG_PATH --print-resource-dir)/lib/linux/libclang_rt.builtins-riscv64-android.a"
export RUSTFLAGS="-C target-feature=+crt-static -C link-arg=-Wl,-z,max-page-size=16384 -C link-arg=-Wno-unused-command-line-argument -C link-arg=$BUILTINS"
cd userspace/ksuinit
cargo +nightly-2026-09-23 build --config ../../.github/riscv64-cargo.toml -Z build-std=std,panic_abort --target=riscv64-linux-android --release
- name: Upload RISC-V ksuinit artifact
uses: actions/upload-artifact@v7
with:
name: ksuinit-riscv64
path: userspace/ksuinit/target/riscv64-linux-android/release/ksuinit