turn off LTO by default for RISCV even in Release mode

This commit is contained in:
vole-dev
2021-10-31 11:38:17 -05:00
committed by Andrew Kelley
parent ff38f56040
commit 9ede943e07

View File

@@ -993,6 +993,12 @@ pub fn create(gpa: Allocator, options: InitOptions) !*Compilation {
} else if (options.target.os.tag == .windows and link_libcpp) {
// https://github.com/ziglang/zig/issues/8531
break :blk false;
} else if (options.target.cpu.arch.isRISCV()) {
// Clang and LLVM currently don't support RISC-V target-abi for LTO.
// Compiling with LTO may fail or produce undesired results.
// See https://reviews.llvm.org/D71387
// See https://reviews.llvm.org/D102582
break :blk false;
} else switch (options.output_mode) {
.Lib, .Obj => break :blk false,
.Exe => switch (options.optimize_mode) {