Skip to content

Commit

Permalink
Fix clang flag issues
Browse files Browse the repository at this point in the history
By pass the -fsanitize=memtag-stack clang flag to avoid input processor
break Android build.

Test: Unit test and local build Android
Bug: b/371029823
Change-Id: I576e78cc88d1777c929e705eb321945e0e46ec1a
GitOrigin-RevId: 6b30764584f0f372fe0bd7a928d3f75c2eeccb36
  • Loading branch information
ywmei-brt1 authored and copybara-github committed Oct 7, 2024
1 parent 8f534bd commit 5067172
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions internal/pkg/inputprocessor/action/cppcompile/preprocessor.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand Down

0 comments on commit 5067172

Please sign in to comment.