Reapply "Enable CFI for riscv64"

This reverts commit 49dcf79550.

The previous init crash was caused by the kernel defaulting to Sv57 and
the CFI shadow implementation in bionic assuming a 48-bit virtual
address space. With 5-level paging disabled in cuttlefish, we can again
enable CFI.

Bug: 293884796
Link: https://github.com/google/android-riscv64/issues/45
Test: cuttlefish boots
Change-Id: Ibcc02cf7ca6e396fd58674c648abf9f84daa260e
This commit is contained in:
Sami Tolvanen
2023-09-18 12:20:07 -07:00
parent 8c04f3fd7a
commit ed78fc8553

View File

@@ -679,12 +679,6 @@ func (sanitize *sanitize) begin(ctx BaseModuleContext) {
s.Integer_overflow = nil
}
// TODO(b/254713216): 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
if ctx.toolchain().Musl() {
s.Cfi = nil