From debc2228515101c3564797fcb23a77a62db0f70b Mon Sep 17 00:00:00 2001 From: Fabian Schiebel Date: Sat, 21 Nov 2026 13:19:56 +0100 Subject: [PATCH 1/4] Bump the default version of LLVM from 16 to 21 --- .github/workflows/ci.yml | 12 ++++++------ .github/workflows/deploy-docs.yml | 4 ++-- BUILD.md | 4 ++-- CMakeLists.txt | 2 +- Dockerfile | 8 ++++---- README.md | 10 ++++++---- bootstrap.sh | 4 ++-- utils/InstallAptDependencies.sh | 8 ++++---- 8 files changed, 27 insertions(+), 25 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ea0a25eda0..a2177c7b6c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,9 +15,9 @@ jobs: fail-fast: true matrix: os: [ubuntu-24.04, ubuntu-24.04-arm] - compiler: [ [clang++-21, clang-21, "clang-21 libclang-rt-21-dev clang-tools-21"] ] + llvm-version: [ "21.1", "23.1" ] build: [ Debug, Release, DebugLibdeps, DebugCov ] - llvm-version: [ 16, "22.1" ] + compiler: [ [clang++-21, clang-21, "clang-21 libclang-rt-21-dev clang-tools-21"] ] include: - build: Debug cmake_build_type: Debug @@ -32,10 +32,10 @@ jobs: cmake_build_type: Debug flags: -DCODE_COVERAGE=ON extra_dependencies: llvm-21 # For coverage - - llvm-version: 16 - llvm-major-version: 16 - - llvm-version: "22.1" - llvm-major-version: 22 + - llvm-version: "21.1" + llvm-major-version: 21 + - llvm-version: "23.1" + llvm-major-version: 23 exclude: - os: ubuntu-24.04-arm build: Debug diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml index 600be9314a..f01b1d18ae 100644 --- a/.github/workflows/deploy-docs.yml +++ b/.github/workflows/deploy-docs.yml @@ -29,8 +29,8 @@ jobs: - name: Build Doxygen Docs shell: bash env: - CXX: clang++-16 - CC: clang-16 + CXX: clang++-21 + CC: clang-21 run: | cmake -S . -B build -DPHASAR_BUILD_DOC=ON cmake --build ./build --target doc_doxygen diff --git a/BUILD.md b/BUILD.md index 4439bc0956..6850eee997 100644 --- a/BUILD.md +++ b/BUILD.md @@ -24,7 +24,7 @@ The bootstrap script may ask for superuser permissions (to install the dependenc ### Requirements PhASAR requires the following system dependencies: -- LLVM >=16 +- LLVM >= 16 (default 21) - We have tested PhASAR only with LLVM versions built with RTTI (runtime-type-info) enabled. Usually, this is no problem as the `llvm-dev` apt package ships with RTTI by default, but may be relevant if you wish to build LLVM from source. - C++20 compatible compiler, *we recommend clang >=20* - cmake >=3.23 @@ -104,7 +104,7 @@ When using CMake to compile PhASAR the following optional parameters can be used | **PHASAR_ENABLE_PIC** : BOOL | Build Position-Independed Code (default is ON) | | **PHASAR_ENABLE_WARNINGS** : BOOL | Enable compiler warnings (default is ON) | | **CMAKE_CXX_STANDARD** : INT|Adapt the used C++ standard (minimum required is 20)| -| **PHASAR_LLVM_VERSION** : VERSION|The LLVM major-version to use. Can be between 16 and 22.1 (default is 16)| +| **PHASAR_LLVM_VERSION** : VERSION|The LLVM major-version to use. Can be between 16 and 23.1 (default is 21)| | **PHASAR_USE_SVF** : BOOL| Enable using SVF points-to info from PhASAR. See [Use PhASAR with SVF](https://github.com/secure-software-engineering/phasar/wiki/FAQ#how-to-use-phasar-with-svf). Requires SVF installed (default OFF) | You can use these parameters either directly or modify the installer-script `bootstrap.sh` diff --git a/CMakeLists.txt b/CMakeLists.txt index c756364269..165c56ae29 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -333,7 +333,7 @@ endif() option(USE_LLVM_FAT_LIB "Link against libLLVM.so instead of the individual LLVM libraries if possible (default is OFF; always on if BUILD_SHARED_LIBS is ON)" OFF) # LLVM -set(PHASAR_LLVM_VERSION 16 CACHE STRING "The LLVM major-version that PhASAR should use") +set(PHASAR_LLVM_VERSION 21.1 CACHE STRING "The LLVM major-version that PhASAR should use") include(add_llvm) add_llvm() diff --git a/Dockerfile b/Dockerfile index dada676b79..7c9c01ce7d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,12 +1,12 @@ -ARG baseimage="ubuntu:24.04" +ARG baseimage="ubuntu:26.04" FROM "$baseimage" AS build RUN --mount=type=bind,source=./utils/InstallAptDependencies.sh,target=/InstallAptDependencies.sh \ set -eux; \ - ./InstallAptDependencies.sh --noninteractive tzdata clang-20 libclang-rt-20-dev clang-tools-20 llvm-16-tools llvm-20-tools + ./InstallAptDependencies.sh --noninteractive tzdata clang-21 libclang-rt-21-dev clang-tools-21 llvm-21-tools -ENV CC=/usr/bin/clang-20 \ - CXX=/usr/bin/clang++-20 +ENV CC=/usr/bin/clang-21 \ + CXX=/usr/bin/clang++-21 FROM build diff --git a/README.md b/README.md index b182fd3715..1339bff647 100644 --- a/README.md +++ b/README.md @@ -51,16 +51,18 @@ PhASAR supports C++20 modules as an experimental feature. ### LLVM Version -PhASAR supports LLVM versions **between LLVM-16 and LLVM-22.1**, using LLVM-16 by default. +PhASAR supports LLVM versions **between LLVM-16 and LLVM-23.1**, using LLVM-21 by default. -**Support for LLVM-23 is experimental.** - -We actively test PhASAR with LLVM-16 and LLVM-22.1, so if something does not work, try these versions instead. +We actively test PhASAR with LLVM-21.1 and LLVM-23.1, so if something does not work, try these versions instead. Specify the `PHASAR_LLVM_VERSION` cmake variable to change the LLVM version to use. > [!NOTE] > Since v18, LLVM uses minor versions, so use `-DPHASAR_LLVM_VERSION=17` for LLVM-17 but `-DPHASAR_LLVM_VERSION=18.1` for LLVM-18 +> [!IMPORTANT] +> We are slowly retiring support for LLVM 16-20, so if you are using one of these versions, we recommend to upgrade. +> Checkout the [Update to Newer LLVM Versions](https://github.com/secure-software-engineering/phasar/wiki/Update-to-Newer-LLVM-Versions) Wiki page for more information. + ## Breaking Changes To keep PhASAR in a state that is well suited for state-of-the-art research in static analysis, as well as for productive use, we have to make breaking changes. Please refer to [Breaking Changes](./BreakingChanges.md) for detailed information on what was broken recently and how to migrate. diff --git a/bootstrap.sh b/bootstrap.sh index b61241a2be..84772a9b14 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -6,10 +6,10 @@ source ./utils/safeCommandsSet.sh readonly PHASAR_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" PHASAR_INSTALL_DIR="/usr/local/phasar" -LLVM_INSTALL_DIR="/usr/local/llvm-16" +LLVM_INSTALL_DIR="/usr/local/llvm-21" NUM_THREADS=$(nproc) -LLVM_RELEASE=llvmorg-16.0.6 +LLVM_RELEASE=llvmorg-21.0.8 DO_UNIT_TEST=true DO_INSTALL=false BUILD_TYPE=Release diff --git a/utils/InstallAptDependencies.sh b/utils/InstallAptDependencies.sh index 2c92ca036e..7d25119353 100755 --- a/utils/InstallAptDependencies.sh +++ b/utils/InstallAptDependencies.sh @@ -2,7 +2,7 @@ set -euo pipefail noninteractive="false" -LLVM_IR_VERSION=16 +LLVM_IR_VERSION=21 # Parsing command-line-parameters # See "https://stackoverflow.com/questions/192249/how-do-i-parse-command-line-arguments-in-bash" as a reference @@ -31,7 +31,7 @@ case $key in echo "" echo "OPTIONS:" echo -e "\t--noninteractive,-ni\t- Non-interactive mode for apt" - echo -e "\t--llvm-version=\t- The LLVM major-version to use (16 or 17, default is 16)" + echo -e "\t--llvm-version=\t- The LLVM major-version to use (16 - 23, default is 21)" exit 0 ;; *) # unknown option @@ -43,8 +43,8 @@ done set -- "${POSITIONAL[@]}" # restore positional parameters # End - Parsing command-line-parameters -if [ "$LLVM_IR_VERSION" -lt "16" ] || [ "$LLVM_IR_VERSION" -gt "22" ]; then - echo "Invalid LLVM version: $LLVM_IR_VERSION, expected a version between 16 and 22" >&2 +if [ "$LLVM_IR_VERSION" -lt "16" ] || [ "$LLVM_IR_VERSION" -gt "23" ]; then + echo "Invalid LLVM version: $LLVM_IR_VERSION, expected a version between 16 and 23" >&2 exit 1 fi From 15a3e06edf6d09c109f1fab521b7e26714e1b5de Mon Sep 17 00:00:00 2001 From: Fabian Schiebel Date: Sat, 21 Nov 2026 14:03:22 +0100 Subject: [PATCH 2/4] Attempt to fix ci --- .github/workflows/ci.yml | 1 + Dockerfile | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a2177c7b6c..96c61712c0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -80,6 +80,7 @@ jobs: -DPHASAR_USE_Z3=ON \ -DPHASAR_BUILD_MODULES=ON \ -DPHASAR_TARGET_ARCH="" \ + -DPHASAR_ALLOW_LTO_IN_RELEASE_BUILD=OFF \ # made problems recently on ARM; cannot reproduce -DPHASAR_LLVM_VERSION=${{ matrix.llvm-version }} \ ${{ matrix.flags }} \ -G Ninja diff --git a/Dockerfile b/Dockerfile index 7c9c01ce7d..538c4b554f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -22,7 +22,6 @@ RUN --mount=type=bind,source=.,target=/usr/src/phasar,rw \ -DCMAKE_BUILD_TYPE=Release \ -DPHASAR_TARGET_ARCH="" \ -DPHASAR_ENABLE_SANITIZERS=ON \ - -DBUILD_PHASAR_CLANG=ON \ -DPHASAR_USE_Z3=ON \ -DPHASAR_BUILD_UNITTESTS=$RUN_TESTS \ -DPHASAR_BUILD_IR=$RUN_TESTS \ From 11265352e78ba5f9ad1a1f8a7f6e702784c6bdac Mon Sep 17 00:00:00 2001 From: Fabian Schiebel Date: Sat, 21 Nov 2026 14:22:55 +0100 Subject: [PATCH 3/4] minor --- .github/workflows/ci.yml | 2 +- Dockerfile | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 96c61712c0..906ec4908e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -80,7 +80,7 @@ jobs: -DPHASAR_USE_Z3=ON \ -DPHASAR_BUILD_MODULES=ON \ -DPHASAR_TARGET_ARCH="" \ - -DPHASAR_ALLOW_LTO_IN_RELEASE_BUILD=OFF \ # made problems recently on ARM; cannot reproduce + -DPHASAR_ALLOW_LTO_IN_RELEASE_BUILD=OFF \ -DPHASAR_LLVM_VERSION=${{ matrix.llvm-version }} \ ${{ matrix.flags }} \ -G Ninja diff --git a/Dockerfile b/Dockerfile index 538c4b554f..a0152ed9b6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -23,6 +23,7 @@ RUN --mount=type=bind,source=.,target=/usr/src/phasar,rw \ -DPHASAR_TARGET_ARCH="" \ -DPHASAR_ENABLE_SANITIZERS=ON \ -DPHASAR_USE_Z3=ON \ + -DPHASAR_ALLOW_LTO_IN_RELEASE_BUILD=OFF \ -DPHASAR_BUILD_UNITTESTS=$RUN_TESTS \ -DPHASAR_BUILD_IR=$RUN_TESTS \ -DPHASAR_ENABLE_INTEGRATIONTESTS=$RUN_TESTS \ From 6e158005365a170a5373ae011280a82a95e9c8c5 Mon Sep 17 00:00:00 2001 From: Fabian Schiebel Date: Sat, 21 Nov 2026 14:36:46 +0100 Subject: [PATCH 4/4] Explicit CI workflow names --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 906ec4908e..b4751c6c85 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,6 +10,7 @@ on: # TODO test conan build jobs: build: + name: ${{ matrix.build }} (LLVM-${{ matrix.llvm-version }}, ${{ matrix.os }}) runs-on: ${{ matrix.os }} strategy: fail-fast: true