Skip to content

Commit

Permalink
feat(bench-build): apply -Wl,-s only for quick-build-*
Browse files Browse the repository at this point in the history
  • Loading branch information
strager committed Jan 3, 2023
1 parent aa18ab6 commit b79fa67
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 58 deletions.
6 changes: 0 additions & 6 deletions rust-threecrate-cratecargotest/.cargo/config.toml

This file was deleted.

6 changes: 0 additions & 6 deletions rust-threecrate-crateunotest/.cargo/config.toml

This file was deleted.

6 changes: 0 additions & 6 deletions rust-twocrate-cratecargotest/.cargo/config.toml

This file was deleted.

6 changes: 0 additions & 6 deletions rust-twocrate-unittest/.cargo/config.toml

This file was deleted.

6 changes: 0 additions & 6 deletions rust-workspace-cratecargotest-16/.cargo/config.toml

This file was deleted.

6 changes: 0 additions & 6 deletions rust-workspace-cratecargotest-24/.cargo/config.toml

This file was deleted.

6 changes: 0 additions & 6 deletions rust-workspace-cratecargotest-8/.cargo/config.toml

This file was deleted.

6 changes: 0 additions & 6 deletions rust-workspace-crateunotest/.cargo/config.toml

This file was deleted.

6 changes: 0 additions & 6 deletions rust/.cargo/config.toml

This file was deleted.

18 changes: 14 additions & 4 deletions tools/bench-build.py
Original file line number Diff line number Diff line change
Expand Up @@ -522,28 +522,38 @@ def add_rust_configs(
"quick-build-incremental",
"quick-build-nonincremental",
):
rustflags = ""
if cargo_profile in (
"quick-build-incremental",
"quick-build-nonincremental",
):
# Avoid linking Rust std's debug info, improving link times.
# TODO(strager): Only use this where the linker flag is supported.
# HACK(strager): We would put this in the Cargo.toml, but
# profile-specific rustflags are unstable.
rustflags = f"{rustflags} -Clink-args=-Wl,-s"
add_rust_configs(
extra_label=f"{cargo_profile or ''}",
cargo_profile=cargo_profile,
rustflags="",
rustflags=rustflags,
)
if MOLD_LINKER_EXE is not None:
add_rust_configs(
extra_label=f"Mold {cargo_profile or ''}",
cargo_profile=cargo_profile,
rustflags=f"-Clinker=clang -Clink-arg=-fuse-ld={MOLD_LINKER_EXE}",
rustflags=f"{rustflags} -Clinker=clang -Clink-arg=-fuse-ld={MOLD_LINKER_EXE}",
)
if ZLD_LINKER_EXE is not None:
add_rust_configs(
extra_label=f"zld {cargo_profile or ''}",
cargo_profile=cargo_profile,
rustflags=f"-Clinker=clang -Clink-arg=-fuse-ld={ZLD_LINKER_EXE}",
rustflags=f"{rustflags} -Clinker=clang -Clink-arg=-fuse-ld={ZLD_LINKER_EXE}",
)
if LD64_LLD_LINKER_EXE is not None:
add_rust_configs(
extra_label=f"ld64.lld {cargo_profile or ''}",
cargo_profile=cargo_profile,
rustflags=f"-Clinker=clang -Clink-arg=-fuse-ld={LD64_LLD_LINKER_EXE}",
rustflags=f"{rustflags} -Clinker=clang -Clink-arg=-fuse-ld={LD64_LLD_LINKER_EXE}",
)
return reversed(rust_configs)

Expand Down

0 comments on commit b79fa67

Please sign in to comment.