Skip to content

Commit

Permalink
chore: try link with mold
Browse files Browse the repository at this point in the history
  • Loading branch information
everpcpc committed Apr 2, 2022
1 parent ffd2c96 commit e6ac267
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/actions/build_debug/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ runs:
if: "contains(inputs.target, 'linux')"
uses: ./.github/actions/setup_build_tool
with:
image: datafuselabs/build-tool:multiarch
image: everpcpc/build-tool:multiarch

# If you need to reset the cache version, increment the number after `v`
- uses: Swatinem/rust-cache@v1
Expand Down
1 change: 1 addition & 0 deletions .github/actions/test_unit/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ runs:
- name: Setup Build Tool
uses: ./.github/actions/setup_build_tool
with:
image: everpcpc/build-tool:dev-debian-amd64
bypass_env_vars: RUST_TEST_THREADS,RUST_LOG,RUST_BACKTRACE

# If you need to reset the cache version, increment the number after `v`
Expand Down
6 changes: 6 additions & 0 deletions docker/build-tool/debian/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ RUN chmod +x /build/scripts/setup/dev_setup.sh && \
mv /root/.cargo /opt/rust/cargo && \
mv /root/.rustup /opt/rust/rustup

RUN curl -qL https://github.com/rui314/mold/releases/download/v1.1.1/mold-1.1.1-x86_64-linux.tar.gz -o /tmp/mold.tar.gz && \
tar --strip-components=1 -xzf /tmp/mold.tar.gz -C /usr/local && \
rm -rf /tmp/mold.tar.gz

COPY scripts/setup/cargo_config.toml /opt/rust/cargo/config

ENV RUSTUP_HOME /opt/rust/rustup
ENV CARGO_HOME /opt/rust/cargo
ENV PATH /opt/rust/cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
Expand Down
6 changes: 6 additions & 0 deletions scripts/setup/cargo_config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[target.x86_64-unknown-linux-gnu]
linker = "clang"
rustflags = ["-C", "link-arg=-fuse-ld=/usr/local/bin/mold"]
[target.aarch64-unknown-linux-gnu]
linker = "clang"
rustflags = ["-C", "link-arg=-fuse-ld=/usr/local/bin/mold"]
5 changes: 0 additions & 5 deletions scripts/setup/cross_setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,3 @@ apt-get install -yq libssl-dev libssl-dev:arm64 zlib1g-dev zlib1g-dev:arm64

rustup target add x86_64-unknown-linux-gnu
rustup target add aarch64-unknown-linux-gnu

cat <<EOF >${CARGO_HOME}/config
[target.aarch64-unknown-linux-gnu]
linker = "aarch64-linux-gnu-gcc"
EOF

0 comments on commit e6ac267

Please sign in to comment.