Use -target-feature for MTE
Instead of setting -march, use clang's -target-feature functionality
to enable MTE. Some projects set -march which may conflict with MTE's
usage. Using -target-feature to enable MTE removes any clang command
line ordering issues.
History:
* Originally submitted as 94d296d3d75428daceb03a55c01d77b4538d10ad
* reverted in b77d695fa1a4a1691b00db2d5f59e8fc1ef368ab due to
bug 371029823
* Prematurely resubmitted as 0feac37f1f21b135889758c4b866bba5de457838
and then subsequently reverted in
159860c848a709cac23ec7d448c6dfa6bfd8781b as the fix for bug 371029823
had not yet landed.
Fixes the following compile failures on _fullmte builds:
vendor/google/services/LyricCameraHAL/src/lyric/api/algo/data_types/local_tone_mapping_data_v1.cc
vendor/google/services/LyricCameraHAL/src/lyric/api/algo/data_types/local_tone_mapping_data_v1.cc:209:34: error: always_inline function 'vpaddq_f16' requires target feature 'fullfp16', but would be inlined into function 'GridMeanNeon' that is compiled without support for 'fullfp16'
209 | vmulq_f16(norm, vpaddq_f16(vpaddq_f16(slope_bias[0], slope_bias[1]),
| ^
vendor/google/services/LyricCameraHAL/src/lyric/api/algo/data_types/local_tone_mapping_data_v1.cc:210:34: error: always_inline function 'vpaddq_f16' requires target feature 'fullfp16', but would be inlined into function 'GridMeanNeon' that is compiled without support for 'fullfp16'
210 | vpaddq_f16(slope_bias[2], slope_bias[3])));
Bug: 366222162
Test: compiles and boots
Change-Id: Ib7ef224dc38b07c69dbf1e474cc6d225c5ae220a
diff --git a/cc/sanitize.go b/cc/sanitize.go
index d8d8c7a..e7598e7 100644
--- a/cc/sanitize.go
+++ b/cc/sanitize.go
@@ -79,7 +79,7 @@
minimalRuntimeFlags = []string{"-fsanitize-minimal-runtime", "-fno-sanitize-trap=integer,undefined",
"-fno-sanitize-recover=integer,undefined"}
- memtagStackCommonFlags = []string{"-march=armv8-a+memtag"}
+ memtagStackCommonFlags = []string{"-Xclang -target-feature -Xclang +mte"}
memtagStackLlvmFlags = []string{"-dom-tree-reachability-max-bbs-to-explore=128"}
hostOnlySanitizeFlags = []string{"-fno-sanitize-recover=all"}