| ... | ... | @@ -36,8 +36,7 @@ pub fn buildStaticLib(comp: *Compilation, prog_node: std.Progress.Node) BuildErr |
| 36 | 36 | .root_optimize_mode = comp.compilerRtOptMode(), |
| 37 | 37 | .root_strip = comp.compilerRtStrip(), |
| 38 | 38 | .link_libc = true, |
| 39 | | // Disable LTO to avoid https://github.com/llvm/llvm-project/issues/56825 |
| 40 | | .lto = .none, |
| 39 | .lto = comp.config.lto, |
| 41 | 40 | }) catch |err| { |
| 42 | 41 | comp.setMiscFailure( |
| 43 | 42 | .libunwind, |
| ... | ... | @@ -102,18 +101,18 @@ pub fn buildStaticLib(comp: *Compilation, prog_node: std.Progress.Node) BuildErr |
| 102 | 101 | |
| 103 | 102 | switch (Compilation.classifyFileExt(unwind_src)) { |
| 104 | 103 | .c => { |
| 105 | | try cflags.append("-std=c17"); |
| 104 | try cflags.appendSlice(&.{ |
| 105 | "-std=c99", |
| 106 | "-fexceptions", |
| 107 | }); |
| 106 | 108 | }, |
| 107 | 109 | .cpp => { |
| 108 | | try cflags.appendSlice(&[_][]const u8{ |
| 109 | | "-std=c++17", |
| 110 | | "-fno-rtti", |
| 111 | | }); |
| 110 | try cflags.append("-fno-exceptions"); |
| 111 | try cflags.append("-fno-rtti"); |
| 112 | 112 | }, |
| 113 | 113 | .assembly_with_cpp => {}, |
| 114 | | else => unreachable, // You can see the entire list of files just above. |
| 114 | else => unreachable, // See `unwind_src_list`. |
| 115 | 115 | } |
| 116 | | try cflags.append("-fno-exceptions"); |
| 117 | 116 | try cflags.append("-I"); |
| 118 | 117 | try cflags.append(try comp.zig_lib_directory.join(arena, &[_][]const u8{ "libunwind", "include" })); |
| 119 | 118 | try cflags.append("-D_LIBUNWIND_DISABLE_VISIBILITY_ANNOTATIONS"); |