From 44e1befd0b925cdd16e0b758796b5644d6426fdd Mon Sep 17 00:00:00 2001 From: Damian Jarek Date: Mon, 11 Mar 2019 00:17:54 +0100 Subject: [PATCH] Add on-no-recover option for sanitizers This option causes the program to exit after detecting the first sanitizer issue. Signed-off-by: Damian Jarek --- src/tools/features/sanitizers-feature.jam | 6 +++--- src/tools/gcc.jam | 6 ++++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/tools/features/sanitizers-feature.jam b/src/tools/features/sanitizers-feature.jam index 7a8563768..54fc6a2a0 100644 --- a/src/tools/features/sanitizers-feature.jam +++ b/src/tools/features/sanitizers-feature.jam @@ -8,13 +8,13 @@ import feature ; feature.feature address-sanitizer - : off on + : off on on-no-recover : propagated optional ; feature.feature undefined-sanitizer - : off on + : off on on-no-recover : propagated optional ; feature.feature thread-sanitizer - : off on + : off on on-no-recover : propagated optional ; diff --git a/src/tools/gcc.jam b/src/tools/gcc.jam index 92d5ed574..cc58f2314 100644 --- a/src/tools/gcc.jam +++ b/src/tools/gcc.jam @@ -731,6 +731,9 @@ 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-no-recover : -fsanitize=address -fno-sanitize-recover=address ; +toolset.flags gcc.compile.c++ OPTIONS on-no-recover : -fsanitize=undefined -fno-sanitize-recover=undefined ; +toolset.flags gcc.compile.c++ OPTIONS on-no-recover : -fsanitize=thread -fno-sanitize-recover=thread ; # configure Dinkum STL to match compiler options toolset.flags gcc.compile.c++ DEFINES off/vxworks : _NO_RTTI ; @@ -874,6 +877,9 @@ 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-no-recover : -fsanitize=address -fno-sanitize-recover=address ; +toolset.flags gcc.link OPTIONS on-no-recover : -fsanitize=undefined -fno-sanitize-recover=undefined ; +toolset.flags gcc.link OPTIONS on-no-recover : -fsanitize=thread -fno-sanitize-recover=thread ; toolset.flags gcc.link.dll .IMPLIB-COMMAND windows : "-Wl,--out-implib," ; toolset.flags gcc.link.dll .IMPLIB-COMMAND cygwin : "-Wl,--out-implib," ;