aboutsummaryrefslogtreecommitdiff
path: root/src/libunwind.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2021-05-24 13:58:02 -0400
committerGitHub <noreply@github.com>2021-05-24 13:58:02 -0400
commit8c5d4295e5f6459ba99d219c1922a30ec6da24bf (patch)
tree7ce5d2a943c9cec38f508c0f34dfcb2e5e7d8e37 /src/libunwind.zig
parent8275c771c8f525b7f2917d1f4ade9b5e684d0a12 (diff)
parenta6e65f3a0ea4f8315be50f91338e4526b006f9d8 (diff)
downloadzig-8c5d4295e5f6459ba99d219c1922a30ec6da24bf.tar.gz
zig-8c5d4295e5f6459ba99d219c1922a30ec6da24bf.zip
Merge pull request #8876 from xxxbxxx/cxx-lto
build libc++ with lto and function-sections
Diffstat (limited to 'src/libunwind.zig')
-rw-r--r--src/libunwind.zig4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/libunwind.zig b/src/libunwind.zig
index c2d0475d6f..d918249544 100644
--- a/src/libunwind.zig
+++ b/src/libunwind.zig
@@ -69,6 +69,8 @@ pub fn buildStaticLib(comp: *Compilation) !void {
}
try cflags.append("-D_LIBUNWIND_DISABLE_VISIBILITY_ANNOTATIONS");
try cflags.append("-Wa,--noexecstack");
+ try cflags.append("-fvisibility=hidden");
+ try cflags.append("-fvisibility-inlines-hidden");
// This is intentionally always defined because the macro definition means, should it only
// build for the target specified by compiler defines. Since we pass -target the compiler
@@ -113,6 +115,8 @@ pub fn buildStaticLib(comp: *Compilation) !void {
.want_tsan = false,
.want_pic = comp.bin_file.options.pic,
.want_pie = comp.bin_file.options.pie,
+ .want_lto = comp.bin_file.options.lto,
+ .function_sections = comp.bin_file.options.function_sections,
.emit_h = null,
.strip = comp.compilerRtStrip(),
.is_native_os = comp.bin_file.options.is_native_os,