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)
$0.971
$0.971$0.971
0.00%
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

Crucial Fed Rate Cut: Powell’s Bold Risk Management Move Explained

Crucial Fed Rate Cut: Powell’s Bold Risk Management Move Explained

BitcoinWorld Crucial Fed Rate Cut: Powell’s Bold Risk Management Move Explained In a significant development for global financial markets, Federal Reserve Chair Jerome Powell recently described the latest Fed rate cut as a critical risk management measure. This statement immediately captured the attention of investors, economists, and especially those in the dynamic cryptocurrency space. Understanding Powell’s rationale and the potential implications of this move is essential for navigating today’s complex economic landscape. What Exactly is a Fed Rate Cut and Why Does it Matter? A Fed rate cut refers to the Federal Reserve lowering the target range for the federal funds rate. This is the interest rate at which commercial banks borrow and lend their excess reserves to each other overnight. When the Fed lowers this rate, it typically makes borrowing cheaper across the entire economy. This decision impacts everything from mortgage rates to business loans. The Fed uses interest rates as a primary tool to influence economic activity, aiming to achieve maximum employment and stable prices. A lower rate often stimulates spending and investment, but it can also signal concerns about economic slowdown. Key reasons for a rate cut often include: Slowing economic growth or recession fears. Low inflation or deflationary pressures. Global economic instability impacting domestic markets. A desire to provide more liquidity to the financial system. Powell’s emphasis on ‘risk management’ suggests a proactive approach. The Fed is not just reacting to current data but also anticipating potential future challenges. They are essentially trying to prevent a worse economic outcome by adjusting policy now. How Does a Fed Rate Cut Influence the Broader Economy? When the Federal Reserve implements a Fed rate cut, it sends ripples throughout the financial world. For traditional markets, lower interest rates generally mean: Boost for Stocks: Companies can borrow more cheaply, potentially increasing profits and stock valuations. Investors might also move money from lower-yielding bonds into equities. Cheaper Borrowing: Consumers and businesses enjoy lower rates on loans, from mortgages to credit cards, encouraging spending and investment. Weaker Dollar: Lower rates can make a country’s currency less attractive to foreign investors, potentially leading to a weaker dollar. Bond Market Shifts: Existing bonds with higher yields become more attractive, while newly issued bonds will have lower yields. This shift in monetary policy aims to inject confidence and liquidity into the system, countering potential economic headwinds. However, there’s always a delicate balance to strike, as too much stimulus can lead to inflationary pressures down the line. What Does This Fed Rate Cut Mean for Cryptocurrency Investors? The impact of a Fed rate cut on the cryptocurrency market is often a topic of intense discussion. While crypto assets operate independently of central banks, they are not immune to broader macroeconomic forces. Here’s how a rate cut can play out: Increased Risk Appetite: With traditional savings and bond yields potentially lower, investors might seek higher returns in riskier assets, including cryptocurrencies like Bitcoin and Ethereum. Inflation Hedge Narrative: Some view cryptocurrencies, particularly Bitcoin, as a hedge against inflation and traditional currency debasement. If a rate cut leads to concerns about inflation, this narrative could gain traction. Liquidity Influx: A more accommodative monetary policy can increase overall liquidity in the financial system, some of which may flow into digital assets. Dollar Weakness: A weaker dollar, a potential consequence of rate cuts, can sometimes make dollar-denominated assets like crypto more appealing to international investors. However, it’s crucial to remember that the crypto market also has its unique drivers, including technological developments, regulatory news, and market sentiment. While a Fed rate cut can provide a tailwind, it’s not the sole determinant of crypto performance. Navigating the New Landscape: Actionable Insights for Crypto Investors Given the Federal Reserve’s stance on risk management through a Fed rate cut, what steps can crypto investors consider? Stay Informed: Keep a close watch on further Fed announcements and economic data. Understanding the broader macroeconomic picture is vital. Diversify Your Portfolio: While a rate cut might favor risk assets, a balanced portfolio that includes a mix of traditional and digital assets can help mitigate volatility. Long-Term Perspective: Focus on the fundamental value and long-term potential of your chosen cryptocurrencies rather than short-term fluctuations driven by macro news. Assess Risk Tolerance: Re-evaluate your personal risk tolerance in light of potential market shifts. Lower rates can encourage speculation, but prudence remains key. Powell’s description of the Fed rate cut as a risk management measure highlights the central bank’s commitment to maintaining economic stability. For cryptocurrency enthusiasts, this move underscores the increasing interconnectedness of traditional finance and the digital asset world. While a rate cut can create opportunities, a thoughtful and informed approach is always the best strategy. Frequently Asked Questions (FAQs) What exactly is a Fed rate cut? A Fed rate cut is when the Federal Reserve lowers its target for the federal funds rate, which is the benchmark interest rate banks charge each other for overnight lending. This action makes borrowing cheaper across the economy, aiming to stimulate economic activity. Why did Powell emphasize “risk management” for this Fed rate cut? Jerome Powell emphasized “risk management” to indicate that the Fed was proactively addressing potential economic slowdowns or other future challenges. It suggests a preventative measure to safeguard against adverse economic conditions rather than merely reacting to existing problems. How does a Fed rate cut typically affect the crypto market? A Fed rate cut can make traditional investments less attractive due to lower yields, potentially driving investors towards higher-risk, higher-reward assets like cryptocurrencies. It can also increase overall market liquidity and strengthen the narrative of crypto as an inflation hedge. Should crypto investors change their strategy after a rate cut? While a rate cut can influence market dynamics, crypto investors should primarily focus on their long-term strategy, fundamental research, and risk tolerance. It’s wise to stay informed about macroeconomic trends but avoid making impulsive decisions based solely on a single policy change. What are the potential downsides of a Fed rate cut? Potential downsides include increased inflationary pressures if the economy overheats, a weaker national currency, and the possibility of creating asset bubbles as investors chase higher returns in riskier markets. It can also signal underlying concerns about economic health. Did you find this article insightful? Share your thoughts and help others understand the implications of the Fed’s latest move! Follow us on social media for more real-time updates and expert analysis. To learn more about the latest crypto market trends, explore our article on key developments shaping Bitcoin’s price action. This post Crucial Fed Rate Cut: Powell’s Bold Risk Management Move Explained first appeared on BitcoinWorld.
Share
Coinstats2025/09/18 16:40
Motive Files Registration Statement for Proposed Initial Public Offering

Motive Files Registration Statement for Proposed Initial Public Offering

SAN FRANCISCO–(BUSINESS WIRE)–Motive Technologies, Inc., the AI platform for physical operations, today announced that it has filed a registration statement on
Share
AI Journal2025/12/24 07:00
New Gold Protocol's NGP token was exploited and attacked, resulting in a loss of approximately $2 million.

New Gold Protocol's NGP token was exploited and attacked, resulting in a loss of approximately $2 million.

PANews reported on September 18th that according to Paidun monitoring, New Gold Protocol's NGP token was exploited in an attack, resulting in a loss of approximately $2 million. The NGP token plummeted 88% in an hour, and the attacker deposited the stolen funds (443.8 ETH) into TornadoCash.
Share
PANews2025/09/18 11:10