aboutsummaryrefslogtreecommitdiff
path: root/backend
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2019-01-20 03:19:54 +0100
committerdec05eba <dec05eba@protonmail.com>2020-07-06 07:39:33 +0200
commitba6487d8c0c4500a773297153f1c56067ba8d31f (patch)
tree55d01e2d4c4526765b2d6833c7e22dd84fa7b3cd /backend
parentca0cb67cba09deb06cb1748786846ac7557e5c80 (diff)
Add leak sanitizer
Diffstat (limited to 'backend')
-rw-r--r--backend/ninja/Ninja.cpp13
1 files changed, 4 insertions, 9 deletions
diff --git a/backend/ninja/Ninja.cpp b/backend/ninja/Ninja.cpp
index bc0503a..3d4039f 100644
--- a/backend/ninja/Ninja.cpp
+++ b/backend/ninja/Ninja.cpp
@@ -394,7 +394,8 @@ namespace backend
{
return {
ninja::NinjaArg::createRaw("-fsanitize=address"),
- ninja::NinjaArg::createRaw("-fsanitize=undefined")
+ ninja::NinjaArg::createRaw("-fsanitize=undefined"),
+ ninja::NinjaArg::createRaw("-fsanitize=leak")
};
}
return {};
@@ -1340,10 +1341,7 @@ namespace backend
if(sanitize)
{
- buildExeArgs.insert(buildExeArgs.end(), {
- ninja::NinjaArg::createRaw("-lasan"),
- ninja::NinjaArg::createRaw("-lubsan")
- });
+ buildExeArgs.push_back(ninja::NinjaArg::createRaw("-lasan -lubsan -llsan"));
}
else if(config.getOptimizationLevel() == OPT_LEV_RELEASE)
{
@@ -1572,10 +1570,7 @@ namespace backend
if(sanitize)
{
- buildDynamicArgs.insert(buildDynamicArgs.end(), {
- ninja::NinjaArg::createRaw("-lasan"),
- ninja::NinjaArg::createRaw("-lubsan")
- });
+ buildDynamicArgs.push_back(ninja::NinjaArg::createRaw("-lasan -lubsan -llsan"));
}
// TODO: Add flag to disable -ldl and -lm (dlopen, dlclose, floor, max, ...)