authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2025-01-23 01:43:57+01:00
committergravatar for mlugg@mlugg.co.ukMatthew Lugg <mlugg@mlugg.co.uk> 2025-01-23 23:22:38+00:00
log41185d297ffcaf61776aa8e7610aea9d00fce3a4
tree7cff1564f7a71bb3d76d5f2cfa4158c2e339fa46
parentef4d7f01a5c26d8ed6fa8236d1b64e4091a51be3
signaturelock-open Commit is signed but in an unrecognized format.

Package.Module: Make create() fall back on options.global.root_optimize_mode.

As is done for root_strip and root_error_tracing.

2 files changed, 3 insertions(+), 1 deletions(-)

src/Compilation/Config.zig+2
...@@ -56,6 +56,7 @@ export_memory: bool,...@@ -56,6 +56,7 @@ export_memory: bool,
56shared_memory: bool,56shared_memory: bool,
57is_test: bool,57is_test: bool,
58debug_format: DebugFormat,58debug_format: DebugFormat,
59root_optimize_mode: std.builtin.OptimizeMode,
59root_strip: bool,60root_strip: bool,
60root_error_tracing: bool,61root_error_tracing: bool,
61dll_export_fns: bool,62dll_export_fns: bool,
...@@ -508,6 +509,7 @@ pub fn resolve(options: Options) ResolveError!Config {...@@ -508,6 +509,7 @@ pub fn resolve(options: Options) ResolveError!Config {
508 .use_lld = use_lld,509 .use_lld = use_lld,
509 .wasi_exec_model = wasi_exec_model,510 .wasi_exec_model = wasi_exec_model,
510 .debug_format = debug_format,511 .debug_format = debug_format,
512 .root_optimize_mode = root_optimize_mode,
511 .root_strip = root_strip,513 .root_strip = root_strip,
512 .dll_export_fns = dll_export_fns,514 .dll_export_fns = dll_export_fns,
513 .rdynamic = rdynamic,515 .rdynamic = rdynamic,
src/Package/Module.zig+1-1
...@@ -119,7 +119,7 @@ pub fn create(arena: Allocator, options: CreateOptions) !*Package.Module {...@@ -119,7 +119,7 @@ pub fn create(arena: Allocator, options: CreateOptions) !*Package.Module {
119 const target = resolved_target.result;119 const target = resolved_target.result;
120120
121 const optimize_mode = options.inherited.optimize_mode orelse121 const optimize_mode = options.inherited.optimize_mode orelse
122 if (options.parent) |p| p.optimize_mode else .Debug;122 if (options.parent) |p| p.optimize_mode else options.global.root_optimize_mode;
123123
124 const strip = b: {124 const strip = b: {
125 if (options.inherited.strip) |x| break :b x;125 if (options.inherited.strip) |x| break :b x;