mirror of
https://github.com/bkaradzic/bx.git
synced 2026-10-22 08:41:00 +00:00
Added ASan/UBSan to CI, and fixed issues it found. (#445)
This commit is contained in:
committed by
GitHub
parent
9521d0b5e2
commit
09cf98d55c
@@ -171,6 +171,11 @@ function toolchain(_buildDir, _libDir)
|
||||
description = "Use AVX extension.",
|
||||
}
|
||||
|
||||
newoption {
|
||||
trigger = "with-sanitizers",
|
||||
description = "Build with address and undefined behavior sanitizers (gcc/clang).",
|
||||
}
|
||||
|
||||
-- Avoid error when invoking genie --help.
|
||||
if (_ACTION == nil) then return false end
|
||||
|
||||
@@ -516,6 +521,20 @@ function toolchain(_buildDir, _libDir)
|
||||
crtNone()
|
||||
end
|
||||
|
||||
if _OPTIONS["with-sanitizers"] then
|
||||
configuration { "linux-* or osx*" }
|
||||
buildoptions {
|
||||
"-fsanitize=address,undefined",
|
||||
"-fno-sanitize-recover=all",
|
||||
"-fno-omit-frame-pointer",
|
||||
}
|
||||
linkoptions {
|
||||
"-fsanitize=address,undefined",
|
||||
}
|
||||
|
||||
configuration {}
|
||||
end
|
||||
|
||||
flags {
|
||||
"NoPCH",
|
||||
"NativeWChar",
|
||||
|
||||
Reference in New Issue
Block a user