-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[Backtracing] Update module maps. #78514
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
Now that Darwin is provided by the system, we no longer need to disable the system module maps in favour of our own, which also resolves a few other problems that doing that was creating. rdar://137201928
@swift-ci Please test |
@swift-ci Please test |
@@ -16,14 +16,22 @@ | |||
|
|||
import Swift | |||
|
|||
@_implementationOnly import OS.Libc | |||
#if os(macOS) || os(iOS) || os(tvOS) || os(watchOS) | |||
internal import Darwin |
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.
Darwin is pretty heavy, is it possible to import one of the modules under it like errno_h
or stdio_h
if they're available?
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.
Maybe. That might involve importing a number of modules, mind, and it'll only really affect the compile time of the backtracing library (since we aren't exporting anything from them). So it's worth experimenting with, for sure, but we can probably defer that for now.
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.
I was thinking more like pulling in dependencies you don't want rather than compile time. i.e. do you really want bsm and nurses and all the other bs that Darwin gives you? Or do you just need a few cstdlib things?
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.
🥳
Ah. The Linux problem is one I already have fixed elsewhere (by using C++ interop). I might need to pull in some changes from a different PR to fix that. |
We have some problems on Linux where Glibc pulls in `<elf.h>` and then we end up with conflicting definitions. Fix by using C++ interop and putting our definitions into a namespace. rdar://137201928
@swift-ci Please test |
Joy. That's not going to work either. Still more changes required. |
Also fixed a couple of other minor issues preventing this PR from building on its own. rdar://137201928
@swift-ci Please test |
The runtime functions must be marked `extern "C"` because the symbols are not mangled when exported. rdar://137201928
@swift-ci Please test |
1 similar comment
@swift-ci Please test |
These types only exist on Linux, so need to be conditionalised here. rdar://137201928
0b3815c
to
d3352ef
Compare
@swift-ci Please test |
Now that Darwin is provided by the system, we no longer need to disable the system module maps in favour of our own, which also resolves a few other problems that doing that was creating.
rdar://137201928