Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upAdd cargo:rustc-link-arg to pass custom linker arguments #6298
Conversation
This comment has been minimized.
This comment has been minimized.
|
Thanks for the PR! I'm personally a bit wary to add this though without more protections and/or safeguards. In addition to the soft feature freeze this is a feature we have intentionally not added historically as it can be tricky to do so. I would personally prefer at least that this takes the route of a more formal feature proposal such as a discussion on internals or a mini-rfc. |
This comment has been minimized.
This comment has been minimized.
|
If you have time to guide me on that I'm more than willing to :) Keep in mind that we have an env key that already let you pass those values, but it does to all the rustc invocations and my actual need is to pass the right linker flags so the soname is set for cdylibs. We can restrict it to just cdylibs or just make cargo come up with the os-specific incantations at least for the tier1 platforms. |
This comment has been minimized.
This comment has been minimized.
|
For posterity, there's more info on this in https://internals.rust-lang.org/t/pre-rfc-complete-cdylib-support-in-cargo/8843/12 |
This comment has been minimized.
This comment has been minimized.
|
|
lu-zero
force-pushed the
lu-zero:rustc-link-args
branch
from
fd3e037
to
104b861
Nov 18, 2018
This comment has been minimized.
This comment has been minimized.
|
Here an attempt on restricting, not sure where is the best place to error out if somebody mixes cdylib and dylib. |
This comment has been minimized.
This comment has been minimized.
|
Thanks, although I think there's still a number of open questions here:
|
This comment has been minimized.
This comment has been minimized.
The use-case I'm focusing is to pair it with a
from what I'm seeing for the
For my usecase there isn't. On the other hand this can be reused by cargo-deb/rpm/ebuild later for their distro-specific purposes (e.g. custom rpaths), but I'd rather not conflate it. |
This comment has been minimized.
This comment has been minimized.
|
|
lu-zero
referenced this pull request
Dec 10, 2018
Open
Make sure cargo sets the soname in the cdylib #5
nrc
assigned
alexcrichton
Mar 6, 2019
This comment has been minimized.
This comment has been minimized.
|
Sorry for having this fall by the wayside, this fell off my radar by accident! @lu-zero would you still be willing to help drive this PR forward? Following up with some of my questions above, for cases where the link-args aren't used I don't really know what the best answer is. I think it's fine for now though to swallow them and document that we swallow them, and if it becomes an issue we can issue warnings or something like that later. For the many crate types, we probably want to either:
For So all in all, the remaining items needed for this I think are:
I think I'd personally lean towards renaming this |
This comment has been minimized.
This comment has been minimized.
Sure. I'll update the PR during the weekend :) |
This comment has been minimized.
This comment has been minimized.
|
Ok sounds great, and sorry again for the delay! |
lu-zero
added some commits
Nov 9, 2018
lu-zero
force-pushed the
lu-zero:rustc-link-args
branch
from
104b861
to
9741016
Mar 8, 2019
This comment has been minimized.
This comment has been minimized.
|
I renamed the key, regarding the documentation to update, where I should I find it? |
alexcrichton
added
the
T-cargo
label
Mar 11, 2019
alexcrichton
reviewed
Mar 11, 2019
src/cargo/core/compiler/mod.rs Outdated
This comment has been minimized.
This comment has been minimized.
|
@rfcbot fcp merge Ok! This looks great to me, so I'd like to propose that this be merged, but would also like to get a signoff from the rest of the team. |
This comment has been minimized.
This comment has been minimized.
|
Team member @alexcrichton has proposed to merge this. The next step is review by the rest of the tagged team members: No concerns currently listed. Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up! See this document for info about what commands tagged team members can give me. |
rfcbot
added
proposed-final-comment-period
disposition-merge
labels
Mar 11, 2019
This comment has been minimized.
This comment has been minimized.
|
I personally would like this (and would use this) for binaries, not just cdylib, but cdylib certainly helps. |
This comment has been minimized.
This comment has been minimized.
|
I'd relax the constraint later and land it sooner if possible :) |
rfcbot
added
the
final-comment-period
label
Mar 27, 2019
rfcbot
removed
the
proposed-final-comment-period
label
Mar 27, 2019
This comment has been minimized.
This comment has been minimized.
|
|
This comment has been minimized.
This comment has been minimized.
|
@bors: r+ |
This comment has been minimized.
This comment has been minimized.
|
|
bors
added
the
S-waiting-on-bors
label
Mar 27, 2019
alexcrichton
added
the
relnotes
label
Mar 27, 2019
This comment has been minimized.
This comment has been minimized.
bors
added a commit
that referenced
this pull request
Mar 27, 2019
This comment has been minimized.
This comment has been minimized.
|
|
lu-zero commentedNov 9, 2018
It is useful to produce correct
cdylibson platforms such as Linux andMacOS.
Groundwork to address #5045 in the future.