Skip to content

Commit a36a282

Browse files
authored
fix: link libz.a on Linux x64 gnu (#95)
* fix: link libz.a on Linux x64 gnu * c99 * latest llvm * arm * omit std=c99
1 parent bb9e05e commit a36a282

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

.github/workflows/CI.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,9 @@ jobs:
6363
- host: windows-latest
6464
build: yarn build --target i686-pc-windows-msvc
6565
target: i686-pc-windows-msvc
66-
- host: ubuntu-latest
66+
- host: ubuntu-24.04-arm
6767
target: x86_64-unknown-linux-gnu
68-
build: |
69-
sudo ln -sf /usr/lib/x86_64-linux-gnu/libz.a /usr/lib
70-
TARGET_CC=clang yarn build --target x86_64-unknown-linux-gnu --use-napi-cross
68+
build: TARGET_CC=clang yarn build --target x86_64-unknown-linux-gnu --use-napi-cross
7169
- host: ubuntu-latest
7270
target: x86_64-unknown-linux-musl
7371
build: yarn build --target x86_64-unknown-linux-musl -x
@@ -115,6 +113,11 @@ jobs:
115113
with:
116114
node-version: 22
117115
cache: yarn
116+
- name: Install LLVM and Clang
117+
uses: KyleMayes/install-llvm-action@v2
118+
if: ${{ contains(matrix.settings.target, 'gnu') }}
119+
with:
120+
version: "19"
118121
- name: Install
119122
uses: dtolnay/rust-toolchain@stable
120123
with:

Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ version = "3.0"
2424
[target.'cfg(all(target_os = "linux", target_env = "gnu", any(target_arch = "x86_64", target_arch = "aarch64")))'.dependencies]
2525
dirs = "6"
2626

27+
[target.'cfg(all(target_os = "linux", target_env = "gnu", target_arch = "x86_64"))'.dependencies]
28+
libz-sys = { version = "1", features = ["static"] }
29+
2730
[build-dependencies]
2831
napi-build = "2"
2932

0 commit comments

Comments
 (0)