Skip to content
This repository was archived by the owner on Feb 11, 2025. It is now read-only.

Commit f7e31cc

Browse files
authored
add build support for aarch64 linux binary (#328)
1 parent a875e64 commit f7e31cc

File tree

2 files changed

+41
-2
lines changed

2 files changed

+41
-2
lines changed

.cargo/config

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[target.aarch64-unknown-linux-gnu]
2+
linker = "aarch64-linux-gnu-gcc"

.github/workflows/release.yaml

+39-2
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,13 @@ jobs:
2020
env: {},
2121
targetPath: "target/release/",
2222
}
23+
- {
24+
os: "ubuntu-latest",
25+
arch: "aarch64",
26+
extension: "",
27+
env: { OPENSSL_DIR: "/usr/local/openssl-aarch64" },
28+
targetPath: "target/aarch64-unknown-linux-gnu/release/",
29+
}
2330
- {
2431
os: "macos-latest",
2532
arch: "amd64",
@@ -68,15 +75,38 @@ jobs:
6875
default: true
6976
components: clippy, rustfmt
7077

78+
- name: setup for cross-compile builds
79+
if: matrix.config.arch == 'aarch64' && matrix.config.os == 'ubuntu-latest'
80+
run: |
81+
sudo apt install gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
82+
cd /tmp
83+
git clone https://github.com/openssl/openssl
84+
cd openssl
85+
git checkout OpenSSL_1_1_1l
86+
sudo mkdir -p $OPENSSL_DIR
87+
./Configure linux-aarch64 --prefix=$OPENSSL_DIR --openssldir=$OPENSSL_DIR shared
88+
make CC=aarch64-linux-gnu-gcc
89+
sudo make install
90+
rustup target add aarch64-unknown-linux-gnu
91+
7192
- name: Install latest Rust stable toolchain
7293
uses: actions-rs/toolchain@v1
73-
if: matrix.config.arch == 'aarch64'
94+
if: matrix.config.arch == 'aarch64' && matrix.config.os == 'macos-latest'
7495
with:
7596
toolchain: stable
7697
default: true
7798
components: clippy, rustfmt
7899
target: aarch64-apple-darwin
79100

101+
- name: Install latest Rust stable toolchain
102+
uses: actions-rs/toolchain@v1
103+
if: matrix.config.arch == 'aarch64' && matrix.config.os == 'ubuntu-latest'
104+
with:
105+
toolchain: stable
106+
default: true
107+
components: clippy, rustfmt
108+
target: aarch64-unknown-linux-gnu
109+
80110
- name: build release
81111
uses: actions-rs/cargo@v1
82112
if: matrix.config.arch != 'aarch64'
@@ -86,11 +116,18 @@ jobs:
86116

87117
- name: build release
88118
uses: actions-rs/cargo@v1
89-
if: matrix.config.arch == 'aarch64'
119+
if: matrix.config.arch == 'aarch64' && matrix.config.os == 'macos-latest'
90120
with:
91121
command: build
92122
args: "--all-features --release --target aarch64-apple-darwin"
93123

124+
- name: build release
125+
uses: actions-rs/cargo@v1
126+
if: matrix.config.arch == 'aarch64' && matrix.config.os == 'ubuntu-latest'
127+
with:
128+
command: build
129+
args: "--all-features --release --target aarch64-unknown-linux-gnu"
130+
94131
- name: package release assets
95132
shell: bash
96133
run: |

0 commit comments

Comments
 (0)