-
Notifications
You must be signed in to change notification settings - Fork 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
Link to Windows debug CRTs when crt-debug target_feature is present. #1433
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @gnzlbg (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
This makes it possible to link a Rust binding crate against a C library that was compiled with /MTd or /MDd. |
What happens if the standard library is built to link to one, but this crate from crates.io is set to link to the other ? What happens if a Also, this needs tests that show that this works. |
@gnzlbg What happens in those cases when crt-static is used? |
It's true; this change may not be enough because of the issue of building the standard library. I tried building https://github.com/servo/mozjs with a Cargo.toml patch for libc that replaced msvcrt with msvcrtd, and I still got the same error that I'm used to seeing:
|
@jdm note that libc is built as part of |
I mentioned it in the original PR description: rust-lang/rust#39016 |
@ollie27 so if one builds a |
Correct. I don't know if it's a bug or not but it looks like the same is true of musl: Lines 299 to 305 in 6307a0b
I guess this is just how |
It looks like this was realized in the last few comments, but replying to this cc this PR won't have the desired effect until something like rust-lang/rust#62534 is also added. |
☔ The latest upstream changes (presumably #1510) made this pull request unmergeable. Please resolve the merge conflicts. |
Has there been progress towards linking to MSVCRTD (debug version), as described in rust-lang/rust#39016? If not, are there meanwhile any known workarounds? |
No. |
Update from the compiler side - libc shouldn't need any additional compiler support for this (rust-lang/rust#39016 (comment)), this PR should work as is. |
I don't have access to a Windows development environment any more, so I won't be pushing forward on this work. |
Relies on rust-lang/rust#62534 in order to fix rust-lang/rust#39016.