From 70a1805e46b66955b52ba5ac46914f212d99d19c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20R=C3=B8nne=20Petersen?= Date: Fri, 23 Aug 2024 02:25:18 +0200 Subject: [PATCH] libunwind: Synchronize some CFLAGS/CXXFLAGS with upstream. --- src/libunwind.zig | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/libunwind.zig b/src/libunwind.zig index dd2ed39130..605206467c 100644 --- a/src/libunwind.zig +++ b/src/libunwind.zig @@ -100,14 +100,18 @@ pub fn buildStaticLib(comp: *Compilation, prog_node: std.Progress.Node) BuildErr switch (Compilation.classifyFileExt(unwind_src)) { .c => { - try cflags.append("-std=c11"); + try cflags.append("-std=c17"); }, .cpp => { - try cflags.appendSlice(&[_][]const u8{"-fno-rtti"}); + try cflags.appendSlice(&[_][]const u8{ + "-std=c++17", + "-fno-rtti", + }); }, .assembly_with_cpp => {}, else => unreachable, // You can see the entire list of files just above. } + try cflags.append("-fno-exceptions"); try cflags.append("-I"); try cflags.append(try comp.zig_lib_directory.join(arena, &[_][]const u8{ "libunwind", "include" })); if (target_util.supports_fpic(target)) { @@ -117,6 +121,7 @@ pub fn buildStaticLib(comp: *Compilation, prog_node: std.Progress.Node) BuildErr try cflags.append("-Wa,--noexecstack"); try cflags.append("-fvisibility=hidden"); try cflags.append("-fvisibility-inlines-hidden"); + try cflags.append("-fvisibility-global-new-delete=force-hidden"); // necessary so that libunwind can unwind through its own stack frames try cflags.append("-funwind-tables");