diff options
author | 2024-10-02 15:59:29 +0100 | |
---|---|---|
committer | 2024-10-10 12:25:26 +0100 | |
commit | 12d548a07139fa812af84607cb931e611e0b046a (patch) | |
tree | 94ab8fdd7967d2efbc914a6931a37a8689e32665 /Android.bp | |
parent | d3bd6b4867829891200ec58d7e545b81e767dc4f (diff) |
cc_baremetal_defaults: Disable SVE
Prevent Clang from generating SVE instructions for compiler targets that
default to enabling the feature (such as ARMv9.2-A; see [1]) as the
baremetal environment might not have SVE available (either due to the HW
not supporting it or the SW not having enabled it).
[1]: https://reviews.llvm.org/D109517
Bug: 364383722
Test: lunch <...> # Set TARGET_ARCH_VARIANT=armv9-2a
Test: m pvmfw # Decompile & check for SVE instructions
Change-Id: Ic50d9dc45beb1d04d81e3accaf7fc4fc953ea703
Diffstat (limited to 'Android.bp')
-rw-r--r-- | Android.bp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Android.bp b/Android.bp index 34f9bf012..6db496361 100644 --- a/Android.bp +++ b/Android.bp @@ -147,6 +147,16 @@ all_apex_contributions { // Framework guests. cc_defaults { name: "cc_baremetal_defaults", + arch: { + arm64: { + cflags: [ + // Prevent the compiler from optimizing code using SVE, as the + // baremetal environment might not have configured the hardware. + "-Xclang -target-feature", + "-Xclang -sve", + ], + }, + }, defaults_visibility: ["//visibility:public"], } |