authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2025-07-16 14:26:23-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2025-07-17 08:26:24+02:00
log27212a3e6bfe3cf988a12ba83ae7fbce186d960c
tree4a26e2ab5120509fb2cdafd77dbc8bc4503e6943
parent5ef07302d7c22ae53594e34524bd02da4cc36f1b

LLD: don't default allow_shlib_undefined when cross compiling

prevents e.g. lld-link: warning: undefined symbol: SystemFunction036 from being only a warning

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

src/link/Lld.zig+1-2
...@@ -205,7 +205,6 @@ pub fn createEmpty(...@@ -205,7 +205,6 @@ pub fn createEmpty(
205 const target = &comp.root_mod.resolved_target.result;205 const target = &comp.root_mod.resolved_target.result;
206 const output_mode = comp.config.output_mode;206 const output_mode = comp.config.output_mode;
207 const optimize_mode = comp.root_mod.optimize_mode;207 const optimize_mode = comp.root_mod.optimize_mode;
208 const is_native_os = comp.root_mod.resolved_target.is_native_os;
209208
210 const obj_file_ext: []const u8 = switch (target.ofmt) {209 const obj_file_ext: []const u8 = switch (target.ofmt) {
211 .coff => "obj",210 .coff => "obj",
...@@ -234,7 +233,7 @@ pub fn createEmpty(...@@ -234,7 +233,7 @@ pub fn createEmpty(
234 .gc_sections = gc_sections,233 .gc_sections = gc_sections,
235 .print_gc_sections = options.print_gc_sections,234 .print_gc_sections = options.print_gc_sections,
236 .stack_size = stack_size,235 .stack_size = stack_size,
237 .allow_shlib_undefined = options.allow_shlib_undefined orelse !is_native_os,236 .allow_shlib_undefined = options.allow_shlib_undefined orelse false,
238 .file = null,237 .file = null,
239 .build_id = options.build_id,238 .build_id = options.build_id,
240 },239 },