-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[ClangImporter][ModuleWrap] Turn off libc warnings. #76545
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
Conversation
`swift-modulewrap` uses the `ClangImporter` to obtain a module loader, but it doesn't take an SDK argument (nor does anything bother to pass one), which means that when cross-compiling you get warnings about not being able to find the C library. Suppress the warning by telling the `ClangImporter` that we don't care about the C library here. rdar://115918181
@swift-ci Please test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does modulewrap need to access Swift symbols that are imported from C/C++? e.g. if the Swift module exposes a C struct in its public interface.
If not, this LGTM.
Hmmm. Maybe I should make it try to set up the file mapping and just not fail the same way, rather than turning it off completely. (I'm not sure whether it might need C/C++ symbols; it plainly doesn't for the things I've tried with the Static SDK, and I think this problem happens for other cross-compilation situations too, but I'm not confident enough that I'm entirely comfortable.) |
We should still try adding the overlays, even if we're asked not to generate a diagnostic while doing so. That's slightly safer because it means that we're less likely to find ourselves in a situation where `swift-modulewrap` wants to use types from the C/C++ library and can't. rdar://115918181
@swift-ci Please test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks reasonable to me, thanks!
@swift-ci Please smoke test macOS platform |
macOS test failure isn't related to this PR, as far as I can tell. |
swift-modulewrap
uses theClangImporter
to obtain a module loader, but it doesn't take an SDK argument (nor does anything bother to pass one), which means that when cross-compiling you get warnings about not being able to find the C library.Suppress the warning by telling the
ClangImporter
that we don't care about the C library here.rdar://115918181