Skip to content

Commit

Permalink
use lld linker for cross builds
Browse files Browse the repository at this point in the history
  • Loading branch information
antondlr committed Mar 26, 2024
1 parent 0ec722e commit 36d5c79
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 15 deletions.
26 changes: 13 additions & 13 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,19 +85,19 @@ jobs:
cargo install cross
env CROSS_PROFILE=${{ matrix.profile }} CROSS_FEATURES=${{ matrix.features.env }} make build-${{ matrix.binary }}
- name: move binary
run: |
mkdir ./bin; \
find ./target -type f -name "lighthouse" -exec mv {} /bin/ \;
# - name: Make bin dir
# run: mkdir ./bin
# - name: Move cross-built binary into Docker scope (if ARM)
# if: startsWith(matrix.binary, 'aarch64')
# run: mv ./target/aarch64-unknown-linux-gnu/${{ matrix.profile }}/lighthouse ./bin
# - name: Move cross-built binary into Docker scope (if x86_64)
# if: startsWith(matrix.binary, 'x86_64')
# run: mv ./target/x86_64-unknown-linux-gnu/${{ matrix.profile }}/lighthouse ./bin
# - name: move binary
# run: |
# mkdir ./bin; \
# find ./target -type f -name "lighthouse" -exec mv {} /bin/ \;

- name: Make bin dir
run: mkdir ./bin
- name: Move cross-built binary into Docker scope (if ARM)
if: startsWith(matrix.binary, 'aarch64')
run: mv ./target/aarch64-unknown-linux-gnu/${{ matrix.profile }}/lighthouse ./bin
- name: Move cross-built binary into Docker scope (if x86_64)
if: startsWith(matrix.binary, 'x86_64')
run: mv ./target/x86_64-unknown-linux-gnu/${{ matrix.profile }}/lighthouse ./bin

- name: Map aarch64 to arm64 short arch
if: startsWith(matrix.binary, 'aarch64')
Expand Down
6 changes: 4 additions & 2 deletions Cross.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
[target.x86_64-unknown-linux-gnu]
pre-build = ["apt-get install -y cmake clang-5.0"]
pre-build = ["apt-get install -y cmake clang-5.0 lld"]
rustflags = ["-C", "link-arg=-fuse-ld=lld"]

[target.aarch64-unknown-linux-gnu]
pre-build = ["apt-get install -y cmake clang-5.0"]
pre-build = ["apt-get install -y cmake clang-5.0 lld"]
rustflags = ["-C", "link-arg=-fuse-ld=lld"]

0 comments on commit 36d5c79

Please sign in to comment.