Skip to content

Commit 26b5607

Browse files
authored
[cxx-interop] Document libc++ support on Linux
1 parent 29e610a commit 26b5607

File tree

1 file changed

+13
-3
lines changed
  • documentation/cxx-interop/status

1 file changed

+13
-3
lines changed

documentation/cxx-interop/status/index.md

+13-3
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,20 @@ code for a specific deployment platform:
7979
| **Ubuntu, CentOS, Amazon Linux** | libstdc++ |
8080
| **Windows** | Microsoft C++ Standard Library (msvcprt) |
8181

82+
Swift also supports selecting libc++ when building on certain Linux
83+
distributions by passing `-Xcc -stdlib=libc++` flags. On those distributions,
84+
libc++ needs to be installed from a system package manager, e.g. apt or yum.
85+
This compatibility matrix shows the versions of libc++ that are supported by
86+
Swift when building for various Linux versions:
87+
88+
| Linux version running Swift application | Supported libc++ package |
89+
|-----------------------------------------|--------------------------|
90+
| Ubuntu 22.04 | libc++-15-dev |
91+
| Ubuntu 24.04 | libc++-18-dev |
92+
8293
Swift does not currently support selecting an alternative standard library for
83-
platforms that support alternative standard libraries. For example, you can't use
84-
libc++ when building Swift code for Ubuntu, even though libc++ can be used when
85-
building C++ code for Ubuntu.
94+
other platforms. For example, you can't use libc++ when building Swift code for
95+
Windows, even though libc++ can be used when building C++ code for Windows.
8696

8797
Mixed Swift and C++ code must use
8898
the same C++ standard library.

0 commit comments

Comments
 (0)