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

Added linker_arg(s) Linker trait methods for link-arg to be prefixed "-Wl," for cc-like linker args and not verbatim #118202

Merged
merged 1 commit into from Nov 28, 2023

Conversation

azhogin
Copy link
Contributor

@azhogin azhogin commented Nov 23, 2023

#99427 (comment)

here's one possible improvement to -l link-arg making it more portable between linkers and useful - befriending it with the verbatim modifier (#99425).

-l link-arg:-verbatim=-foo would add -Wl,-foo (or equivalent) when C compiler is used as a linker, and just -foo when bare linker is used.
-l link-arg:+verbatim=-bar on the other hand would always pass just -bar.

@rustbot
Copy link
Collaborator

rustbot commented Nov 23, 2023

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @davidtwco (or someone else) soon.

Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (S-waiting-on-review and S-waiting-on-author) stays updated, invoking these commands when appropriate:

  • @rustbot author: the review is finished, PR author should check the comments and take action accordingly
  • @rustbot review: the author is ready for a review, this PR will be queued again in the reviewer's queue

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Nov 23, 2023
@petrochenkov
Copy link
Contributor

r? @petrochenkov

@rustbot rustbot assigned petrochenkov and unassigned davidtwco Nov 23, 2023
@petrochenkov petrochenkov added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 23, 2023
@azhogin azhogin changed the title link-arg will be prefixed "-Wl," if flavor.uses_cc and not verbatim Added linker_arg(s) Linker trait methods for link-arg to be prefixed "-Wl," for cc-like linker args and not verbatim Nov 24, 2023
@azhogin
Copy link
Contributor Author

azhogin commented Nov 24, 2023

@rustbot label -S-waiting-on-author +S-waiting-on-review

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Nov 24, 2023
@petrochenkov
Copy link
Contributor

@rustbot label -S-waiting-on-author +S-waiting-on-review

@rustbot review is a more convenient alias for this.

compiler/rustc_codegen_ssa/src/back/linker.rs Outdated Show resolved Hide resolved
compiler/rustc_codegen_ssa/src/back/link.rs Outdated Show resolved Hide resolved
compiler/rustc_codegen_ssa/src/back/linker.rs Outdated Show resolved Hide resolved
@petrochenkov petrochenkov added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 24, 2023
@rust-log-analyzer

This comment has been minimized.

@azhogin azhogin force-pushed the azhogin/link_args_wrapping branch 2 times, most recently from f08e020 to 4bb6a1d Compare November 26, 2023 13:51
@azhogin
Copy link
Contributor Author

azhogin commented Nov 26, 2023

@rustbot review

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Nov 26, 2023
…"-Wl," for cc-like linker args and not verbatim
@petrochenkov
Copy link
Contributor

Thanks!
@bors r+

@bors
Copy link
Contributor

bors commented Nov 27, 2023

📌 Commit 7a88458 has been approved by petrochenkov

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 27, 2023
bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 28, 2023
…mpiler-errors

Rollup of 9 pull requests

Successful merges:

 - rust-lang#111133 (Detect Python-like slicing and suggest how to fix)
 - rust-lang#114708 (Allow setting `rla` labels via `rustbot`)
 - rust-lang#117526 (Account for `!` arm in tail `match` expr)
 - rust-lang#118172 (Add `pretty_terminator` to pretty stable-mir)
 - rust-lang#118202 (Added linker_arg(s) Linker trait methods for link-arg to be prefixed "-Wl," for cc-like linker args and not verbatim)
 - rust-lang#118374 (QueryContext: rename try_collect_active_jobs -> collect_active_jobs, change return type from Option<QueryMap> to QueryMap)
 - rust-lang#118381 (rustc_span: Use correct edit distance start length for suggestions)
 - rust-lang#118382 (Address unused tuple struct fields in the compiler)
 - rust-lang#118384 (Address unused tuple struct fields in rustdoc)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 4936b3a into rust-lang:master Nov 28, 2023
11 checks passed
@rustbot rustbot added this to the 1.76.0 milestone Nov 28, 2023
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Nov 28, 2023
Rollup merge of rust-lang#118202 - azhogin:azhogin/link_args_wrapping, r=petrochenkov

Added linker_arg(s) Linker trait methods for link-arg to be prefixed "-Wl," for cc-like linker args and not verbatim

rust-lang#99427 (comment)

> here's one possible improvement to -l link-arg making it more portable between linkers and useful - befriending it with the verbatim modifier (rust-lang#99425).
>
> -l link-arg:-verbatim=-foo would add -Wl,-foo (or equivalent) when C compiler is used as a linker, and just -foo when bare linker is used.
> -l link-arg:+verbatim=-bar on the other hand would always pass just -bar.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants