Skip to content

Commit 7cee026

Browse files
authored
Added tsan to ci (#3247)
* Added tsan to ci
1 parent ebfa906 commit 7cee026

File tree

2 files changed

+10
-11
lines changed

2 files changed

+10
-11
lines changed

.github/workflows/linux.yml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,12 @@ jobs:
2222
- { compiler: gcc, version: 9, build_type: Release, cppstd: 17 }
2323
- { compiler: gcc, version: 11, build_type: Debug, cppstd: 20 }
2424
- { compiler: gcc, version: 12, build_type: Release, cppstd: 20 }
25-
- { compiler: clang, version: 12, build_type: Debug, cppstd: 17, asan: OFF }
26-
- { compiler: clang, version: 15, build_type: Release, cppstd: 20, asan: OFF }
25+
- { compiler: gcc, version: 12, build_type: Debug, cppstd: 20, asan: ON }
26+
- { compiler: clang, version: 12, build_type: Debug, cppstd: 17 }
27+
- { compiler: clang, version: 15, build_type: Release, cppstd: 20, tsan: ON }
2728
container:
2829
image: ${{ matrix.config.compiler == 'clang' && 'teeks99/clang-ubuntu' || matrix.config.compiler }}:${{ matrix.config.version }}
29-
name: "${{ matrix.config.compiler}} ${{ matrix.config.version }} (C++${{ matrix.config.cppstd }}, ${{ matrix.config.build_type }})"
30+
name: "${{ matrix.config.compiler}} ${{ matrix.config.version }} (C++${{ matrix.config.cppstd }} ${{ matrix.config.build_type }} ${{ matrix.config.asan == 'ON' && 'ASAN' || '' }}${{ matrix.config.tsan == 'ON' && 'TSAN' || '' }})"
3031
steps:
3132
- uses: actions/checkout@v4
3233
- name: Setup
@@ -40,10 +41,8 @@ jobs:
4041
- name: Setup Compiler
4142
if: matrix.config.compiler == 'clang'
4243
run: |
43-
if [[ "${{ matrix.config.version }}" -ge 4 ]]; then
44-
scripts/ci_setup_clang.sh "${{ matrix.config.version }}"
45-
echo "CXXFLAGS=-stdlib=libc++" >> $GITHUB_ENV
46-
fi
44+
scripts/ci_setup_clang.sh "${{ matrix.config.version }}"
45+
echo "CXXFLAGS=-stdlib=libc++" >> $GITHUB_ENV
4746
echo "CC=clang-${{ matrix.config.version }}" >> $GITHUB_ENV
4847
echo "CXX=clang++-${{ matrix.config.version }}" >> $GITHUB_ENV
4948
- name: Build
@@ -58,7 +57,8 @@ jobs:
5857
-DSPDLOG_BUILD_BENCH=OFF \
5958
-DSPDLOG_BUILD_TESTS=ON \
6059
-DSPDLOG_BUILD_TESTS_HO=OFF \
61-
-DSPDLOG_SANITIZE_ADDRESS=${{ matrix.config.asan || 'ON' }}
60+
-DSPDLOG_SANITIZE_ADDRESS=${{ matrix.config.asan || 'OFF' }} \
61+
-DSPDLOG_SANITIZE_THREAD=${{ matrix.config.tsan || 'OFF' }}
6262
make -j 4
6363
ctest -j 4 --output-on-failure
6464
@@ -85,4 +85,3 @@ jobs:
8585
-DSPDLOG_SANITIZE_ADDRESS=OFF
8686
make -j 4
8787
ctest -j 4 --output-on-failure
88-

cmake/utils.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ function(spdlog_enable_addr_sanitizer target_name)
5858
target_compile_options(${target_name} PRIVATE -fno-sanitize=signed-integer-overflow)
5959
target_compile_options(${target_name} PRIVATE -fno-sanitize-recover=all)
6060
target_compile_options(${target_name} PRIVATE -fno-omit-frame-pointer)
61-
target_link_libraries(${target_name} PRIVATE -fsanitize=address,undefined -fuse-ld=gold)
61+
target_link_libraries(${target_name} PRIVATE -fsanitize=address,undefined)
6262
endfunction()
6363

6464
# Enable thread sanitizer (gcc/clang only)
@@ -69,5 +69,5 @@ function(spdlog_enable_thread_sanitizer target_name)
6969
message(STATUS "Thread sanitizer enabled")
7070
target_compile_options(${target_name} PRIVATE -fsanitize=thread)
7171
target_compile_options(${target_name} PRIVATE -fno-omit-frame-pointer)
72-
target_link_libraries(${target_name} PRIVATE -fsanitize=thread -fuse-ld=gold)
72+
target_link_libraries(${target_name} PRIVATE -fsanitize=thread)
7373
endfunction()

0 commit comments

Comments
 (0)