From 16f49cac3374465f1d4310af3f0124a080fbe41c Mon Sep 17 00:00:00 2001 From: Damian Jarek Date: Mon, 6 May 2019 16:40:49 +0200 Subject: [PATCH] Add support for leak sanitizer: (#435) Can be enabled via the `leak-sanitizer` feature. Signed-off-by: Damian Jarek --- src/tools/features/sanitizers-feature.jam | 4 ++++ src/tools/gcc.jam | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/tools/features/sanitizers-feature.jam b/src/tools/features/sanitizers-feature.jam index 8c35d3368..d57d6279f 100644 --- a/src/tools/features/sanitizers-feature.jam +++ b/src/tools/features/sanitizers-feature.jam @@ -18,3 +18,7 @@ feature.feature undefined-sanitizer feature.feature thread-sanitizer : on norecover : propagated optional ; +feature.feature leak-sanitizer + : on norecover + : propagated optional ; + diff --git a/src/tools/gcc.jam b/src/tools/gcc.jam index ecc45c260..f4a36089c 100644 --- a/src/tools/gcc.jam +++ b/src/tools/gcc.jam @@ -733,9 +733,11 @@ toolset.flags gcc.compile.c++ OPTIONS off : -fno-exceptions toolset.flags gcc.compile.c++ OPTIONS on : -fsanitize=address ; toolset.flags gcc.compile.c++ OPTIONS on : -fsanitize=undefined ; toolset.flags gcc.compile.c++ OPTIONS on : -fsanitize=thread ; +toolset.flags gcc.compile.c++ OPTIONS on : -fsanitize=leak ; toolset.flags gcc.compile.c++ OPTIONS norecover : -fsanitize=address -fno-sanitize-recover=address ; toolset.flags gcc.compile.c++ OPTIONS norecover : -fsanitize=undefined -fno-sanitize-recover=undefined ; toolset.flags gcc.compile.c++ OPTIONS norecover : -fsanitize=thread -fno-sanitize-recover=thread ; +toolset.flags gcc.compile.c++ OPTIONS norecover : -fsanitize=leak -fno-sanitize-recover=leak ; toolset.flags gcc.compile.c++ OPTIONS all : --coverage ; toolset.flags gcc.compile.c++ OPTIONS profile : -fprofile-arcs ; toolset.flags gcc.compile.c++ OPTIONS test : -ftest-coverage ; @@ -882,9 +884,11 @@ toolset.flags gcc.link OPTIONS global : -fvisibility=default ; toolset.flags gcc.link OPTIONS on : -fsanitize=address ; toolset.flags gcc.link OPTIONS on : -fsanitize=undefined ; toolset.flags gcc.link OPTIONS on : -fsanitize=thread ; +toolset.flags gcc.link OPTIONS on : -fsanitize=leak ; toolset.flags gcc.link OPTIONS norecover : -fsanitize=address -fno-sanitize-recover=address ; toolset.flags gcc.link OPTIONS norecover : -fsanitize=undefined -fno-sanitize-recover=undefined ; toolset.flags gcc.link OPTIONS norecover : -fsanitize=thread -fno-sanitize-recover=thread ; +toolset.flags gcc.link OPTIONS norecover : -fsanitize=leak -fno-sanitize-recover=leak ; toolset.flags gcc.link OPTIONS all : --coverage ; toolset.flags gcc.link OPTIONS profile : -fprofile-arcs ; toolset.flags gcc.link OPTIONS test : -lgcov ;