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