Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,15 @@ on:
# TODO test conan build
jobs:
build:
name: ${{ matrix.build }} (LLVM-${{ matrix.llvm-version }}, ${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
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
Expand All @@ -32,10 +33,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
Expand Down Expand Up @@ -80,6 +81,7 @@ jobs:
-DPHASAR_USE_Z3=ON \
-DPHASAR_BUILD_MODULES=ON \
-DPHASAR_TARGET_ARCH="" \
-DPHASAR_ALLOW_LTO_IN_RELEASE_BUILD=OFF \
-DPHASAR_LLVM_VERSION=${{ matrix.llvm-version }} \
${{ matrix.flags }} \
-G Ninja
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions BUILD.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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`
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
10 changes: 5 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -22,8 +22,8 @@ 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_ALLOW_LTO_IN_RELEASE_BUILD=OFF \
-DPHASAR_BUILD_UNITTESTS=$RUN_TESTS \
-DPHASAR_BUILD_IR=$RUN_TESTS \
-DPHASAR_ENABLE_INTEGRATIONTESTS=$RUN_TESTS \
Expand Down
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions utils/InstallAptDependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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=<value>\t- The LLVM major-version to use (16 or 17, default is 16)"
echo -e "\t--llvm-version=<value>\t- The LLVM major-version to use (16 - 23, default is 21)"
exit 0
;;
*) # unknown option
Expand All @@ -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

Expand Down
Loading