rustc will use rust-lld by default on x86_64-unknown-linux-gnu on nightly to significantly reduce linking times.rustc will use rust-lld by default on x86_64-unknown-linux-gnu on nightly to significantly reduce linking times.

rust-lld: How It Can Give You Faster Linking Times

TL;DR: rustc will use rust-lld by default on x86_64-unknown-linux-gnu on nightly to significantly reduce linking times.

Some context

Linking time is often a big part of compilation time. When rustc needs to build a binary or a shared library, it will usually call the default linker installed on the system to do that (this can be changed on the command-line or by the target for which the code is compiled).

\ The linkers do an important job, with concerns about stability, backwards-compatibility and so on. For these and other reasons, on the most popular operating systems they usually are older programs, designed when computers only had a single core. So, they usually tend to be slow on a modern machine. For example, when building ripgrep 13 in debug mode on Linux, roughly half of the time is actually spent in the linker.

\ There are different linkers, however, and the usual advice to improve linking times is to use one of these newer and faster linkers, like LLVM's lld or Rui Ueyama's mold.

\ Some of Rust's wasm and aarch64 targets already use lld by default. When using rustup, rustc ships with a version of lld for this purpose. When CI builds LLVM to use in the compiler, it also builds the linker and packages it. It's referred to as rust-lld to avoid colliding with any lld already installed on the user's machine.

\ Since improvements to linking times are substantial, it would be a good default to use in the most popular targets. This has been discussed for a long time, for example in issues #39915 and #71515, and rustc already offers nightly flags to use rust-lld.

\ By now, we believe we've done all the internal testing that we could, on CI, crater, and our benchmarking infrastructure. We would now like to expand testing and gather real-world feedback and use-cases. Therefore, we will enable rust-lld to be the linker used by default on x86_64-unknown-linux-gnu for nightly builds.

Benefits

While this also enables the compiler to use more linker features in the future, the most immediate benefit is much improved linking times.

\ Here are more details from the ripgrep example mentioned above: linking is reduced 7x, resulting in a 40% reduction in end-to-end compilation times.

Before/after comparison of a ripgrep debug build

Most binaries should see some improvements here, but it's especially significant with e.g. bigger binaries, or when involving debuginfo. These usually see bottlenecks in the linker.

\ Here's a link to the complete results from our benchmarks.

\ If testing goes well, we can then stabilize using this faster linker by default for x86_64-unknown-linux-gnu users, before maybe looking at other targets.

Possible drawbacks

From our prior testing, we don't really expect issues to happen in practice. It is a drop-in replacement for the vast majority of cases, but lld is not bug-for-bug compatible with GNU ld.

\ In any case, using rust-lld can be disabled if any problem occurs: use the -Z linker-features=-lld flag to revert to using the system's default linker.

\ Some crates somehow relying on these differences could need additional link args. For example, we saw <20 crates in the crater run failing to link because of a different default about encapsulation symbols: these could require -Clink-arg=-Wl,-z,nostart-stop-gc to match the legacy GNU ld behavior.

\ Some of the big gains in performance come from parallelism, which could be undesirable in resource-constrained environments.

Summary

rustc will use rust-lld on x86_64-unknown-linux-gnu nightlies, for much improved linking times, starting in tomorrow's rustup nightly (nightly-2024-05-18). Let us know if you encounter problems, by opening an issue on GitHub.

\ If that happens, you can revert to the default linker with the -Z linker-features=-lld flag. Either by adding it to the usual RUSTFLAGS environment variable, or to a project's .cargo/config.toml configuration file, like so:

[target.x86_64-unknown-linux-gnu] rustflags = ["-Zlinker-features=-lld"] 

Rémy Rakic on behalf of the compiler performance working group

\ Also published here

\ Photo by Antoine Gravier on Unsplash

Market Opportunity
Liberland Logo
Liberland Price(LLD)
$1,016
$1,016$1,016
+3,88%
USD
Liberland (LLD) Live Price Chart
Disclaimer: The articles reposted on this site are sourced from public platforms and are provided for informational purposes only. They do not necessarily reflect the views of MEXC. All rights remain with the original authors. If you believe any content infringes on third-party rights, please contact service@support.mexc.com for removal. MEXC makes no guarantees regarding the accuracy, completeness, or timeliness of the content and is not responsible for any actions taken based on the information provided. The content does not constitute financial, legal, or other professional advice, nor should it be considered a recommendation or endorsement by MEXC.

You May Also Like

NZD/USD holds losses below 0.5750 ahead of China trade data

NZD/USD holds losses below 0.5750 ahead of China trade data

The post NZD/USD holds losses below 0.5750 ahead of China trade data appeared on BitcoinEthereumNews.com. NZD/USD extends its losses for the second successive day
Share
BitcoinEthereumNews2026/01/14 09:54
US SEC approves options tied to Grayscale Digital Large Cap Fund and Cboe Bitcoin US ETF Index

US SEC approves options tied to Grayscale Digital Large Cap Fund and Cboe Bitcoin US ETF Index

PANews reported on September 18th that the U.S. Securities and Exchange Commission (SEC) announced that, in addition to approving universal listing standards for commodity-based trust units , the SEC has also approved the listing and trading of the Grayscale Digital Large Cap Fund, which holds spot digital assets based on the CoinDesk 5 index. The SEC also approved the listing and trading of PM-settled options on the Cboe Bitcoin US ETF Index and the Mini-Cboe Bitcoin US ETF Index, with expiration dates including third Fridays, non-standard expiration dates, and quarterly index expiration dates.
Share
PANews2025/09/18 07:18
SUI Price Eyes Breakout, Targets $11 Says Analyst

SUI Price Eyes Breakout, Targets $11 Says Analyst

The post SUI Price Eyes Breakout, Targets $11 Says Analyst appeared on BitcoinEthereumNews.com. SUI price shows a technical setup for a macro breakout with analyst Dan Gambardello targeting $10-$11 levels. Recent partnership with Google’s Agentic Payments Protocol adds fundamental support to the technical analysis as SUI moves closer to potential breakout levels. SUI Price Analysis Points to $10-$11 Breakout Target Dan Gambardello has identified a clear ascending triangle formation on SUI price daily chart with upside targets around $10.79. The analyst simplified this target range to $10-$11 for practical trading purposes. The pattern shows sustained higher lows meeting resistance at current levels before a potential breakout. VanEck maintains more aggressive SUI crypto targets ranging from $13-$25 according to Gambardello’s research. SUI Price Analysis | Source: Dan Gambardello, X The $10 level is a more conservative higher high area for the current cycle. Midterm targets point to $7.50 in the 1.618 Fibonacci extension zone before longer-term objectives. The monthly RSI shows extreme compression that Gambardello describes as “screaming for a macro breakout to the upside.” This momentum oscillator behavior typically precedes major price movements in the crypto market. SUI crypto risk model currently sits at 51 and matches pre-bull market levels seen in coins like Ethereum. Gambardello compared this to Ethereum’s December 2020 reading of 51 before its major breakout. The March 2017 Ethereum reading of 53 preceded that cycle’s parabolic move. The analyst also noted that SUI price trades near the same levels from almost a year ago in November 2024. Bollinger Bands Signal Historic Compression CryptoBullet has identified the tightest Bollinger Bands in SUI’s entire trading history on the weekly chart. The BBW indicator compression reached levels that were historically followed by major price movements. This setup mirrors conditions before SUI’s previous major rallies. Historical data shows SUI price delivered +253% gains between December 2023 and March 2024 following similar compression. SUI…
Share
BitcoinEthereumNews2025/09/18 11:32