rust-lang / rust-lang/rust

LLD doesn't handle `--warn-unresolved-symbols` the same as GNU LD

Open
#147,707 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-linkers A-lld C-discussion P-medium regression-from-stable-to-stable T-compiler
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

While upgrading tursodb to rust 1.90 I got this linker error on CI:

Running unittests src/lib.rs (target/debug/deps/turso_sync_js-5f98d3f835f912a1)
/home/runner/_work/turso/turso/target/debug/deps/turso_sync_js-5f98d3f835f912a1: symbol lookup error: /home/runner/_work/turso/turso/target/debug/deps/turso_sync_js-5f98d3f835f912a1: undefined symbol: napi_typeof
error: test failed, to rerun pass `-p turso_sync_js --lib`

As David pointed out, the --warn-unresolved-symbols flag is enabled and the error only happens during runtime.

Using the old linker fix the issue. I do not know how to properly debug this so any help would be appreciated :)

Version it worked on

It most recently worked on: 1.88

Version with regression

rustc --version --verbose:

rustc 1.90.0 (1159e78c4 2025-09-14)
binary: rustc
commit-hash: 1159e78c4747b02ef996e55082b704c09b970588
commit-date: 2025-09-14
host: x86_64-unknown-linux-gnu
release: 1.90.0
LLVM version: 20.1.8

@rustbot modify labels: +regression-from-stable-to-stable -regression-untriaged

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the tursodb CI failure with Rust 1.88 and 1.90, focusing on the --warn-unresolved-symbols linker flag and the napi_typeof runtime error. Compare the behavior with the old linker and GNU LD; done means unresolved symbols are handled consistently and the regression is covered by a reproducible test.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.