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

Commit ecf4e664 authored by Colin Cross's avatar Colin Cross
Browse files

Disable LTO and CFI for riscv64

Building with LTO and CFI enabled for riscv64 causes link failures:
ld.lld: error: lto.tmp: cannot link object files with different floating-point ABI
ld.lld: error: undefined symbol: guard variable for android::hardware::BufferedTextOutput::getBuffer() const::ts

Disable them for now.

Test: lunch aosp_riscv64-userdebug && m ALLOW_MISSING_DEPENDENCIES=true ndk_sysroot
Change-Id: I3489952abebeeb3f4de664fd3e436232aac298d7
parent 17b87958
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -91,6 +91,11 @@ func (lto *lto) flags(ctx BaseModuleContext, flags Flags) Flags {
		return flags
	}

	// LTO doesn't work on riscv64 yet.
	if ctx.Arch().ArchType == android.Riscv64 {
		return flags
	}

	if lto.LTO(ctx) {
		var ltoCFlag string
		var ltoLdFlag string
+6 −0
Original line number Diff line number Diff line
@@ -511,6 +511,12 @@ func (sanitize *sanitize) begin(ctx BaseModuleContext) {
		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
	if ctx.toolchain().Musl() {
		s.Cfi = nil