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

Tracking Issue for native link modifier verbatim #99425

Closed
3 tasks
petrochenkov opened this issue Jul 18, 2022 · 4 comments · Fixed by #104360
Closed
3 tasks

Tracking Issue for native link modifier verbatim #99425

petrochenkov opened this issue Jul 18, 2022 · 4 comments · Fixed by #104360
Labels
A-linkage Area: linking into static, shared libraries and binaries C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@petrochenkov
Copy link
Contributor

petrochenkov commented Jul 18, 2022

This is a tracking issue for native link modifier verbatim, which is a part of RFC "Linking modifiers for native libraries" (#81490, rust-lang/rfcs#2951).
The feature gate for the issue is #![feature(native_link_modifiers_verbatim)].

About tracking issues

Tracking issues are used to record the overall progress of implementation.
They are also used as hubs connecting to other relevant issues, e.g., bugs or open design questions.
A tracking issue is however not meant for large scale discussion, questions, or bug reports about a feature.
Instead, open a dedicated issue for the specific matter and add the relevant feature gate label.

Steps

Unresolved Questions

-l:libfoo.a is not entirely verbatim, there's still no way to pass a library by full path (without the -l option), like /path/to/libfoo.a, while still respecting relative order of passed libraries, -C link-arg=/path/to/libfoo.a will put the option at the end of the command line instead.
-l link-arg=/path/to/libfoo.a (#99427) will likely help with this situation.

Implementation history

@petrochenkov petrochenkov added C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC 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. labels Jul 18, 2022
@petrochenkov
Copy link
Contributor Author

petrochenkov commented Aug 6, 2022

Known issue: fn find_library in the compiler still falls back from "{target_staticlib_prefix}{name}{target_staticlib_suffix}"/"{name}" to "lib{name}.a" even if +verbatim is enabled, it shouldn't do that.

Update: this was fixed in #101806.

@dpaoliello
Copy link
Contributor

Is there anything currently blocking the stabilization of this feature?

@petrochenkov
Copy link
Contributor Author

I think it can be stabilized now, if the limitations and the caveat about full paths are well documented.
I can prepare the stabilization PR.

@petrochenkov
Copy link
Contributor Author

Stabilization PR - #104360.

@bors bors closed this as completed in f33d409 Nov 28, 2022
compiler-errors added a commit to compiler-errors/rust that referenced this issue Nov 28, 2023
…, 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.
rust-timer added a commit to rust-lang-ci/rust that referenced this issue 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
A-linkage Area: linking into static, shared libraries and binaries C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants