Browse Source

Add CI row to run clang sanitizers

Some of these are also supported by GCC, but clang supports more and clang on
Linux was uncovered before anyway, so this fixes that situation as well.
zrythm_meson
David Robillard 2 years ago
parent
commit
79d1142252
  1. 18
      .gitlab-ci.yml
  2. 6
      wscript

18
.gitlab-ci.yml

@ -115,6 +115,24 @@ test:x64_static: @@ -115,6 +115,24 @@ test:x64_static:
needs: ["x64_static"]
x64_sanitize:
<<: *build_definition
image: lv2plugin/debian-x64-clang
script: python ./waf configure build -ST --werror
variables:
CC: "clang"
CFLAGS: "-fsanitize=address -fsanitize=undefined -fsanitize=float-divide-by-zero -fsanitize=unsigned-integer-overflow -fsanitize=implicit-conversion -fsanitize=local-bounds -fsanitize=nullability"
CXX: "clang++"
CXXFLAGS: "-fsanitize=address -fsanitize=undefined -fsanitize=float-divide-by-zero -fsanitize=unsigned-integer-overflow -fsanitize=implicit-conversion -fsanitize=local-bounds -fsanitize=nullability"
LINKFLAGS: "-fsanitize=address -fsanitize=undefined -fsanitize=float-divide-by-zero -fsanitize=unsigned-integer-overflow -fsanitize=implicit-conversion -fsanitize=local-bounds -fsanitize=nullability"
test:x64_sanitize:
<<: *test_definition
image: lv2plugin/debian-x64-clang
script: python ./waf test
needs: ["x64_sanitize"]
mingw32_dbg:
<<: *build_definition
image: lv2plugin/debian-mingw32

6
wscript

@ -55,6 +55,7 @@ def configure(conf): @@ -55,6 +55,7 @@ def configure(conf):
'clang': [
'-Wno-cast-align',
'-Wno-cast-qual',
'-Wno-conversion',
'-Wno-covered-switch-default',
'-Wno-disabled-macro-expansion',
'-Wno-double-promotion',
@ -101,6 +102,11 @@ def configure(conf): @@ -101,6 +102,11 @@ def configure(conf):
if 'mingw' in conf.env.CC[0]:
conf.env.append_value('CFLAGS', '-Wno-unused-macros')
if ('clang' in conf.env.CC[0] and (
'-fsanitize=address' in conf.env.CFLAGS or
'-fsanitize=undefined' in conf.env.CFLAGS)):
conf.env.LINKFLAGS.remove('-Wl,--no-undefined')
conf.env.update({
'BUILD_UTILS': not Options.options.no_utils,
'BUILD_SHARED': not Options.options.no_shared,

Loading…
Cancel
Save