build: Expose function-sections switch

This commit is contained in:
LemonBoy 2020-03-16 09:54:11 +01:00 committed by Andrew Kelley
parent a2432b6755
commit 582991a5a8

View File

@ -1157,8 +1157,14 @@ pub const LibExeObjStep = struct {
valgrind_support: ?bool = null,
/// Create a .eh_frame_hdr section and a PT_GNU_EH_FRAME segment in the ELF
/// file.
link_eh_frame_hdr: bool = false,
/// Place every function in its own section so that unused ones may be
/// safely garbage-collected during the linking phase.
link_function_sections: bool = false,
/// Uses system Wine installation to run cross compiled Windows build artifacts.
enable_wine: bool = false,
@ -1884,7 +1890,9 @@ pub const LibExeObjStep = struct {
if (self.link_eh_frame_hdr) {
try zig_args.append("--eh-frame-hdr");
}
if (self.link_function_sections) {
try zig_args.append("-ffunction-sections");
}
if (self.single_threaded) {
try zig_args.append("--single-threaded");
}