-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Use cfg_attr to gate musl linking #700
Conversation
Fixes rust-lang#684. Previously building libc for musl would fail, because we don't want to use #[link(...)] outside a stdbuild. This commit fixes that issue. (Although it may leave other targets broken, I'm not sure.)
Looks like CI is failing? Can you also include tests from #685? |
@alexcrichton I'm already seeing more failures on travis, even with the style fix. I think this is mostly because we never want to issue a
To:
|
Alternatively I can just introduce a fix for the rumprun target (which looks to be the only broken one), and leave the rest as-is. |
Ah yeah it'd be great to add this same fix there as well! |
@alexcrichton Okay, I've made the CI build work for all platforms. I did, however, use the first method I outlined and prevent any linking from happening if If you agree with the above assessment, then I think this is ready to be merged. |
Hm yeah so the only gotcha there is that if you pull in the |
@alexcrichton Yeah, you're right. Fixing it this way won't work. But I don't think the earlier I'm not sure how to proceed here. Do you know of any other options we have? |
It's true yeah, we could avoid the |
@alexcrichton How can we avoid the |
Yeah we wouldn't get precisely the same behavior, we'd have to select one kind of linakge for musl, for example. |
@alexcrichton Do you have any thoughts on what we should do then? #684 is a serious problem for using Rust on a MUSL platform. If there is no quick fix for now, perhaps we should introduce some sort of work around? |
I think our only option is to have |
Is there any progress on this? I'd be willing to help out with a fix but I'm not sure where to go from here. |
@clarcharr I'm still paying attention to this, although I've been busy at work this past week. I'm dissatisfied with the current solution / every solution outlined thus far. I feel like the |
Ideally this would look like: #[cfg_attr(all(not(stdbuild), target_feature = "crt-static"), link(name = "c", kind = "static")]
#[cfg_attr(all(not(stdbuild), not(target_feature = "crt-static")), link(name = "c")] But right now |
☔ The latest upstream changes (presumably #734) made this pull request unmergeable. Please resolve the merge conflicts. |
I'm going to close this due to inactivity, but feel free to resubmit with a rebase! |
Fixes #684. Previously building libc for musl would fail, because we don't want to use #[link(...)] outside a stdbuild. This commit fixes that issue. (Although it may leave other targets broken, I'm not sure.)