aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--backend/ninja/Ninja.cpp13
-rw-r--r--src/CmakeModule.cpp4
2 files changed, 6 insertions, 11 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, ...)
diff --git a/src/CmakeModule.cpp b/src/CmakeModule.cpp
index 394acdb..348597d 100644
--- a/src/CmakeModule.cpp
+++ b/src/CmakeModule.cpp
@@ -151,8 +151,8 @@ namespace sibs
{
if(config.getSanitize())
{
- cmd += TINYDIR_STRING(" \"-CMAKE_C_FLAGS=-fno-omit-frame-pointer -fsanitize=address -fsanitize=undefined -lasan -lubsan\" "
- "\"-CMAKE_CXX_FLAGS=-fno-omit-frame-pointer -fsanitize=address -fsanitize=undefined -lasan -lubsan\"");
+ cmd += TINYDIR_STRING(" \"-CMAKE_C_FLAGS=-fno-omit-frame-pointer -fsanitize=address -fsanitize=undefined -fsanitize=leak -lasan -lubsan -llsan\" "
+ "\"-CMAKE_CXX_FLAGS=-fno-omit-frame-pointer -fsanitize=address -fsanitize=undefined -fsanitize=leak -lasan -lubsan -llsan\"");
}
}
switch(config.getPackageType())