Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Investigate linker warnings #135828

Open
4 tasks
jyn514 opened this issue Jan 21, 2025 · 4 comments
Open
4 tasks

Investigate linker warnings #135828

jyn514 opened this issue Jan 21, 2025 · 4 comments
Labels
A-linkage Area: linking into static, shared libraries and binaries A-linkers Area: linkers... you gotta love linkers C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC L-linker_messages Lint: linker_messages T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@jyn514
Copy link
Member

jyn514 commented Jan 21, 2025

#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:

and they are silenced in these places:

@rustbot label S-tracking-issue

@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Jan 21, 2025
@jieyouxu jieyouxu added A-linkage Area: linking into static, shared libraries and binaries T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC A-linkers Area: linkers... you gotta love linkers T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Jan 21, 2025
@jyn514
Copy link
Member Author

jyn514 commented Jan 26, 2025

@rustbot label L-linker_messages

@rustbot rustbot added the L-linker_messages Lint: linker_messages label Jan 26, 2025
@jyn514
Copy link
Member Author

jyn514 commented Jan 27, 2025

cc #136096

@madsmtm
Copy link
Contributor

madsmtm commented Jan 28, 2025

For the ignoring duplicate libraries warning, I see three ways of resolving it:

  1. Pass the -no_warn_duplicate_libraries flag to the linker. I'm unsure when this was introduced, but it isn't available in Xcode 9.2 on macOS 10.12.
  2. Deduplicate libraries in rustc before passing them onwards to the linker. Might be difficult because of various ordering requirements?
  3. Filter it out from the stderr manually by matching on strings.

@jyn514
Copy link
Member Author

jyn514 commented Jan 28, 2025

i do not think we should do 2, i think that will come back to bite us hard. 1 would be my preference, but i don't want to change the mechanism between old and new deployment targets. so that really just leaves 3 unless we're willing to say 10.12 isn't supported / always warns.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-linkage Area: linking into static, shared libraries and binaries A-linkers Area: linkers... you gotta love linkers C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC L-linker_messages Lint: linker_messages T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

4 participants