authorgravatar for thatlemon@gmail.comLemonBoy <thatlemon@gmail.com> 2020-03-16 09:54:11+01:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-03-16 13:06:50-04:00
log582991a5a818179881f7923c7e6cff10de50dfcf
treedcf0758dbf2ebadedb392af59d27740be2be56ae
parenta2432b6755c3f5c7f05ed219aefbf290aeb358cb

build: Expose function-sections switch


1 files changed, 9 insertions(+), 1 deletions(-)

lib/std/build.zig+9-1
......@@ -1157,8 +1157,14 @@ pub const LibExeObjStep = struct {
11571157
11581158 valgrind_support: ?bool = null,
11591159
1160 /// Create a .eh_frame_hdr section and a PT_GNU_EH_FRAME segment in the ELF
1161 /// file.
11601162 link_eh_frame_hdr: bool = false,
11611163
1164 /// Place every function in its own section so that unused ones may be
1165 /// safely garbage-collected during the linking phase.
1166 link_function_sections: bool = false,
1167
11621168 /// Uses system Wine installation to run cross compiled Windows build artifacts.
11631169 enable_wine: bool = false,
11641170
......@@ -1884,7 +1890,9 @@ pub const LibExeObjStep = struct {
18841890 if (self.link_eh_frame_hdr) {
18851891 try zig_args.append("--eh-frame-hdr");
18861892 }
1887
1893 if (self.link_function_sections) {
1894 try zig_args.append("-ffunction-sections");
1895 }
18881896 if (self.single_threaded) {
18891897 try zig_args.append("--single-threaded");
18901898 }