From 9f17722e80fa2a5876f3f26bbf2315aa969f5cd5 Mon Sep 17 00:00:00 2001 From: "James E. King III" Date: Mon, 10 Jun 2019 10:06:08 -0400 Subject: [PATCH] Add -fno-omit-frame-pointer to sanitizer options for gcc/glang (#450) --- src/tools/features/sanitizers-feature.jam | 6 ++-- src/tools/gcc.jam | 40 +++++++++++++---------- 2 files changed, 26 insertions(+), 20 deletions(-) diff --git a/src/tools/features/sanitizers-feature.jam b/src/tools/features/sanitizers-feature.jam index d57d6279f..a02265705 100644 --- a/src/tools/features/sanitizers-feature.jam +++ b/src/tools/features/sanitizers-feature.jam @@ -11,14 +11,14 @@ feature.feature address-sanitizer : on norecover : propagated optional ; -feature.feature undefined-sanitizer +feature.feature leak-sanitizer : on norecover : propagated optional ; feature.feature thread-sanitizer : on norecover : propagated optional ; -feature.feature leak-sanitizer + +feature.feature undefined-sanitizer : on norecover : propagated optional ; - diff --git a/src/tools/gcc.jam b/src/tools/gcc.jam index d60da1fc2..b9bb9cf2a 100644 --- a/src/tools/gcc.jam +++ b/src/tools/gcc.jam @@ -728,16 +728,19 @@ toolset.flags gcc.compile OPTIONS protected : -fvisibility=pro toolset.flags gcc.compile OPTIONS protected/darwin : ; toolset.flags gcc.compile OPTIONS global : -fvisibility=default ; -toolset.flags gcc.compile.c++ OPTIONS off : -fno-rtti ; 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 off : -fno-rtti ; + +# sanitizers +toolset.flags gcc.compile.c++ OPTIONS on : -fsanitize=address -fno-omit-frame-pointer ; +toolset.flags gcc.compile.c++ OPTIONS norecover : -fsanitize=address -fno-sanitize-recover=address -fno-omit-frame-pointer ; +toolset.flags gcc.compile.c++ OPTIONS on : -fsanitize=leak -fno-omit-frame-pointer ; +toolset.flags gcc.compile.c++ OPTIONS norecover : -fsanitize=leak -fno-sanitize-recover=leak -fno-omit-frame-pointer ; +toolset.flags gcc.compile.c++ OPTIONS on : -fsanitize=thread -fno-omit-frame-pointer ; +toolset.flags gcc.compile.c++ OPTIONS norecover : -fsanitize=thread -fno-sanitize-recover=thread -fno-omit-frame-pointer ; +toolset.flags gcc.compile.c++ OPTIONS on : -fsanitize=undefined -fno-omit-frame-pointer ; +toolset.flags gcc.compile.c++ OPTIONS norecover : -fsanitize=undefined -fno-sanitize-recover=undefined -fno-omit-frame-pointer ; + toolset.flags gcc.compile.c++ OPTIONS on : --coverage ; # configure Dinkum STL to match compiler options @@ -879,14 +882,17 @@ toolset.flags gcc.link OPTIONS hidden : -fvisibility=hidden -f toolset.flags gcc.link OPTIONS protected : -fvisibility=protected ; toolset.flags gcc.link OPTIONS protected/darwin : ; 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 ; + +# sanitizers +toolset.flags gcc.link OPTIONS on : -fsanitize=address -fno-omit-frame-pointer ; +toolset.flags gcc.link OPTIONS norecover : -fsanitize=address -fno-sanitize-recover=address -fno-omit-frame-pointer ; +toolset.flags gcc.link OPTIONS on : -fsanitize=leak -fno-omit-frame-pointer ; +toolset.flags gcc.link OPTIONS norecover : -fsanitize=leak -fno-sanitize-recover=leak -fno-omit-frame-pointer ; +toolset.flags gcc.link OPTIONS on : -fsanitize=thread -fno-omit-frame-pointer ; +toolset.flags gcc.link OPTIONS norecover : -fsanitize=thread -fno-sanitize-recover=thread -fno-omit-frame-pointer ; +toolset.flags gcc.link OPTIONS on : -fsanitize=undefined -fno-omit-frame-pointer ; +toolset.flags gcc.link OPTIONS norecover : -fsanitize=undefined -fno-sanitize-recover=undefined -fno-omit-frame-pointer ; + toolset.flags gcc.link OPTIONS on : --coverage ; toolset.flags gcc.link.dll .IMPLIB-COMMAND windows : "-Wl,--out-implib," ;