swiftlang / swift

The Swift Programming Language
https://swift.org
Apache License 2.0
67.63k stars 10.37k forks source link

[cxx-interop] Mark all CxxStdlib APIs as `@_alwaysEmitIntoClient` #77776

Closed egorzhdan closed 1 day ago

egorzhdan commented 1 day ago

The change in 269fc941 turned out not to be enough to solve linker errors when using the CxxStdlib overlay with a non-default C++ stdlib.

In addition to @inlinable, the Swift functions in the overlay need to be @_alwaysEmitIntoClient to prevent Swift from trying to link a program that uses libc++ on Linux against the CxxStdlib binary shipped in the toolchain.

rdar://138838506

egorzhdan commented 1 day ago

@swift-ci please test

egorzhdan commented 1 day ago

@swift-ci please benchmark

Azoy commented 1 day ago

@_alwaysEmitIntoClient implies @inlinable so you don’t need the latter.

egorzhdan commented 1 day ago

Thanks @Azoy!

egorzhdan commented 1 day ago

@swift-ci please smoke test

egorzhdan commented 1 day ago

@swift-ci please benchmark