Skip to content

Commit

Permalink
Merge pull request #2366 from RossBrunton/ross/asancfi
Browse files Browse the repository at this point in the history
Disable CFI checks when ASAN is specified
  • Loading branch information
RossBrunton authored Nov 27, 2024
2 parents 0f0703b + 3ed2dcf commit c4d9fdb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/build-fuzz-reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@ jobs:
cmake --build build -j $(nproc)
- name: Configure CMake
# CFI sanitization (or flto?) seems to cause linking to fail
# https://github.com/oneapi-src/unified-runtime/issues/2323
run: >
cmake
-B${{github.workspace}}/build
Expand All @@ -60,7 +58,6 @@ jobs:
-DUR_USE_ASAN=ON
-DUR_USE_UBSAN=ON
-DUR_BUILD_ADAPTER_L0=ON
-DUR_USE_CFI=OFF
-DUR_LEVEL_ZERO_LOADER_LIBRARY=${{github.workspace}}/level-zero/build/lib/libze_loader.so
-DUR_LEVEL_ZERO_INCLUDE_DIR=${{github.workspace}}/level-zero/include/
-DUR_DPCXX=${{github.workspace}}/dpcpp_compiler/bin/clang++
Expand Down
6 changes: 6 additions & 0 deletions cmake/helpers.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,12 @@ if(CMAKE_SYSTEM_NAME STREQUAL Linux)
check_cxx_compiler_flag("-fstack-clash-protection" CXX_HAS_FSTACK_CLASH_PROTECTION)
endif()

if (UR_USE_CFI AND UR_USE_ASAN)
message(WARNING "Both UR_USE_CFI and UR_USE_ASAN are ON. "
"Due to build errors, this is unsupported; CFI checks will be disabled")
set(UR_USE_CFI OFF)
endif()

if (UR_USE_CFI)
set(SAVED_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS})
set(CMAKE_REQUIRED_FLAGS "-flto -fvisibility=hidden")
Expand Down

0 comments on commit c4d9fdb

Please sign in to comment.