Skip to content

Undefined symbols when bootstrapping with ld.gold in DragonFly BSD #139425

Open
@tuxillo

Description

@tuxillo

Summary

TL;DR: When building rust 1.82 onwards and trying to link the rustc_driver with ld.gold, it will fail with the following error:

 = note: /usr/libexec/binutils234/elf/ld.gold: error: version script assignment of  to symbol __rust_alloc failed: symbol not defined
/usr/libexec/binutils234/elf/ld.gold: error: version script assignment of  to symbol __rust_alloc_error_handler failed: symbol not defined
/usr/libexec/binutils234/elf/ld.gold: error: version script assignment of  to symbol __rust_alloc_error_handler_should_panic failed: symbol not defined
/usr/libexec/binutils234/elf/ld.gold: error: version script assignment of  to symbol __rust_alloc_zeroed failed: symbol not defined
/usr/libexec/binutils234/elf/ld.gold: error: version script assignment of  to symbol __rust_dealloc failed: symbol not defined
/usr/libexec/binutils234/elf/ld.gold: error: version script assignment of  to symbol __rust_no_alloc_shim_is_unstable failed: symbol not defined
/usr/libexec/binutils234/elf/ld.gold: error: version script assignment of  to symbol __rust_realloc failed: symbol not defined
collect2: error: ld returned 1 exit status
error: could not compile `rustc_driver` (lib) due to 1 previous error

Full story on Zulip: https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/__rust_alloc_error_handler_should_panic.20not.20defined/with/510418013

Command used

Rust +1.82 bootstrapped with a custom script.

Expected behaviour

The build to succeed.

Actual behaviour

Fails to build, see summary.

Bootstrap configuration (bootstrap.toml)

<config>

Operating system

DragonFly BSD 6.4 and above (including bleeding edge).

HEAD

Any Rust version from 1.82 and above.

Additional context

Build Log

<log>

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-linkersArea: linkers... you gotta love linkersC-external-bugCategory: issue that is caused by bugs in software beyond our controlT-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions