Invalid local symbol errors linking shared library with rust-lld
Open
Nobody has claimed this yet.
A-linkage
A-lld
C-external-bug
T-compiler
- Dominant language
- Rust
- Stars
- 119k
- Forks
- 16.1k
- PR merge metrics
- PR metrics pending
Description
I have a project generating bindings for FMOD using bindgen: https://gitlab.com/spearman/fmod-rs/-/tree/master/fmod-sys
Trying to build and link an executable with rust-lld generates the following errors:
= note: rust-lld: error: /home/spearman/rs/local/fmod-rs/fmod-sys/lib/x86_64/libfmod.so: invalid local symbol '__bss_start' in global part of symbol table
rust-lld: error: /home/spearman/rs/local/fmod-rs/fmod-sys/lib/x86_64/libfmod.so: invalid local symbol '_end' in global part of symbol table
rust-lld: error: /home/spearman/rs/local/fmod-rs/fmod-sys/lib/x86_64/libfmod.so: invalid local symbol '_edata' in global part of symbol table
collect2: error: ld returned 1 exit status
For now I am using the rustflags option -Zlinker-features=-lld to avoid using rust-lld
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the executable link with rust-lld and fmod-sys/lib/x86_64/libfmod.so, using the reported invalid local symbol diagnostics as the baseline. Investigate rust-lld's handling of the shared library's symbol table; done means the library links successfully with rust-lld enabled without these errors.
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