-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[Stdlib] Change SWIFT_RUNTIME_STDLIB_INTERNAL to not export the symbol. #19614
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-ci please test |
} | ||
|
||
public func fcntl( | ||
_ fd: Int32, | ||
_ cmd: Int32, | ||
_ ptr: UnsafeMutableRawPointer | ||
) -> Int32 { | ||
return _stdlib_fcntlPtr(fd, cmd, ptr) | ||
return _swift_swift_stdlib_fcntlPtr(fd, cmd, ptr) |
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 and a few other functions use the prefix _swift_swift_stdlib_
. They should be _swift_stdlib_
.
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.
What the heck? The perils of trying to get something for people to look at before closing time on Friday, I guess.
Where do the libc functions get used externally? The entire set of libc shims exists only because libswiftCore can't import the libc's module directly because it would create a circular dependency. Other modules should use libc. |
It could be that we end up emitting them because |
Or, if always_inline is inappropriate, could we give them the standard C symbol name with an |
We can't make them
|
Build failed |
@jckarter - please do remember to use |
Many of the shims are dumb wrappers to avoid the circular dependency, but many wrap different underlying OS APIs in one unified function for other stuff to use. For example, We have a few cross-dylib references within the Swift libraries themselves.
And
A few of these functions are being exposed through
|
89ac256
to
bef6d96
Compare
The ones with nontrivial or nonportable logic in them probably shouldn't be in "shims"; that seems misleading. We probably need those entry points in the |
I think the Darwin ones are holdovers, yes. They can probably be simple wrappers like the other overlay shims. |
|
Coming along. I put |
@compnerd Can you check over the Windows side of my changes? I tried my best to keep it working but it's very likely I didn't get everything right. |
@@ -19,6 +20,11 @@ module SwiftShims { | |||
export * | |||
} | |||
|
|||
module SwiftShimsInline { |
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 this should be "_SwiftPlatformOverlayShims", to follow the convention below?
Shouldn’t some of these be marked |
|
Updated with the latest. Didn't get to A few tests had to be fixed up to build the The output for |
The functions in LibcShims are used externally, some directly and some through @inlineable functions. These are changed to SWIFT_RUNTIME_STDLIB_SPI to better match their actual usage. Their names are also changed to add "_swift" to the front to match our naming conventions. Three functions from SwiftObject.mm are changed to SPI and get a _swift prefix. A few other support functions are also changed to SPI. They already had a prefix and look like they were meant to be SPI anyway. It was just hard to notice any mixup when they were #defined to the same thing. rdar://problem/35863717
… and make them static inline. This avoids exposing them as exported symbols in libswiftCore.
…ine. Move LibcShimsInline.h to LibcOverlayShims.h for more consistent naming. Fix up several tests that needed the mock Darwin overlay built. Fix one SourceKit test that no longer produces is_system: 1 on an `import Darwin` line.
5ccff97
to
c4d5db4
Compare
Changed |
@swift-ci please test |
Build failed |
Build failed |
c467bb8
to
5391abb
Compare
…ings. Fix Linux implementation in Random.cpp to actually compile.
@swift-ci please test |
Build failed |
Build failed |
@swift-ci please test |
Build failed |
Build failed |
3f728fe
to
a78a01a
Compare
@swift-ci please test |
Build failed |
Build failed |
…iveC non-inlinable as it calls an internal function.
@swift-ci please test |
Build failed |
Build failed |
The changes in swiftlang#19614 require Darwin/Glibc to build first. This usually happened anyway (and thus the problem wasn't noticed for a while) but sometimes SwiftPrivate would win the race and the build would fail. rdar://problem/45624328
The functions in LibcShims are used externally, some directly and some through @inlineable functions. These are changed to SWIFT_RUNTIME_STDLIB_SPI to better match their actual usage. Their names are also changed to add "_swift" to the front to match our naming conventions.
Three functions from SwiftObject.mm are changed to SPI and get a _swift prefix.
A few other support functions are also changed to SPI. They already had a prefix and look like they were meant to be SPI anyway. It was just hard to notice any mixup when they were #defined to the same thing.
rdar://problem/35863717