authorgravatar for dev@vole.devvole-dev <dev@vole.dev> 2021-10-31 11:38:17-05:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2021-12-03 16:53:33-07:00
log9ede943e0753b250cb9a60a5b9b66ba9bff4a694
tree6b0f3a57925b35ee8d1a13d8ce5506585db55edd
parentff38f560402aa61ce8e4ae38b4fa0ff2ddbaede6

turn off LTO by default for RISCV even in Release mode


1 files changed, 6 insertions(+), 0 deletions(-)

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