-
Notifications
You must be signed in to change notification settings - Fork 6
Add support for LLVM 21 #807
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -99,59 +99,59 @@ jobs: | |
| os: ubuntu-latest | ||
| COMPILER: gcc | ||
|
|
||
| - name: clang 20 Release (Linux Intel) | ||
| - name: clang 21 Release (Linux Intel) | ||
| os: ubuntu-latest | ||
| BUILD_TYPE: Release | ||
| COMPILER: clang | ||
|
|
||
| - name: clang 20 Release with ASan (Linux Intel) | ||
| - name: clang 21 Release with ASan (Linux Intel) | ||
| os: ubuntu-latest | ||
| BUILD_TYPE: Release | ||
| SANITIZE_ADDRESS: ON | ||
| COMPILER: clang | ||
|
|
||
| - name: clang 20 Release with TSan (Linux Intel) | ||
| - name: clang 21 Release with TSan (Linux Intel) | ||
| os: ubuntu-latest | ||
| BUILD_TYPE: Release | ||
| SANITIZE_THREAD: ON | ||
| COMPILER: clang | ||
|
|
||
| - name: clang 20 Release with UBSan (Linux Intel) | ||
| - name: clang 21 Release with UBSan (Linux Intel) | ||
| os: ubuntu-latest | ||
| BUILD_TYPE: Release | ||
| SANITIZE_UB: ON | ||
| COMPILER: clang | ||
|
|
||
| - name: clang 20 Debug (Linux Intel) | ||
| - name: clang 21 Debug (Linux Intel) | ||
| os: ubuntu-latest | ||
| BUILD_TYPE: Debug | ||
| COMPILER: clang | ||
|
|
||
| - name: clang 20 Debug with ASan (Linux Intel) | ||
| - name: clang 21 Debug with ASan (Linux Intel) | ||
| os: ubuntu-latest | ||
| BUILD_TYPE: Debug | ||
| SANITIZE_ADDRESS: ON | ||
| COMPILER: clang | ||
|
|
||
| - name: clang 20 Debug with TSan (Linux Intel) | ||
| - name: clang 21 Debug with TSan (Linux Intel) | ||
| os: ubuntu-latest | ||
| BUILD_TYPE: Debug | ||
| SANITIZE_THREAD: ON | ||
| COMPILER: clang | ||
|
|
||
| - name: clang 20 Debug with UBSan (Linux Intel) | ||
| - name: clang 21 Debug with UBSan (Linux Intel) | ||
| os: ubuntu-latest | ||
| BUILD_TYPE: Debug | ||
| SANITIZE_UB: ON | ||
| COMPILER: clang | ||
|
|
||
| - name: clang 20 Release static analysis (Linux Intel) | ||
| - name: clang 21 Release static analysis (Linux Intel) | ||
| os: ubuntu-latest | ||
| BUILD_TYPE: Release | ||
| COMPILER: clang | ||
| STATIC_ANALYSIS: ON | ||
|
|
||
| - name: clang 20 Debug static analysis (Linux Intel) | ||
| - name: clang 21 Debug static analysis (Linux Intel) | ||
| os: ubuntu-latest | ||
| BUILD_TYPE: Debug | ||
| COMPILER: clang | ||
|
|
@@ -313,41 +313,41 @@ jobs: | |
| COMPILER: gcc | ||
| SANITIZE_UB: ON | ||
|
|
||
| - name: clang 20 Release (Linux ARM64) | ||
| - name: clang 21 Release (Linux ARM64) | ||
| os: ubuntu-24.04-arm | ||
| BUILD_TYPE: Release | ||
| COMPILER: clang | ||
|
|
||
| - name: clang 20 Release with TSan (Linux ARM64) | ||
| - name: clang 21 Release with TSan (Linux ARM64) | ||
| os: ubuntu-24.04-arm | ||
| BUILD_TYPE: Release | ||
| COMPILER: clang | ||
| SANITIZE_THREAD: ON | ||
|
|
||
| - name: clang 20 Release with UBSan (Linux ARM64) | ||
| - name: clang 21 Release with UBSan (Linux ARM64) | ||
| os: ubuntu-24.04-arm | ||
| BUILD_TYPE: Release | ||
| COMPILER: clang | ||
| SANITIZE_UB: ON | ||
|
|
||
| - name: clang 20 Debug (Linux ARM64) | ||
| - name: clang 21 Debug (Linux ARM64) | ||
| os: ubuntu-24.04-arm | ||
| BUILD_TYPE: Debug | ||
| COMPILER: clang | ||
|
|
||
| - name: clang 20 Debug with ASan (Linux ARM64) | ||
| - name: clang 21 Debug with ASan (Linux ARM64) | ||
| os: ubuntu-24.04-arm | ||
| BUILD_TYPE: Debug | ||
| COMPILER: clang | ||
| SANITIZE_ADDRESS: ON | ||
|
|
||
| - name: clang 20 Debug with TSan (Linux ARM64) | ||
| - name: clang 21 Debug with TSan (Linux ARM64) | ||
| os: ubuntu-24.04-arm | ||
| BUILD_TYPE: Debug | ||
| COMPILER: clang | ||
| SANITIZE_THREAD: ON | ||
|
|
||
| - name: clang 20 Debug with UBSan (Linux ARM64) | ||
| - name: clang 21 Debug with UBSan (Linux ARM64) | ||
| os: ubuntu-24.04-arm | ||
| BUILD_TYPE: Debug | ||
| COMPILER: clang | ||
|
|
@@ -389,25 +389,25 @@ jobs: | |
| curl 'https://apt.llvm.org/llvm-snapshot.gpg.key' \ | ||
| | sudo apt-key add - | ||
| sudo add-apt-repository -y \ | ||
| "deb http://apt.llvm.org/noble/ llvm-toolchain-noble-20 main" | ||
| "deb http://apt.llvm.org/noble/ llvm-toolchain-noble-21 main" | ||
| sudo apt-get update | ||
| sudo apt-get install -y clang-20 iwyu | ||
| sudo apt-get install -y clang-21 iwyu | ||
| if: runner.os == 'Linux' && env.COMPILER == 'clang' | ||
|
|
||
| - name: Setup dependencies for Linux LLVM (Release) | ||
| run: sudo apt-get install -y libomp5-20 llvm-20 lld-20 | ||
| run: sudo apt-get install -y libomp5 llvm-21 lld-21 | ||
| if: > | ||
| runner.os == 'Linux' && env.COMPILER == 'clang' | ||
| && env.BUILD_TYPE == 'Release' | ||
|
|
||
| - name: Setup dependencies for Linux LLVM (static analysis) | ||
| run: sudo apt-get install -y clang-tools-20 | ||
| run: sudo apt-get install -y clang-tools-21 | ||
| if: > | ||
| runner.os == 'Linux' && env.COMPILER == 'clang' | ||
| && env.STATIC_ANALYSIS == 'ON' | ||
|
|
||
| - name: Setup dependencies for Linux LLVM (not static analysis) | ||
| run: sudo apt-get install -y clang-tidy-20 | ||
| run: sudo apt-get install -y clang-tidy-21 | ||
|
Comment on lines
+392
to
+410
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# Check if commit 42f61a1 exists and what it changed
echo "=== Checking commit 42f61a1 ==="
git log --all --oneline | grep -i "42f61a1" || echo "Searching for commit..."
git show 42f61a1 --stat 2>/dev/null || echo "Commit 42f61a1 not found in history"
echo ""
echo "=== Current state of libomp in workflow ==="
grep -n "libomp" .github/workflows/build.yml || echo "No libomp references found"
echo ""
echo "=== LLVM version references context ==="
sed -n '390,415p' .github/workflows/build.ymlRepository: laurynas-biveinis/unodb Length of output: 1345 🌐 Web query:
💡 Result: Use the versioned package libomp5-21 (runtime) — the development package is libomp-21-dev. [1][2] Sources: apt.llvm.org package list and Ubuntu llvm-toolchain-21 tracker. [1] [2] Fix libomp5 to use versioned package for consistency with other LLVM 21 dependencies. Line 398 installs unversioned Note: The original review comment referenced commit 42f61a1 as the resolution, but this commit does not exist in the repository history. The issue remains unfixed. 🤖 Prompt for AI Agents |
||
| if: > | ||
| runner.os == 'Linux' && env.COMPILER == 'clang' | ||
| && env.STATIC_ANALYSIS != 'ON' | ||
|
|
@@ -444,7 +444,7 @@ jobs: | |
| export CC=gcc-$V | ||
| export CXX=g++-$V | ||
| elif [[ $COMPILER == "clang" ]]; then | ||
| V=20 | ||
| V=21 | ||
| export CC=clang-$V | ||
| export CXX=clang++-$V | ||
| if [[ $BUILD_TYPE == "Release" ]]; then | ||
|
|
@@ -497,7 +497,7 @@ jobs: | |
| - name: clang static analysis | ||
| working-directory: ${{github.workspace}}/build | ||
| run: | | ||
| /usr/bin/scan-build-20 --status-bugs -stats -analyze-headers \ | ||
| /usr/bin/scan-build-21 --status-bugs -stats -analyze-headers \ | ||
| --force-analyze-debug-code make -j3 -k; | ||
| if: env.STATIC_ANALYSIS == 'ON' && env.COMPILER == 'clang' | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -88,6 +88,8 @@ set(CLANG_LT_13_CXX_WARNING_FLAGS "-Wreserved-id-macro") | |
| set(CLANG_GE_13_CXX_WARNING_FLAGS "-Wreserved-identifier") | ||
| # Do not enable clang 16+ -Wunsafe-buffer-usage because it warns on all memcpy | ||
| # calls and our pointer- and span-like class implementations. | ||
| set(CLANG_GE_21_CXX_WARNING_FLAGS "-Wnrvo" "-Wunique-object-duplication" | ||
| "-Wshift-bool" "-Wc99-designator" "-Wms-bitfield-padding") | ||
|
|
||
| set(GCC_CXX_WARNING_FLAGS | ||
| # Warning groups | ||
|
|
@@ -296,10 +298,17 @@ if(SANITIZE_UB) | |
| if(is_clang AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.0) | ||
| list(APPEND SANITIZER_CXX_FLAGS "-fsanitize=implicit-bitfield-conversion") | ||
| endif() | ||
| if(is_clang AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 21.0) | ||
| list(APPEND SANITIZER_CXX_FLAGS "-fsanitize=vptr") | ||
| endif() | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
| endif() | ||
|
|
||
| set(SANITIZER_LD_FLAGS "-fsanitize=undefined") | ||
|
|
||
| if(is_clang AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 21.0) | ||
| list(APPEND SANITIZER_LD_FLAGS "-fsanitize=vptr") | ||
| endif() | ||
|
|
||
| string(CONCAT UBSAN_ENV "UBSAN_OPTIONS=" | ||
| "print_stacktrace=1:halt_on_error=1:abort_on_error=1") | ||
|
|
||
|
|
@@ -402,9 +411,13 @@ set(cxx_ge_12 "$<VERSION_GREATER_EQUAL:$<CXX_COMPILER_VERSION>,12.0>") | |
| set(cxx_lt_13 "$<VERSION_LESS:$<CXX_COMPILER_VERSION>,13.0>") | ||
| set(cxx_ge_13 "$<VERSION_GREATER_EQUAL:$<CXX_COMPILER_VERSION>,13.0>") | ||
| set(cxx_ge_14 "$<VERSION_GREATER_EQUAL:$<CXX_COMPILER_VERSION>,14.0>") | ||
| set(cxx_ge_21 "$<VERSION_GREATER_EQUAL:$<CXX_COMPILER_VERSION>,21.0>") | ||
| set(is_clang_lt_13_not_windows "$<AND:${is_clang_not_windows},${cxx_lt_13}>") | ||
| set(is_clang_ge_13_not_windows "$<AND:${is_clang_not_windows},${cxx_ge_13}>") | ||
| set(is_clang_ge_14_not_windows "$<AND:${is_clang_not_windows},${cxx_ge_14}>") | ||
| set(is_clang_ge_21_not_windows "$<AND:${is_clang_not_windows},${cxx_ge_21}>") | ||
| set(is_darwin_clang_ge_21_x86_64 "$<AND:$<PLATFORM_ID:Darwin>,${is_clang_ge_21_not_windows},${is_not_windows_x86_64}>") | ||
| set(is_darwin_clang_ge_21_arm64 "$<AND:$<PLATFORM_ID:Darwin>,${is_clang_ge_21_not_windows},$<NOT:${is_not_windows_x86_64}>>") | ||
| set(is_gxx_ge_11 "$<AND:${is_gxx_genex},${cxx_ge_11}>") | ||
| set(is_gxx_ge_12 "$<AND:${is_gxx_genex},${cxx_ge_12}>") | ||
| set(is_gxx_ge_14 "$<AND:${is_gxx_genex},${cxx_ge_14}>") | ||
|
|
@@ -616,6 +629,10 @@ else() | |
| else() | ||
| message(STATUS "clang-tidy found: ${CLANG_TIDY_EXE}") | ||
| set(DO_CLANG_TIDY "${CLANG_TIDY_EXE}" "-p=${CMAKE_BINARY_DIR}") | ||
| # Add suppression for unknown warning options when clang-tidy might not | ||
| # recognize all compiler warning flags (e.g., when scan-build from LLVM 21 | ||
| # wraps the build) | ||
| list(APPEND DO_CLANG_TIDY "--extra-arg=-Wno-unknown-warning-option") | ||
| endif() | ||
| endif() | ||
|
|
||
|
|
@@ -674,7 +691,9 @@ if(IWYU) | |
| IWYU_VERSION_OUTPUT) | ||
| message(STATUS | ||
| "include-what-you-use found: ${IWYU_EXE}, --version: ${IWYU_VERSION_OUTPUT}") | ||
| set(DO_IWYU "${IWYU_EXE}") | ||
| # IWYU is not necessarily based on the same version clang is and might not | ||
| # understand newer options | ||
| set(DO_IWYU "${IWYU_EXE};-Wno-unknown-warning-option") | ||
|
laurynas-biveinis marked this conversation as resolved.
Comment on lines
+694
to
+696
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick | 🔵 Trivial IWYU workaround comment is adequate but could be more detailed. The comment explains why 🤖 Prompt for AI Agents |
||
| endif() | ||
| endif() | ||
| endif() | ||
|
|
@@ -709,6 +728,7 @@ function(COMMON_TARGET_PROPERTIES TARGET) | |
| "$<$<AND:${is_standalone},${is_any_clang_genex},${is_not_windows}>:${CLANG_CXX_WARNING_FLAGS}>" | ||
| "$<$<AND:${is_standalone},${is_clang_lt_13_not_windows}>:${CLANG_LT_13_CXX_WARNING_FLAGS}>" | ||
| "$<$<AND:${is_standalone},${is_clang_ge_13_not_windows}>:${CLANG_GE_13_CXX_WARNING_FLAGS}>" | ||
| "$<$<AND:${is_standalone},${is_clang_ge_21_not_windows}>:${CLANG_GE_21_CXX_WARNING_FLAGS}>" | ||
| "$<$<AND:${is_standalone},${is_gxx_genex}>:${GCC_CXX_WARNING_FLAGS}>" | ||
| "$<$<AND:${is_standalone},${is_gxx_ge_11}>:${GCC_GE_11_CXX_WARNING_FLAGS}>" | ||
| "$<$<AND:${is_standalone},${is_gxx_ge_12}>:${GCC_GE_12_CXX_WARNING_FLAGS}>" | ||
|
|
@@ -721,6 +741,10 @@ function(COMMON_TARGET_PROPERTIES TARGET) | |
| target_link_options(${TARGET} INTERFACE "$<${coverage_on}:--coverage>") | ||
| target_link_options(${TARGET} PRIVATE | ||
| "$<${is_apple_clang_genex}:-Wl,-no_warn_duplicate_libraries>" | ||
| "$<${is_darwin_clang_ge_21_x86_64}:-L/usr/local/opt/llvm/lib/c++>" | ||
| "$<${is_darwin_clang_ge_21_x86_64}:-Wl,-rpath,/usr/local/opt/llvm/lib/c++>" | ||
| "$<${is_darwin_clang_ge_21_arm64}:-L/opt/homebrew/opt/llvm/lib/c++>" | ||
| "$<${is_darwin_clang_ge_21_arm64}:-Wl,-rpath,/opt/homebrew/opt/llvm/lib/c++>" | ||
| "${SANITIZER_LD_FLAGS}" | ||
| ) | ||
| target_link_libraries(${TARGET} PRIVATE | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.