| ... | @@ -4157,6 +4157,12 @@ pub fn stage1AddLinkLib(comp: *Compilation, lib_name: []const u8) !void { | ... | @@ -4157,6 +4157,12 @@ pub fn stage1AddLinkLib(comp: *Compilation, lib_name: []const u8) !void { |
| 4157 | if (comp.bin_file.options.skip_linker_dependencies) return; | 4157 | if (comp.bin_file.options.skip_linker_dependencies) return; |
| 4158 | | 4158 | |
| 4159 | // This happens when an `extern "foo"` function is referenced by the stage1 backend. | 4159 | // This happens when an `extern "foo"` function is referenced by the stage1 backend. |
| | 4160 | if (comp.getTarget().os.tag == .wasi and mem.eql(u8, "wasi_snapshot_preview1", lib_name)) { |
| | 4161 | // Any referenced symbol from this lib, will be undefined until |
| | 4162 | // runtime as this lib is provided directly by the runtime. |
| | 4163 | return; |
| | 4164 | } |
| | 4165 | |
| 4160 | // If we haven't seen this library yet and we're targeting Windows, we need to queue up | 4166 | // If we haven't seen this library yet and we're targeting Windows, we need to queue up |
| 4161 | // a work item to produce the DLL import library for this. | 4167 | // a work item to produce the DLL import library for this. |
| 4162 | const gop = try comp.bin_file.options.system_libs.getOrPut(comp.gpa, lib_name); | 4168 | const gop = try comp.bin_file.options.system_libs.getOrPut(comp.gpa, lib_name); |