Skip to content

[libc++] Remove official Clang 18 support. #130142

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 2 commits into from
Mar 27, 2025

Conversation

mordante
Copy link
Member

@mordante mordante commented Mar 6, 2025

Since Clang 20 has been release we no longer support Clang 18 per our policy.

Note the Clang 18 workarounds will be removed in a follow-up patch.

Since Clang 20 has been release we no longer support Clang 18 per our
policy.

Note the Clang 18 workarounds will be removed in a follow-up patch.
@mordante mordante requested a review from a team as a code owner March 6, 2025 17:11
@llvmbot llvmbot added libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi. github:workflow labels Mar 6, 2025
@llvmbot
Copy link
Member

llvmbot commented Mar 6, 2025

@llvm/pr-subscribers-github-workflow

Author: Mark de Wever (mordante)

Changes

Since Clang 20 has been release we no longer support Clang 18 per our policy.

Note the Clang 18 workarounds will be removed in a follow-up patch.


Full diff: https://github.com/llvm/llvm-project/pull/130142.diff

3 Files Affected:

  • (modified) .github/workflows/libcxx-build-and-test.yaml (-4)
  • (modified) libcxx/docs/index.rst (+1-1)
  • (modified) libcxx/include/__configuration/compiler.h (+2-2)
diff --git a/.github/workflows/libcxx-build-and-test.yaml b/.github/workflows/libcxx-build-and-test.yaml
index 5d4394435890a..74889adfa070f 100644
--- a/.github/workflows/libcxx-build-and-test.yaml
+++ b/.github/workflows/libcxx-build-and-test.yaml
@@ -100,10 +100,6 @@ jobs:
           - config: 'generic-cxx26'
             cc: 'clang-19'
             cxx: 'clang++-19'
-          # Release transition
-          - config: 'generic-cxx23'
-            cc: 'clang-18'
-            cxx: 'clang++-18'
     steps:
       - uses: actions/checkout@v4
       - name: ${{ matrix.config }}
diff --git a/libcxx/docs/index.rst b/libcxx/docs/index.rst
index e2c62e9ecac02..a8b0d5ce1ee97 100644
--- a/libcxx/docs/index.rst
+++ b/libcxx/docs/index.rst
@@ -131,7 +131,7 @@ velocity, libc++ drops support for older compilers as newer ones are released.
 ============ =================== ========================== =====================
 Compiler     Versions            Restrictions               Support policy
 ============ =================== ========================== =====================
-Clang        18, 19, 20, 21-git                             latest two stable releases per `LLVM's release page <https://releases.llvm.org>`_ and the development version
+Clang        19, 20, 21-git                                 latest two stable releases per `LLVM's release page <https://releases.llvm.org>`_ and the development version
 AppleClang   15                                             latest stable release per `Xcode's release page <https://developer.apple.com/documentation/xcode-release-notes>`_
 Open XL      17.1.3 (AIX)                                   latest stable release per `Open XL's documentation page <https://www.ibm.com/docs/en/openxl-c-and-cpp-aix>`_
 GCC          14                  In C++11 or later only     latest stable release per `GCC's release page <https://gcc.gnu.org/releases.html>`_
diff --git a/libcxx/include/__configuration/compiler.h b/libcxx/include/__configuration/compiler.h
index cf459a0619b23..4b6c6cad353e3 100644
--- a/libcxx/include/__configuration/compiler.h
+++ b/libcxx/include/__configuration/compiler.h
@@ -33,8 +33,8 @@
 // Warn if a compiler version is used that is not supported anymore
 // LLVM RELEASE Update the minimum compiler versions
 #  if defined(_LIBCPP_CLANG_VER)
-#    if _LIBCPP_CLANG_VER < 1800
-#      warning "Libc++ only supports Clang 18 and later"
+#    if _LIBCPP_CLANG_VER < 1900
+#      warning "Libc++ only supports Clang 19 and later"
 #    endif
 #  elif defined(_LIBCPP_APPLE_CLANG_VER)
 #    if _LIBCPP_APPLE_CLANG_VER < 1500

