Skip to content

release/22.x: [libc] Demote compiler check error to a warning (#198033) - #199204

Merged
c-rhodes merged 1 commit into
llvm:release/22.xfrom
llvmbot:issue198033
May 26, 2026
Merged

c-rhodes merged 1 commit into
llvm:release/22.xfrom
llvmbot:issue198033

Conversation

@llvmbot

@llvmbot llvmbot commented May 22, 2026

Copy link
Copy Markdown
Member

Backport 13da33e

Requested by: @jhuber6

@llvmbot

llvmbot commented May 22, 2026

Copy link
Copy Markdown
Member Author

@shiltian What do you think about merging this PR to the release branch?

@llvmorg-github-actions

Copy link
Copy Markdown

@llvm/pr-subscribers-libc

Author: llvmbot

Changes

Backport 13da33e

Requested by: @jhuber6


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

2 Files Affected:

  • (modified) libc/cmake/modules/prepare_libc_gpu_build.cmake (+1-1)
  • (modified) openmp/device/CMakeLists.txt (+1-1)
diff --git a/libc/cmake/modules/prepare_libc_gpu_build.cmake b/libc/cmake/modules/prepare_libc_gpu_build.cmake
index 55cd0242eedeb..2686a5dc4b4df 100644
--- a/libc/cmake/modules/prepare_libc_gpu_build.cmake
+++ b/libc/cmake/modules/prepare_libc_gpu_build.cmake
@@ -7,7 +7,7 @@ endif()
 set(req_ver "${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR}.${LLVM_VERSION_PATCH}")
 if(LLVM_VERSION_MAJOR AND NOT (CMAKE_CXX_COMPILER_ID MATCHES "[Cc]lang" AND
    ${CMAKE_CXX_COMPILER_VERSION} VERSION_EQUAL "${req_ver}"))
-  message(FATAL_ERROR "Cannot build libc for GPU. CMake compiler "
+   message(WARNING "libc for GPU requires an up-to-date clang. CMake compiler "
                       "'${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION}' "
                       " is not 'Clang ${req_ver}'.")
 endif()
diff --git a/openmp/device/CMakeLists.txt b/openmp/device/CMakeLists.txt
index 54cfdfef440a5..06fd5f0f2ed59 100644
--- a/openmp/device/CMakeLists.txt
+++ b/openmp/device/CMakeLists.txt
@@ -2,7 +2,7 @@
 set(req_ver "${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR}.${LLVM_VERSION_PATCH}")
 if(LLVM_VERSION_MAJOR AND NOT (CMAKE_CXX_COMPILER_ID MATCHES "[Cc]lang" AND
    ${CMAKE_CXX_COMPILER_VERSION} VERSION_EQUAL "${req_ver}"))
-  message(FATAL_ERROR "Cannot build GPU device runtime. CMake compiler "
+   message(WARNING "openmp for GPU requires an up-to-date clang. CMake compiler "
                       "'${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION}' "
                       " is not 'Clang ${req_ver}'.")
 endif()

@ZuseZ4

ZuseZ4 commented May 22, 2026

Copy link
Copy Markdown
Contributor

Rust merged offload support, but we don't build it by default since we're still fighting cmake/bootstrap issues.
In CI, we updated our LLVM submodule a while ago to 22, and along with that, we updated our external clang used to build LLVM to 22.
We've since updated our LLVM submodule to newer patch versions, but kept our external clang unchanged, so now they mismatch and builds fail. I'm able to work around it locally, but prefer not to update our external clang in CI.
We have a gsoc student trying to get Rust-offload to work in CI, so fixing this would unblock them.

@github-project-automation github-project-automation Bot moved this from Needs Triage to Needs Merge in LLVM Release Status May 23, 2026
Summary:
This check exists to encode the policy that this is only intended to be
built with a just-built compiler. In practice it's a little too strict
and breaks pretty much every six months when the version bumps or when
people try to build a separate patch. Just demote to a warning.

(cherry picked from commit 13da33e)
@c-rhodes
c-rhodes merged commit 8798085 into llvm:release/22.x May 26, 2026
@github-project-automation github-project-automation Bot moved this from Needs Merge to Done in LLVM Release Status May 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

libc openmp:libomp OpenMP host runtime

Projects

Development

Successfully merging this pull request may close these issues.

5 participants