rust-lang / rust-lang/rust

Missing symbols with `optimize = "false"` and `panic = "abort"`

Open
#144,121 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-linkage C-bug E-needs-investigation T-compiler
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

Summary

Having optimize = "false" in bootstrap.toml causes

 = note: Undefined symbols for architecture arm64:
            "core::ptr::drop_in_place$LT$alloc..boxed..Box$LT$dyn$u20$core..any..Any$u2b$core..marker..Send$GT$$GT$::hcc3526ae516987a1", referenced from:
                std::panicking::try::cleanup::h73ac583610235009 in libstd-2e13ee922e5a6504.rlib[7](std-2e13ee922e5a6504.std.de67259d40fecdda-cgu.04.rcgu.o)
                std::rt::lang_start_internal::_$u7b$$u7b$closure$u7d$$u7d$::_$u7b$$u7b$closure$u7d$$u7d$::_$u7b$$u7b$closure$u7d$$u7d$::hedd318147b7d845a in libstd-2e13ee922e5a6504.rlib[18](std-2e13ee922e5a6504.std.de67259d40fecdda-cgu.15.rcgu.o)
            "alloc::boxed::Box$LT$T$C$A$GT$::from_raw_in::he9e618f702525f8b", referenced from:
                std::panicking::try::cleanup::h73ac583610235009 in libstd-2e13ee922e5a6504.rlib[7](std-2e13ee922e5a6504.std.de67259d40fecdda-cgu.04.rcgu.o)
            "alloc::boxed::Box$LT$T$C$A$GT$::into_raw::h79583d854b3b1b93", referenced from:
                _$LT$std..panicking..begin_panic_handler..FormatStringPayload$u20$as$u20$core..panic..PanicPayload$GT$::take_box::h14da0fd70b068231 in libstd-2e13ee922e5a6504.rlib[7](std-2e13ee922e5a6504.std.de67259d40fecdda-cgu.04.rcgu.o)
                _$LT$std..panicking..begin_panic_handler..StaticStrPayload$u20$as$u20$core..panic..PanicPayload$GT$::take_box::hfd105107c2b4e561 in libstd-2e13ee922e5a6504.rlib[7](std-2e13ee922e5a6504.std.de67259d40fecdda-cgu.04.rcgu.o)
          ld: symbol(s) not found for architecture arm64
          clang: error: linker command failed with exit code 1 (use -v to see invocation)

when compiling a crate with

[profile.release]
panic = 'abort'

[profile.dev]
panic = 'abort'
Command used
cargo build
Expected behaviour

No errors from the linker.

Actual behaviour

Some symbols are undefined.

Bootstrap configuration (bootstrap.toml)
[rust]
codegen-backends = ["llvm"]
debug = true
debuginfo-level = 2
optimize = false
Operating system

macOS 15.5, aarch64

HEAD

6b00bc38 (1.88.0)

Additional context

I came across this problem while using an explicitly unsupported configuration in bootstrap.toml: optimize = "false".
As such, this is not a problem, in the sense that I got what I asked for: non-obvious errors using an unsupported configuration.
As mentioned in this discussion on Zulip, however, it could be useful to see if this error indicates a deeper issue that might be worth investigating.

Build Log

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 reported cargo build failure on macOS 15.5 aarch64 using the shown bootstrap.toml with optimize = false, codegen-backends = ["llvm"], and panic = "abort". Compare the result with a supported optimization setting and determine whether the undefined symbols indicate a deeper compiler or bootstrap issue; done means a confirmed diagnosis and a clearly scoped follow-up.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
build-system, compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.