Enable -flto and -fsanitize=cfi in clang #10457
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and test | |
on: [push, pull_request] | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
permissions: | |
contents: read | |
pull-requests: write | |
jobs: | |
ubuntu-build: | |
name: Build - Ubuntu | |
strategy: | |
matrix: | |
os: ['ubuntu-20.04', 'ubuntu-22.04'] | |
build_type: [Debug, Release] | |
compiler: [{c: gcc, cxx: g++}] | |
libbacktrace: ['-DVAL_USE_LIBBACKTRACE_BACKTRACE=OFF'] | |
pool_tracking: ['-DUMF_ENABLE_POOL_TRACKING=ON', '-DUMF_ENABLE_POOL_TRACKING=OFF'] | |
latency_tracking: ['-DUR_ENABLE_LATENCY_HISTOGRAM=OFF'] | |
include: | |
- os: 'ubuntu-22.04' | |
build_type: Release | |
compiler: {c: clang, cxx: clang++} | |
libbacktrace: '-DVAL_USE_LIBBACKTRACE_BACKTRACE=OFF' | |
- os: 'ubuntu-22.04' | |
build_type: Release | |
compiler: {c: gcc, cxx: g++} | |
libbacktrace: '-DVAL_USE_LIBBACKTRACE_BACKTRACE=ON' | |
- os: 'ubuntu-22.04' | |
build_type: Release | |
compiler: {c: clang, cxx: clang++} | |
libbacktrace: '-DVAL_USE_LIBBACKTRACE_BACKTRACE=ON' | |
- os: 'ubuntu-20.04' | |
build_type: Release | |
compiler: {c: gcc-7, cxx: g++-7} | |
- os: 'ubuntu-22.04' | |
build_type: Release | |
compiler: {c: clang, cxx: clang++} | |
latency_tracking: '-DUR_ENABLE_LATENCY_HISTOGRAM=ON' | |
runs-on: ${{ (matrix.os == 'ubuntu-22.04' && github.repository_owner == 'oneapi-src') && 'intel-ubuntu-22.04' || matrix.os }} | |
steps: | |
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
- name: Install apt packages | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y ${{matrix.compiler.c}} devscripts | |
- name: Install libhwloc | |
run: .github/scripts/install_hwloc.sh | |
- name: Setup PATH | |
run: echo "$HOME/.local/bin" >> $GITHUB_PATH | |
- name: Install g++-7 | |
if: matrix.compiler.cxx == 'g++-7' | |
run: | | |
sudo apt-get install -y ${{matrix.compiler.cxx}} | |
- name: Install libbacktrace | |
if: matrix.libbacktrace == '-DVAL_USE_LIBBACKTRACE_BACKTRACE=ON' | |
run: | | |
git clone https://github.com/ianlancetaylor/libbacktrace.git | |
cd libbacktrace | |
./configure | |
make | |
sudo make install | |
cd .. | |
- name: Download DPC++ | |
if: matrix.os == 'ubuntu-22.04' | |
run: | | |
sudo apt install libncurses5 | |
wget -O ${{github.workspace}}/dpcpp_compiler.tar.gz https://github.com/intel/llvm/releases/download/nightly-2024-09-27/sycl_linux.tar.gz | |
mkdir -p ${{github.workspace}}/dpcpp_compiler | |
tar -xvf ${{github.workspace}}/dpcpp_compiler.tar.gz -C ${{github.workspace}}/dpcpp_compiler | |
- name: Configure CMake | |
if: matrix.os == 'ubuntu-22.04' | |
# WEXTRA: https://github.com/oneapi-src/unified-runtime/issues/2109 | |
run: > | |
cmake | |
-B${{github.workspace}}/build | |
-DCMAKE_C_COMPILER=${{matrix.compiler.c}} | |
-DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}} | |
-DUR_ENABLE_TRACING=ON | |
-DCMAKE_BUILD_TYPE=${{matrix.build_type}} | |
-DUR_BUILD_TESTS=ON | |
-DUR_FORMAT_CPP_STYLE=OFF | |
-DUR_DEVELOPER_MODE=ON | |
-DUR_DPCXX=${{github.workspace}}/dpcpp_compiler/bin/clang++ | |
-DUR_CONFORMANCE_TEST_LOADER=OFF | |
${{matrix.libbacktrace}} | |
${{matrix.pool_tracking}} | |
${{matrix.latency_tracking}} | |
- name: Configure CMake | |
if: matrix.os == 'ubuntu-20.04' | |
# WEXTRA: https://github.com/oneapi-src/unified-runtime/issues/2109 | |
# Note: Disable Werror, since 20.04 raises different ones than 22.04 | |
run: > | |
cmake | |
-B${{github.workspace}}/build | |
-DCMAKE_C_COMPILER=${{matrix.compiler.c}} | |
-DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}} | |
-DUR_ENABLE_TRACING=ON | |
-DCMAKE_BUILD_TYPE=${{matrix.build_type}} | |
-DUR_BUILD_TESTS=ON | |
-DUR_FORMAT_CPP_STYLE=OFF | |
-DUR_DEVELOPER_MODE=OFF | |
${{matrix.libbacktrace}} | |
${{matrix.pool_tracking}} | |
${{matrix.latency_tracking}} | |
- name: Build | |
run: cmake --build ${{github.workspace}}/build -j $(nproc) | |
- name: Verify hardening flags have been set | |
run: cmake --build ${{github.workspace}}/build --target verify-hardening | |
# https://github.com/oneapi-src/unified-runtime/issues/2120 | |
if: ${{ matrix.compiler.cxx != 'clang++' && matrix.os != 'ubuntu-20.04' }} | |
- name: Test | |
working-directory: ${{github.workspace}}/build | |
run: ctest -C ${{matrix.build_type}} --output-on-failure -L "umf|loader|validation|tracing|unit|urtrace" | |
fuzztest: | |
name: Fuzz tests short | |
uses: ./.github/workflows/build-fuzz-reusable.yml | |
with: | |
test_label: "fuzz-short" | |
cuda-1: | |
name: CUDA 1 | |
uses: ./.github/workflows/build-hw-reusable.yml | |
with: | |
adapter_name: CUDA | |
runner_name: CUDA | |
cuda-2: | |
name: CUDA 2 | |
uses: ./.github/workflows/build-hw-reusable.yml | |
with: | |
adapter_name: CUDA | |
runner_name: CUDA | |
cuda-3: | |
name: CUDA 3 | |
uses: ./.github/workflows/build-hw-reusable.yml | |
with: | |
adapter_name: CUDA | |
runner_name: CUDA | |
cuda-4: | |
name: CUDA 4 | |
uses: ./.github/workflows/build-hw-reusable.yml | |
with: | |
adapter_name: CUDA | |
runner_name: CUDA |