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 {...@@ -1157,8 +1157,14 @@ pub const LibExeObjStep = struct {
11571157
1158 valgrind_support: ?bool = null,1158 valgrind_support: ?bool = null,
11591159
1160 /// Create a .eh_frame_hdr section and a PT_GNU_EH_FRAME segment in the ELF
1161 /// file.
1160 link_eh_frame_hdr: bool = false,1162 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
1162 /// Uses system Wine installation to run cross compiled Windows build artifacts.1168 /// Uses system Wine installation to run cross compiled Windows build artifacts.
1163 enable_wine: bool = false,1169 enable_wine: bool = false,
11641170
...@@ -1884,7 +1890,9 @@ pub const LibExeObjStep = struct {...@@ -1884,7 +1890,9 @@ pub const LibExeObjStep = struct {
1884 if (self.link_eh_frame_hdr) {1890 if (self.link_eh_frame_hdr) {
1885 try zig_args.append("--eh-frame-hdr");1891 try zig_args.append("--eh-frame-hdr");
1886 }1892 }
18871893 if (self.link_function_sections) {
1894 try zig_args.append("-ffunction-sections");
1895 }
1888 if (self.single_threaded) {1896 if (self.single_threaded) {
1889 try zig_args.append("--single-threaded");1897 try zig_args.append("--single-threaded");
1890 }1898 }