Merge "Revert^2 "cc_baremetal_defaults: Disable SVE"" into main
diff --git a/Android.bp b/Android.bp
index 6c40661..523f55c 100644
--- a/Android.bp
+++ b/Android.bp
@@ -147,6 +147,16 @@
 // 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"],
 }