authorgravatar for arnaudchesse@outlook.comjohan0A <arnaudchesse@outlook.com> 2026-03-14 21:25:59+01:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2026-05-05 17:17:15+02:00
log6a37df00ece82f6c9c73b07a77c22c918fc3257c
tree06b9131cd9487d5a69f134a02309346acdd9c9ea
parent0add2dfc4131c69dbca6866d814eb5538468c0a0

Config.resolve: don't error on explicit dynamic linker for Lib/Obj outputs


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

src/Compilation/Config.zig+1-8
......@@ -123,7 +123,6 @@ pub const ResolveError = error{
123123 WasiExecModelRequiresWasi,
124124 SharedMemoryIsWasmOnly,
125125 ObjectFilesCannotShareMemory,
126 ObjectFilesCannotSpecifyDynamicLinker,
127126 SharedMemoryRequiresAtomicsAndBulkMemory,
128127 ThreadsRequireSharedMemory,
129128 EmittingLlvmModuleRequiresLlvmBackend,
......@@ -132,7 +131,6 @@ pub const ResolveError = error{
132131 EmittingBinaryRequiresLlvmLibrary,
133132 LldIncompatibleObjectFormat,
134133 LldCannotIncrementallyLink,
135 LldCannotSpecifyDynamicLinkerForSharedLibraries,
136134 LtoRequiresLld,
137135 SanitizeThreadRequiresLibCpp,
138136 LibCRequiresLibUnwind,
......@@ -421,12 +419,7 @@ pub fn resolve(options: Options) ResolveError!Config {
421419 // linking to any shared libraries.
422420 if (link_mode == .dynamic) return error.DynamicLinkingWithLldRequiresSharedLibraries;
423421 },
424 .Lib => if (use_lld and options.resolved_target.is_explicit_dynamic_linker) {
425 return error.LldCannotSpecifyDynamicLinkerForSharedLibraries;
426 },
427 .Obj => if (options.resolved_target.is_explicit_dynamic_linker) {
428 return error.ObjectFilesCannotSpecifyDynamicLinker;
429 },
422 .Lib, .Obj => {},
430423 }
431424
432425 const use_new_linker = b: {
src/main.zig-2
......@@ -4144,7 +4144,6 @@ fn createModule(
41444144 error.WasiExecModelRequiresWasi => fatal("only WASI OS targets support execution model", .{}),
41454145 error.SharedMemoryIsWasmOnly => fatal("only WebAssembly CPU targets support shared memory", .{}),
41464146 error.ObjectFilesCannotShareMemory => fatal("object files cannot share memory", .{}),
4147 error.ObjectFilesCannotSpecifyDynamicLinker => fatal("object files cannot specify --dynamic-linker", .{}),
41484147 error.SharedMemoryRequiresAtomicsAndBulkMemory => fatal("shared memory requires atomics and bulk_memory CPU features", .{}),
41494148 error.ThreadsRequireSharedMemory => fatal("threads require shared memory", .{}),
41504149 error.EmittingLlvmModuleRequiresLlvmBackend => fatal("emitting an LLVM module requires using the LLVM backend", .{}),
......@@ -4153,7 +4152,6 @@ fn createModule(
41534152 error.EmittingBinaryRequiresLlvmLibrary => fatal("producing machine code via LLVM requires using the LLVM library", .{}),
41544153 error.LldIncompatibleObjectFormat => fatal("using LLD to link {s} files is unsupported", .{@tagName(target.ofmt)}),
41554154 error.LldCannotIncrementallyLink => fatal("self-hosted backends do not support linking with LLD", .{}),
4156 error.LldCannotSpecifyDynamicLinkerForSharedLibraries => fatal("LLD does not support --dynamic-linker on shared libraries", .{}),
41574155 error.LtoRequiresLld => fatal("LTO requires using LLD", .{}),
41584156 error.SanitizeThreadRequiresLibCpp => fatal("thread sanitization is (for now) implemented in C++, so it requires linking libc++", .{}),
41594157 error.LibCRequiresLibUnwind => fatal("libc of the specified target requires linking libunwind", .{}),