Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 12d548a0 authored by Pierre-Clément Tosi's avatar Pierre-Clément Tosi
Browse files

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
parent d3bd6b48
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -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"],
}