Commit Graph

3 Commits

Author SHA1 Message Date
Egor Zhdan
fb529ff0ce [cxx-interop] Mark all CxxStdlib APIs as @_alwaysEmitIntoClient
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
2024-11-21 17:09:33 +00:00
Egor Zhdan
269fc941de [cxx-interop] Mark all CxxStdlib APIs as @inlinable
This is a requirement for being able to use the CxxStdlib overlay with a C++ standard library which is not the platform default, specifically libc++ on Linux.

The module would get rebuilt from its textual interface (`CxxStdlib.swiftinterface`) by the compiler whenever a custom C++ stdlib is used. Since the mangled names of C++ stdlib symbols differ across implementations (libc++ vs libstdc++), a Swift program that uses these overlay functions would fail to link, unless the definitions of these functions are available.

rdar://138838506
2024-11-20 22:33:18 +00:00
Egor Zhdan
53fb6531f2 [cxx-interop] Add conversions between std::chrono::duration and Swift.Duration
rdar://123696734
2024-03-01 13:15:05 +00:00