Merge "Disable LTO and CFI for riscv64"

This commit is contained in:
Colin Cross
2022-10-20 23:47:54 +00:00
committed by Gerrit Code Review
2 changed files with 11 additions and 0 deletions

View File

@@ -91,6 +91,11 @@ func (lto *lto) flags(ctx BaseModuleContext, flags Flags) Flags {
return flags return flags
} }
// LTO doesn't work on riscv64 yet.
if ctx.Arch().ArchType == android.Riscv64 {
return flags
}
if lto.LTO(ctx) { if lto.LTO(ctx) {
var ltoCFlag string var ltoCFlag string
var ltoLdFlag string var ltoLdFlag string

View File

@@ -511,6 +511,12 @@ func (sanitize *sanitize) begin(ctx BaseModuleContext) {
s.Integer_overflow = nil s.Integer_overflow = nil
} }
// CFI doesn't work for riscv64 yet because LTO doesn't work.
if ctx.Arch().ArchType == android.Riscv64 {
s.Cfi = nil
s.Diag.Cfi = nil
}
// Disable CFI for musl // Disable CFI for musl
if ctx.toolchain().Musl() { if ctx.toolchain().Musl() {
s.Cfi = nil s.Cfi = nil