@llvmbot
Copy link
Member

llvmbot commented Mar 6, 2025

@llvm/pr-subscribers-libcxx

Author: Mark de Wever (mordante)

Changes

Since Clang 20 has been release we no longer support Clang 18 per our policy.

Note the Clang 18 workarounds will be removed in a follow-up patch.


Full diff: https://github.com/llvm/llvm-project/pull/130142.diff

3 Files Affected:

  • (modified) .github/workflows/libcxx-build-and-test.yaml (-4)
  • (modified) libcxx/docs/index.rst (+1-1)
  • (modified) libcxx/include/__configuration/compiler.h (+2-2)
diff --git a/.github/workflows/libcxx-build-and-test.yaml b/.github/workflows/libcxx-build-and-test.yaml
index 5d4394435890a..74889adfa070f 100644
--- a/.github/workflows/libcxx-build-and-test.yaml
+++ b/.github/workflows/libcxx-build-and-test.yaml
@@ -100,10 +100,6 @@ jobs:
           - config: 'generic-cxx26'
             cc: 'clang-19'
             cxx: 'clang++-19'
-          # Release transition
-          - config: 'generic-cxx23'
-            cc: 'clang-18'
-            cxx: 'clang++-18'
     steps:
       - uses: actions/checkout@v4
       - name: ${{ matrix.config }}
diff --git a/libcxx/docs/index.rst b/libcxx/docs/index.rst
index e2c62e9ecac02..a8b0d5ce1ee97 100644
--- a/libcxx/docs/index.rst
+++ b/libcxx/docs/index.rst
@@ -131,7 +131,7 @@ velocity, libc++ drops support for older compilers as newer ones are released.
 ============ =================== ========================== =====================
 Compiler     Versions            Restrictions               Support policy
 ============ =================== ========================== =====================
-Clang        18, 19, 20, 21-git                             latest two stable releases per `LLVM's release page <https://releases.llvm.org>`_ and the development version
+Clang        19, 20, 21-git                                 latest two stable releases per `LLVM's release page <https://releases.llvm.org>`_ and the development version
 AppleClang   15                                             latest stable release per `Xcode's release page <https://developer.apple.com/documentation/xcode-release-notes>`_
 Open XL      17.1.3 (AIX)                                   latest stable release per `Open XL's documentation page <https://www.ibm.com/docs/en/openxl-c-and-cpp-aix>`_
 GCC          14                  In C++11 or later only     latest stable release per `GCC's release page <https://gcc.gnu.org/releases.html>`_
diff --git a/libcxx/include/__configuration/compiler.h b/libcxx/include/__configuration/compiler.h
index cf459a0619b23..4b6c6cad353e3 100644
--- a/libcxx/include/__configuration/compiler.h
+++ b/libcxx/include/__configuration/compiler.h
@@ -33,8 +33,8 @@
 // Warn if a compiler version is used that is not supported anymore
 // LLVM RELEASE Update the minimum compiler versions
 #  if defined(_LIBCPP_CLANG_VER)
-#    if _LIBCPP_CLANG_VER < 1800
-#      warning "Libc++ only supports Clang 18 and later"
+#    if _LIBCPP_CLANG_VER < 1900
+#      warning "Libc++ only supports Clang 19 and later"
 #    endif
 #  elif defined(_LIBCPP_APPLE_CLANG_VER)
 #    if _LIBCPP_APPLE_CLANG_VER < 1500

@DavidSpickett
Copy link
Collaborator

Linaro is working on updating to 19.

@DavidSpickett
Copy link
Collaborator

Sorry for the delay, our workers are using 19.1.7 now and should pass the next build you do.

As of 2 weeks ago there were no problems with the test suite on Arm with this clang, but I am available to debug anything you might find now.

@mordante
Copy link
Member Author

