-
Notifications
You must be signed in to change notification settings - Fork 451
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
crt-static is only translated to -static
under gcc, not clang
#1074
Comments
Hmmm, could we remove that I wonder why is that added in the first place. |
I think removing it makes the most sense. I mean, that's one way of interpreting it but clearly rust doesn't interpret it that way, so we probably shouldn't either. Not sure about breakage, though. |
I think it should be fine. Don't think there are many crates using cc to generate executables |
Looking at it, I found that we also have a function Honestly I have no idea why it's there in the first place, cc @thomcc Do you know why it is there (and if we could just remove Lines 2173 to 2175 in 3ba2356
|
I don't think we can just remove static_flag() itself without breaking a decent amount of code. It's used a decent amount though as far as I can see it seems most usage is under the very incorrect assumption that it determines whether the output is a .a or .so/.dylib. Specifically for projects calling But a reminder that there are crates that use cc-rs to get build flags before then manually compiling binaries. My own rsconf is only one example; I'm sure there are others. |
I agree, it should be marked as deprecated, while keep the existing implementation. I will then open a PR to remove Lines 2173 to 2175 in 3ba2356
|
We should probably specify the clang-equivalent of E.g.
|
In
add_default_flags()
, the presence of featurecrt-static
causes-static
to be supplied to the compiler iff it's gcc; clang doesn't get the same treatment.I know that
cc
itself doesn't compile without-c
so the presence of-static
makes no difference there, but if a downstream library or crate usescc
to manually get a compiler invocation and runs that without-c
to generate an executable itself inbuild.rs
(and some do), it matters.I can easily open a PR to do the same under clang, but given the subtleties of how much linker-related stuff this crate should be doing to begin with I preferred to first open an issue.
The text was updated successfully, but these errors were encountered: