| ... | @@ -770,8 +770,8 @@ pub fn create(gpa: *Allocator, options: InitOptions) !*Compilation { | ... | @@ -770,8 +770,8 @@ pub fn create(gpa: *Allocator, options: InitOptions) !*Compilation { |
| 770 | .Lib => is_dyn_lib, | 770 | .Lib => is_dyn_lib, |
| 771 | .Exe => true, | 771 | .Exe => true, |
| 772 | }; | 772 | }; |
| 773 | const needs_c_symbols = !options.skip_linker_dependencies and | 773 | |
| 774 | (is_exe_or_dyn_lib or (options.target.isWasm() and options.output_mode != .Obj)); | 774 | const needs_c_symbols = !options.skip_linker_dependencies and is_exe_or_dyn_lib; |
| 775 | | 775 | |
| 776 | const comp: *Compilation = comp: { | 776 | const comp: *Compilation = comp: { |
| 777 | // For allocations that have the same lifetime as Compilation. This arena is used only during this | 777 | // For allocations that have the same lifetime as Compilation. This arena is used only during this |
| ... | @@ -1418,7 +1418,7 @@ pub fn create(gpa: *Allocator, options: InitOptions) !*Compilation { | ... | @@ -1418,7 +1418,7 @@ pub fn create(gpa: *Allocator, options: InitOptions) !*Compilation { |
| 1418 | }, | 1418 | }, |
| 1419 | }); | 1419 | }); |
| 1420 | } | 1420 | } |
| 1421 | if (comp.wantBuildWASILibcSysrootFromSource()) { | 1421 | if (comp.wantBuildWasiLibcSysrootFromSource()) { |
| 1422 | try comp.work_queue.write(&[_]Job{.{ .wasi_libc_sysroot = {} }}); | 1422 | try comp.work_queue.write(&[_]Job{.{ .wasi_libc_sysroot = {} }}); |
| 1423 | } | 1423 | } |
| 1424 | if (comp.wantBuildMinGWFromSource()) { | 1424 | if (comp.wantBuildMinGWFromSource()) { |
| ... | @@ -1462,7 +1462,7 @@ pub fn create(gpa: *Allocator, options: InitOptions) !*Compilation { | ... | @@ -1462,7 +1462,7 @@ pub fn create(gpa: *Allocator, options: InitOptions) !*Compilation { |
| 1462 | // Once it is capable this condition should be removed. | 1462 | // Once it is capable this condition should be removed. |
| 1463 | if (build_options.is_stage1) { | 1463 | if (build_options.is_stage1) { |
| 1464 | if (comp.bin_file.options.include_compiler_rt) { | 1464 | if (comp.bin_file.options.include_compiler_rt) { |
| 1465 | if (is_exe_or_dyn_lib or comp.getTarget().isWasm()) { | 1465 | if (is_exe_or_dyn_lib) { |
| 1466 | try comp.work_queue.writeItem(.{ .compiler_rt_lib = {} }); | 1466 | try comp.work_queue.writeItem(.{ .compiler_rt_lib = {} }); |
| 1467 | } else { | 1467 | } else { |
| 1468 | try comp.work_queue.writeItem(.{ .compiler_rt_obj = {} }); | 1468 | try comp.work_queue.writeItem(.{ .compiler_rt_obj = {} }); |
| ... | @@ -2147,7 +2147,7 @@ pub fn performAllTheWork(self: *Compilation) error{ TimerUnsupported, OutOfMemor | ... | @@ -2147,7 +2147,7 @@ pub fn performAllTheWork(self: *Compilation) error{ TimerUnsupported, OutOfMemor |
| 2147 | }; | 2147 | }; |
| 2148 | }, | 2148 | }, |
| 2149 | .wasi_libc_sysroot => { | 2149 | .wasi_libc_sysroot => { |
| 2150 | wasi_libc.buildWASILibcSysroot(self) catch |err| { | 2150 | wasi_libc.buildWasiLibcSysroot(self) catch |err| { |
| 2151 | // TODO Surface more error details. | 2151 | // TODO Surface more error details. |
| 2152 | try self.setMiscFailure( | 2152 | try self.setMiscFailure( |
| 2153 | .wasi_libc_sysroot, | 2153 | .wasi_libc_sysroot, |
| ... | @@ -3263,7 +3263,7 @@ pub fn get_libc_crt_file(comp: *Compilation, arena: *Allocator, basename: []cons | ... | @@ -3263,7 +3263,7 @@ pub fn get_libc_crt_file(comp: *Compilation, arena: *Allocator, basename: []cons |
| 3263 | if (comp.wantBuildGLibCFromSource() or | 3263 | if (comp.wantBuildGLibCFromSource() or |
| 3264 | comp.wantBuildMuslFromSource() or | 3264 | comp.wantBuildMuslFromSource() or |
| 3265 | comp.wantBuildMinGWFromSource() or | 3265 | comp.wantBuildMinGWFromSource() or |
| 3266 | comp.wantBuildWASILibcSysrootFromSource()) | 3266 | comp.wantBuildWasiLibcSysrootFromSource()) |
| 3267 | { | 3267 | { |
| 3268 | return comp.crt_files.get(basename).?.full_object_path; | 3268 | return comp.crt_files.get(basename).?.full_object_path; |
| 3269 | } | 3269 | } |
| ... | @@ -3303,7 +3303,7 @@ fn wantBuildMuslFromSource(comp: Compilation) bool { | ... | @@ -3303,7 +3303,7 @@ fn wantBuildMuslFromSource(comp: Compilation) bool { |
| 3303 | !comp.getTarget().isWasm(); | 3303 | !comp.getTarget().isWasm(); |
| 3304 | } | 3304 | } |
| 3305 | | 3305 | |
| 3306 | fn wantBuildWASILibcSysrootFromSource(comp: Compilation) bool { | 3306 | fn wantBuildWasiLibcSysrootFromSource(comp: Compilation) bool { |
| 3307 | return comp.wantBuildLibCFromSource() and comp.getTarget().isWasm(); | 3307 | return comp.wantBuildLibCFromSource() and comp.getTarget().isWasm(); |
| 3308 | } | 3308 | } |
| 3309 | | 3309 | |
| ... | @@ -3610,11 +3610,10 @@ fn buildOutputFromZig( | ... | @@ -3610,11 +3610,10 @@ fn buildOutputFromZig( |
| 3610 | }; | 3610 | }; |
| 3611 | const root_name = src_basename[0 .. src_basename.len - std.fs.path.extension(src_basename).len]; | 3611 | const root_name = src_basename[0 .. src_basename.len - std.fs.path.extension(src_basename).len]; |
| 3612 | const target = comp.getTarget(); | 3612 | const target = comp.getTarget(); |
| 3613 | const fixed_output_mode = if (target.cpu.arch.isWasm()) .Obj else output_mode; | | |
| 3614 | const bin_basename = try std.zig.binNameAlloc(comp.gpa, .{ | 3613 | const bin_basename = try std.zig.binNameAlloc(comp.gpa, .{ |
| 3615 | .root_name = root_name, | 3614 | .root_name = root_name, |
| 3616 | .target = target, | 3615 | .target = target, |
| 3617 | .output_mode = fixed_output_mode, | 3616 | .output_mode = output_mode, |
| 3618 | }); | 3617 | }); |
| 3619 | defer comp.gpa.free(bin_basename); | 3618 | defer comp.gpa.free(bin_basename); |
| 3620 | | 3619 | |
| ... | @@ -3629,7 +3628,7 @@ fn buildOutputFromZig( | ... | @@ -3629,7 +3628,7 @@ fn buildOutputFromZig( |
| 3629 | .target = target, | 3628 | .target = target, |
| 3630 | .root_name = root_name, | 3629 | .root_name = root_name, |
| 3631 | .root_pkg = &root_pkg, | 3630 | .root_pkg = &root_pkg, |
| 3632 | .output_mode = fixed_output_mode, | 3631 | .output_mode = output_mode, |
| 3633 | .thread_pool = comp.thread_pool, | 3632 | .thread_pool = comp.thread_pool, |
| 3634 | .libc_installation = comp.bin_file.options.libc_installation, | 3633 | .libc_installation = comp.bin_file.options.libc_installation, |
| 3635 | .emit_bin = emit_bin, | 3634 | .emit_bin = emit_bin, |