Sorry for the delay, our workers are using 19.1.7 now and should pass the next build you do.

As of 2 weeks ago there were no problems with the test suite on Arm with this clang, but I am available to debug anything you might find now.

Thanks a lot for updating the bots!

DavidSpickett added a commit to DavidSpickett/llvm-project that referenced this pull request Mar 27, 2025
clang-19 changed how Arm triples were normalised and so while
we supported 18 and 19, we could not hard code the path here.

Now that Linaro's bots are running clang-19, and libcxx
is going to drop clang-18 support (llvm#130142)
I have simplified it by hard coding the path again.

I also looked into why this exists in the first place. It was
added in https://reviews.llvm.org/D154246 but not questioned at the time.

It is due to the way we build compiler-rt, which is due to the final
layout we need in the install:
1. The builtins library must be called libclang_rt.builtins.a for
   clang to find it. There must not be an architecture name in the
   filename.
2. That builtins library must be directly in lib/, next to picolib's
   installed files.

To achieve #1 we must set LLVM_ENABLE_PER_TARGET_RUNTIME_DIR=ON.
However, that causes the file to be installed in a per-target dir
which breaks #2. So to fix that, we move the builtins library up
one level into lib/.

The alternative is to turn off per-target dirs, which results in
a builtin file with an arch in the name, then rename and move that
file (since it gets installed into lib/generic/).

So in the end, it's the same amount of hacks. I think it's best to
keep the one that uses LLVM_ENABLE_PER_TARGET_RUNTIME_DIR=ON,
as this is the recommended way to built these days.
@mordante mordante merged commit 82c078c into main Mar 27, 2025
83 checks passed
@mordante mordante deleted the users/mordante/remove_clang_18_support branch March 27, 2025 17:00
DavidSpickett added a commit that referenced this pull request Mar 28, 2025
clang-19 changed how Arm triples were normalised and so while we
supported 18 and 19, we could not hard code the path here.

Now that Linaro's bots are running clang-19, and libcxx is going to drop
clang-18 support (#130142) I
have simplified it by hard coding the path again.

I also looked into why this exists in the first place. It was added in
https://reviews.llvm.org/D154246 but not questioned at the time.

It is due to the way we build compiler-rt, which is due to the final
layout we need in the install:
1. The builtins library must be called libclang_rt.builtins.a for clang
to find it. There must not be an architecture name in the filename.
2. That builtins library must be directly in lib/, next to picolib's
installed files.

To achieve number 1 we must set LLVM_ENABLE_PER_TARGET_RUNTIME_DIR=ON.
However, that causes the file to be installed in a per-target dir which
breaks number 2. So to fix that, we move the builtins library up one
level into lib/.

The alternative is to turn off per-target dirs, which results in a
builtin file with an arch in the name, then rename and move that file
(since it gets installed into lib/generic/).

So in the end, it's the same amount of hacks. I think it's best to keep
the one that uses LLVM_ENABLE_PER_TARGET_RUNTIME_DIR=ON, as this is the
recommended way to built these days.
llvm-sync bot pushed a commit to arm/arm-toolchain that referenced this pull request Mar 28, 2025
…254)

clang-19 changed how Arm triples were normalised and so while we
supported 18 and 19, we could not hard code the path here.

Now that Linaro's bots are running clang-19, and libcxx is going to drop
clang-18 support (llvm/llvm-project#130142) I
have simplified it by hard coding the path again.

I also looked into why this exists in the first place. It was added in
https://reviews.llvm.org/D154246 but not questioned at the time.

It is due to the way we build compiler-rt, which is due to the final
layout we need in the install:
1. The builtins library must be called libclang_rt.builtins.a for clang
to find it. There must not be an architecture name in the filename.
2. That builtins library must be directly in lib/, next to picolib's
installed files.

To achieve number 1 we must set LLVM_ENABLE_PER_TARGET_RUNTIME_DIR=ON.
However, that causes the file to be installed in a per-target dir which
breaks number 2. So to fix that, we move the builtins library up one
level into lib/.

The alternative is to turn off per-target dirs, which results in a
builtin file with an arch in the name, then rename and move that file
(since it gets installed into lib/generic/).

So in the end, it's the same amount of hacks. I think it's best to keep
the one that uses LLVM_ENABLE_PER_TARGET_RUNTIME_DIR=ON, as this is the
recommended way to built these days.
winner245 added a commit that referenced this pull request Apr 13, 2025
`__libcpp_popcount` was previously used as a fallback for `__builtin_popcountg` to ensure compatibility with older compilers (Clang 18 and earlier), as `__builtin_popcountg` became available in Clang 19. Now that support for Clang 18 has been officially dropped in #130142, we can now safely  replace all instances of `__libcpp_popcount` with `__builtin_popcountg` and eliminate the fallback logic.
var-const pushed a commit to ldionne/llvm-project that referenced this pull request Apr 17, 2025
`__libcpp_popcount` was previously used as a fallback for `__builtin_popcountg` to ensure compatibility with older compilers (Clang 18 and earlier), as `__builtin_popcountg` became available in Clang 19. Now that support for Clang 18 has been officially dropped in llvm#130142, we can now safely  replace all instances of `__libcpp_popcount` with `__builtin_popcountg` and eliminate the fallback logic.
winner245 added a commit that referenced this pull request Apr 19, 2025
…3920)

`__libcpp_{ctz, clz}` were previously used as fallbacks for `__builtin_{ctzg, clzg}` to ensure compatibility with older compilers (Clang 18 and earlier), as `__builtin_{ctzg, clzg}` became available in Clang 19. Now that support for Clang 18 has been officially dropped in #130142, we can now safely  replace all instances of `__libcpp_{ctz, clz}` with `__count{l,r}_zero` (which internally call `__builtin_{ctzg, clzg}` and eliminate the fallback logic.

Closes #131179.
IanWood1 pushed a commit to IanWood1/llvm-project that referenced this pull request May 6, 2025
…m#133920)

`__libcpp_{ctz, clz}` were previously used as fallbacks for `__builtin_{ctzg, clzg}` to ensure compatibility with older compilers (Clang 18 and earlier), as `__builtin_{ctzg, clzg}` became available in Clang 19. Now that support for Clang 18 has been officially dropped in llvm#130142, we can now safely  replace all instances of `__libcpp_{ctz, clz}` with `__count{l,r}_zero` (which internally call `__builtin_{ctzg, clzg}` and eliminate the fallback logic.

Closes llvm#131179.
IanWood1 pushed a commit to IanWood1/llvm-project that referenced this pull request May 6, 2025
…m#133920)

`__libcpp_{ctz, clz}` were previously used as fallbacks for `__builtin_{ctzg, clzg}` to ensure compatibility with older compilers (Clang 18 and earlier), as `__builtin_{ctzg, clzg}` became available in Clang 19. Now that support for Clang 18 has been officially dropped in llvm#130142, we can now safely  replace all instances of `__libcpp_{ctz, clz}` with `__count{l,r}_zero` (which internally call `__builtin_{ctzg, clzg}` and eliminate the fallback logic.

Closes llvm#131179.
IanWood1 pushed a commit to IanWood1/llvm-project that referenced this pull request May 6, 2025
…m#133920)

`__libcpp_{ctz, clz}` were previously used as fallbacks for `__builtin_{ctzg, clzg}` to ensure compatibility with older compilers (Clang 18 and earlier), as `__builtin_{ctzg, clzg}` became available in Clang 19. Now that support for Clang 18 has been officially dropped in llvm#130142, we can now safely  replace all instances of `__libcpp_{ctz, clz}` with `__count{l,r}_zero` (which internally call `__builtin_{ctzg, clzg}` and eliminate the fallback logic.

Closes llvm#131179.
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
github:workflow libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants