aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorxavier <xavierb@gmail.com>2021-05-23 16:51:22 +0200
committerxavier <xavierb@gmail.com>2021-05-23 19:58:26 +0200
commit40d8518253c2566fe9ba947c2e1fbce160a55940 (patch)
tree087afc79a92efa93e703fafe7919c252cc23f500 /src
parentd321a4b765b94818c4a483a784bb6fc9048c64ba (diff)
downloadzig-40d8518253c2566fe9ba947c2e1fbce160a55940.tar.gz
zig-40d8518253c2566fe9ba947c2e1fbce160a55940.zip
apply -flto and -ffunction-sections when compiling libc++
Diffstat (limited to 'src')
-rw-r--r--src/libcxx.zig4
-rw-r--r--src/libunwind.zig2
2 files changed, 6 insertions, 0 deletions
diff --git a/src/libcxx.zig b/src/libcxx.zig
index e235403d40..39c5fabedd 100644
--- a/src/libcxx.zig
+++ b/src/libcxx.zig
@@ -174,6 +174,8 @@ pub fn buildLibCXX(comp: *Compilation) !void {
.want_tsan = comp.bin_file.options.tsan,
.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,
@@ -292,6 +294,8 @@ pub fn buildLibCXXABI(comp: *Compilation) !void {
.want_tsan = comp.bin_file.options.tsan,
.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,
diff --git a/src/libunwind.zig b/src/libunwind.zig
index c2d0475d6f..7e1fe3f9b7 100644
--- a/src/libunwind.zig
+++ b/src/libunwind.zig
@@ -113,6 +113,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,