diff --git a/internal/pkg/inputprocessor/action/cppcompile/preprocessor.go b/internal/pkg/inputprocessor/action/cppcompile/preprocessor.go index 81fcf62e..2df77991 100644 --- a/internal/pkg/inputprocessor/action/cppcompile/preprocessor.go +++ b/internal/pkg/inputprocessor/action/cppcompile/preprocessor.go @@ -258,6 +258,9 @@ func (p *Preprocessor) BuildCommandLine(outputFlag string, outputFlagJoined bool args := []string{executablePath} for _, flag := range p.Flags.Flags { key, value := flag.Key, flag.Value + if key == "-fsanitize=" && value == "memtag-stack" { + continue + } if key == clangCompilerArgFlag { if _, present := toRemoveXclangFlags[value]; present { continue diff --git a/internal/pkg/inputprocessor/action/cppcompile/preprocessor_test.go b/internal/pkg/inputprocessor/action/cppcompile/preprocessor_test.go index 63a06b13..2819dac6 100644 --- a/internal/pkg/inputprocessor/action/cppcompile/preprocessor_test.go +++ b/internal/pkg/inputprocessor/action/cppcompile/preprocessor_test.go @@ -343,6 +343,7 @@ func TestComputeSpec_SysrootAndProfileSampleUseArgsConvertedToAbsolutePath(t *te {Key: "-isysroot", Value: "../c/d", Joined: true}, {Key: "--sysroot=", Value: fmt.Sprintf("%s/e/f", pwd), Joined: true}, {Key: "-fprofile-sample-use=", Value: "../c/d/abc.prof", Joined: true}, + {Key: "-fsanitize=", Value: "memtag-stack", Joined: true}, {Key: "-fsanitize-blacklist=", Value: fmt.Sprintf("%s/e/f/ignores.txt", pwd), Joined: true}, {Key: "-fsanitize-ignorelist=", Value: fmt.Sprintf("%s/e/f/ignores2.txt", pwd), Joined: true}, {Key: "-fprofile-list=", Value: fmt.Sprintf("%s/e/f/fun.list", pwd), Joined: true},