[soong] Add memtag-stack sanitizer, switch to linker-generated notes.

This change depends on the following toolchain commit:
https://reviews.llvm.org/D118948

Bug: b/174878242
Test: sanitize_test.go
Test: fvp_mini with SANITIZE_TARGET=memtag_heap,memtag_stack

Change-Id: I52d2318c8e4e06d6da5b74c45226144b880f1577
This commit is contained in:
Evgenii Stepanov
2022-05-05 15:16:13 -07:00
committed by Florian Mayer
parent c4ee5535f1
commit 807573d135
2 changed files with 53 additions and 32 deletions

View File

@@ -344,19 +344,13 @@ func (t MemtagNoteType) str() string {
func checkHasMemtagNote(t *testing.T, m android.TestingModule, expected MemtagNoteType) {
t.Helper()
note_async := "note_memtag_heap_async"
note_sync := "note_memtag_heap_sync"
found := None
implicits := m.Rule("ld").Implicits
for _, lib := range implicits {
if strings.Contains(lib.Rel(), note_async) {
found = Async
break
} else if strings.Contains(lib.Rel(), note_sync) {
found = Sync
break
}
ldFlags := m.Rule("ld").Args["ldFlags"]
if strings.Contains(ldFlags, "-fsanitize-memtag-mode=async") {
found = Async
} else if strings.Contains(ldFlags, "-fsanitize-memtag-mode=sync") {
found = Sync
}
if found != expected {