Skip to content

Commit

Permalink
static link to gcc
Browse files Browse the repository at this point in the history
  • Loading branch information
sunrisewestern committed Jan 3, 2025
1 parent 4cc07dc commit 8f9c3fd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ jobs:
if: ${{ matrix.target == 'aarch64-unknown-linux-gnu' }}
run: sudo apt install -y gcc-aarch64-linux-gnu

- name: Install static linking dependencies (Linux)
if: ${{ matrix.target == 'x86_64-unknown-linux-gnu' || matrix.target == 'aarch64-unknown-linux-gnu' }}
run: sudo apt-get update && sudo apt-get install -y musl-tools

- name: Setup caching
uses: Swatinem/rust-cache@v2

Expand Down Expand Up @@ -98,4 +102,4 @@ jobs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: artifacts/header-aarch64-unknown-linux-gnu/header-aarch64-unknown-linux-gnu
asset_name: header-aarch64-unknown-linux-gnu
asset_content_type: application/octet-stream
asset_content_type: application/octet-stream
5 changes: 4 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,7 @@ clap = "3.0.0"
[profile.release]
lto = true
codegen-units = 1
strip = true
strip = true

[target.'cfg(target_os = "linux")']
rustflags = ["-C", "link-arg=-static"]

0 comments on commit 8f9c3fd

Please sign in to comment.