File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change 1
1
CI_DESC=" CI job running ThreadSanitizer"
2
2
CI_DIR=build-sanitize
3
- NIX_ARGS=(--arg enableLibcxx true --argstr libcxxSanitizers " Thread" )
3
+ NIX_ARGS=(--arg enableLibcxx true --argstr libcxxSanitizers " Thread" --argstr capnprotoSanitizers " thread " )
4
4
export CXX=clang++
5
5
export CXXFLAGS=" -ggdb -Werror -Wall -Wextra -Wpedantic -Wthread-safety -Wno-unused-parameter -fsanitize=thread"
6
6
CMAKE_ARGS=()
Original file line number Diff line number Diff line change 3
3
, enableLibcxx ? false # Whether to use libc++ toolchain and libraries instead of libstdc++
4
4
, minimal ? false # Whether to create minimal shell without extra tools (faster when cross compiling)
5
5
, capnprotoVersion ? null
6
+ , capnprotoSanitizers ? null # Optional sanitizers to build cap'n proto with
6
7
, cmakeVersion ? null
7
8
, libcxxSanitizers ? null # Optional LLVM_USE_SANITIZER value to use for libc++, see https://llvm.org/docs/CMake.html
8
9
} :
41
42
} // ( lib . optionalAttrs ( lib . versionOlder capnprotoVersion "0.10" ) {
42
43
env = { } ; # Drop -std=c++20 flag forced by nixpkgs
43
44
} ) ) ;
44
- capnproto = capnprotoBase . override ( lib . optionalAttrs enableLibcxx { clangStdenv = llvm . libcxxStdenv ; } ) ;
45
+ capnproto = ( capnprotoBase . overrideAttrs ( old : lib . optionalAttrs ( capnprotoSanitizers != null ) {
46
+ env = ( old . env or { } ) // {
47
+ CXXFLAGS =
48
+ lib . concatStringsSep " " [
49
+ ( old . env . CXXFLAGS or "" )
50
+ "-fsanitize=${ capnprotoSanitizers } "
51
+ "-fno-omit-frame-pointer"
52
+ "-g"
53
+ ] ;
54
+ } ;
55
+ } ) ) . override ( lib . optionalAttrs enableLibcxx { clangStdenv = llvm . libcxxStdenv ; } ) ;
45
56
clang = if enableLibcxx then llvm . libcxxClang else llvm . clang ;
46
57
clang-tools = llvm . clang-tools . override { inherit enableLibcxx ; } ;
47
58
cmakeHashes = {
You can’t perform that action at this time.
0 commit comments