Investigate linker warnings
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 119k
- Forks
- 16.1k
- PR merge metrics
- PR metrics pending
Description
https://github.com/rust-lang/rust/pull/119286 unsilences linker warnings by default, and then promptly silences them again for rust-lang/rust itself. We should investigate and fix them.
So far I have seen the following kinds of warnings:
-
ignoring duplicate libraries: -lmon MacOS when running any tests/ui-fulldeps test, and also when building rustc itself for stage 2. -
ld: cannot export hidden symbol compiler_builtins::int::leading_zeros::__clzdi2::ha6dd05e8d8124fabwhen building compiler-builtins -
ld: cannot export hidden symbol ___llvm_profile_filenamewhen building tests/ui/issues/issue-85461.rs -
ld: build/x86_64-unknown-linux-gnu/stage1-tools/cg_gcc/mini_core.mini_core.2ab949a2a8595fff-cgu.0.rcgu.o: relocation in read-only section `.rodata.global.c'andld: creating DT_TEXTREL in a shared objectwhen building rustc_codegen_gcc
and they are silenced in these places:
- https://github.com/rust-lang/rust/blob/4b4007a500e27f708038e81549d7ad6437ce1b71/src/bootstrap/src/core/build_steps/test.rs#L1869-L1872
- https://github.com/rust-lang/rust/blob/4b4007a500e27f708038e81549d7ad6437ce1b71/src/bootstrap/src/core/build_steps/test.rs#L3587-L3588
- https://github.com/rust-lang/rust/blob/4b4007a500e27f708038e81549d7ad6437ce1b71/src/bootstrap/src/core/builder/cargo.rs#L276
@rustbot label S-tracking-issue
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 listed linker warnings in the affected tests and builds, then inspect the warning suppressions in src/bootstrap/src/core/build_steps/test.rs and src/bootstrap/src/core/builder/cargo.rs at the referenced lines. Compare the linked pull request and comments to identify each warning's cause; done means the warnings are addressed rather than silenced.
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
- Mostly clear
- Newbie friendliness
- 35/100