Skip to content

Commit b2ca65b

Browse files
committed
[build] switch to lld on linux
1 parent 181e96f commit b2ca65b

File tree

4 files changed

+20
-3
lines changed

4 files changed

+20
-3
lines changed

.cargo/config

+3
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,6 @@ nextest = "run --package x --bin x -- nextest"
1111

1212
[target.x86_64-pc-windows-msvc]
1313
rustflags = ["-C", "link-arg=/STACK:8000000"]
14+
15+
[target.x86_64-unknown-linux-gnu]
16+
rustflags = ["-C", "link-arg=-fuse-ld=lld"]

.github/workflows/ci-pre-land.yml

+8-2
Original file line numberDiff line numberDiff line change
@@ -216,8 +216,12 @@ jobs:
216216
- prepare
217217
steps:
218218
- uses: actions/[email protected]
219-
- name: install rust toolchain
219+
- name: Install rust toolchain
220220
uses: actions-rs/toolchain@v1
221+
- name: Install lld
222+
uses: knicknic/[email protected]
223+
with:
224+
linux: sudo apt-get -y install lld
221225
- name: Use Node.js 14
222226
uses: actions/[email protected]
223227
with:
@@ -246,8 +250,10 @@ jobs:
246250
- prepare
247251
steps:
248252
- uses: actions/[email protected]
249-
- name: install rust toolchain
253+
- name: Install rust toolchain
250254
uses: actions-rs/toolchain@v1
255+
- name: Install lld
256+
run: sudo apt-get -y install lld
251257
- name: Use Node.js 14
252258
uses: actions/[email protected]
253259
with:

Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,6 @@ debug = true
109109
# use release settings to reduce memory pressure in the linking step in CI
110110
[profile.ci]
111111
inherits = "test"
112-
opt-level = 3
113112
debug = 0 # for saving disk space during linking
114113
incremental = false
115114
codegen-units = 16

scripts/dev_setup.sh

+9
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,13 @@ function install_gcc_powerpc_linux_gnu {
218218
#fi
219219
}
220220

221+
function install_lld {
222+
# Right now, only install lld for linux
223+
if [[ "$(uname)" == "Linux" ]]; then
224+
install_pkg lld "$PACKAGE_MANAGER"
225+
fi
226+
}
227+
221228
function install_toolchain {
222229
version=$1
223230
FOUND=$(rustup show | grep -c "$version" || true)
@@ -595,6 +602,8 @@ if [[ "$INSTALL_BUILD_TOOLS" == "true" ]]; then
595602
install_pkg clang "$PACKAGE_MANAGER"
596603
install_pkg llvm "$PACKAGE_MANAGER"
597604

605+
install_lld
606+
598607
install_gcc_powerpc_linux_gnu "$PACKAGE_MANAGER"
599608
install_openssl_dev "$PACKAGE_MANAGER"
600609
install_pkg_config "$PACKAGE_MANAGER"

0 commit comments

Comments
 (0)