authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2024-08-23 02:25:18+02:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2024-09-19 18:20:21-07:00
log70a1805e46b66955b52ba5ac46914f212d99d19c
treebe038c91e3c4e0ab07eb6d244d8bc791457f82f7
parent26ddfabba4611231fa486322b9ba11b1057a2053

libunwind: Synchronize some CFLAGS/CXXFLAGS with upstream.


1 files changed, 7 insertions(+), 2 deletions(-)

src/libunwind.zig+7-2
...@@ -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
100100
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 frames125 // necessary so that libunwind can unwind through its own stack frames
121 try cflags.append("-funwind-tables");126 try cflags.append("-funwind-tables");
122127