Use regex.replace in Jamfile to strip sanitizers from the command line.

As was pointed out in https://github.com/bfgroup/b2/issues/597,
the regex.replace rule is declared without colons separating arguments,
and if the rule is invoked accordingly b2 doesn't crash. So use
regex.replace to remove sanitizer flags from the compiler command line.
This commit is contained in:
Andrey Semashev
2026-06-05 02:57:26 +03:00
parent 3e94c81a6b
commit aec1b05e7d
+1 -4
View File
@@ -10,7 +10,6 @@
import project ;
import configure ;
import regex ;
import string ;
import-search /boost/config/checks ;
import config : requires ;
@@ -129,9 +128,7 @@ rule check-linkflag-no-undefined ( properties * )
if [ MATCH "^(<(compile|c|cxx|link)flags>.*-fsanitize=.+)$" : $(property) ]
{
# Note: avoid using regex.replace due to b2 bug: https://github.com/bfgroup/b2/issues/597
# property = [ regex.replace $(property) : "-fsanitize=[^\s]+\s*" : "" ] ;
property = [ string.join [ regex.transform $(property) : "^(.*)-fsanitize=[^\s]+\s*(.*)$" : 1 2 ] : "" ] ;
property = [ regex.replace $(property) "-fsanitize=[^\s]+\s*" "" ] ;
if [ MATCH "^(<(compile|c|cxx|link)flags>)\s*$" : $(property) ]
{
continue ;