| ... | ... | @@ -100,14 +100,18 @@ pub fn buildStaticLib(comp: *Compilation, prog_node: std.Progress.Node) BuildErr |
| 100 | 100 | |
| 101 | 101 | switch (Compilation.classifyFileExt(unwind_src)) { |
| 102 | 102 | .c => { |
| 103 | | try cflags.append("-std=c11"); |
| 103 | try cflags.append("-std=c17"); |
| 104 | 104 | }, |
| 105 | 105 | .cpp => { |
| 106 | | try cflags.appendSlice(&[_][]const u8{"-fno-rtti"}); |
| 106 | try cflags.appendSlice(&[_][]const u8{ |
| 107 | "-std=c++17", |
| 108 | "-fno-rtti", |
| 109 | }); |
| 107 | 110 | }, |
| 108 | 111 | .assembly_with_cpp => {}, |
| 109 | 112 | else => unreachable, // You can see the entire list of files just above. |
| 110 | 113 | } |
| 114 | try cflags.append("-fno-exceptions"); |
| 111 | 115 | try cflags.append("-I"); |
| 112 | 116 | try cflags.append(try comp.zig_lib_directory.join(arena, &[_][]const u8{ "libunwind", "include" })); |
| 113 | 117 | if (target_util.supports_fpic(target)) { |
| ... | ... | @@ -117,6 +121,7 @@ pub fn buildStaticLib(comp: *Compilation, prog_node: std.Progress.Node) BuildErr |
| 117 | 121 | try cflags.append("-Wa,--noexecstack"); |
| 118 | 122 | try cflags.append("-fvisibility=hidden"); |
| 119 | 123 | try cflags.append("-fvisibility-inlines-hidden"); |
| 124 | try cflags.append("-fvisibility-global-new-delete=force-hidden"); |
| 120 | 125 | // necessary so that libunwind can unwind through its own stack frames |
| 121 | 126 | try cflags.append("-funwind-tables"); |
| 122 | 127 | |