Enable undefined behavior sanitizer in CI

This commit is contained in:
Rodrigo Arias 2024-07-29 13:09:41 +02:00
parent 9c82038561
commit 61d57901b1
3 changed files with 15 additions and 1 deletions

View File

@ -42,6 +42,13 @@ build:asan:
script:
- nix build -L --no-link .#ovniPackages.asan
build:ubsan:
stage: build
tags:
- nix
script:
- nix build -L --no-link .#ovniPackages.ubsan
build:nompi:
stage: build
tags:

View File

@ -67,7 +67,9 @@ set(CMAKE_C_FLAGS_ASAN "${CMAKE_C_FLAGS_DEBUG} \
-fno-omit-frame-pointer"
CACHE STRING "Flags used by the C compiler during AddressSanitizer builds." FORCE)
set(CMAKE_C_FLAGS_UBSAN "${CMAKE_C_FLAGS_DEBUG} -fsanitize=undefined"
set(CMAKE_C_FLAGS_UBSAN "${CMAKE_C_FLAGS_DEBUG} \
-fsanitize=undefined \
-fno-sanitize-recover=all"
CACHE STRING "Flags used by the C compiler during UndefinedBehaviorSanitizer builds." FORCE)
find_program(IWYU NAMES include-what-you-use iwyu)

View File

@ -136,6 +136,11 @@
'';
});
ubsan = rt.overrideAttrs (old: {
pname = "ovni-ubsan";
cmakeFlags = old.cmakeFlags ++ [ "-DCMAKE_BUILD_TYPE=Ubsan" ];
});
armv7 = (pkgs.pkgsCross.armv7l-hf-multiplatform.ovniLocal.overrideAttrs (old: {
pname = "ovni-armv7";
buildInputs = [];