| ... | ... | @@ -992,6 +992,12 @@ pub fn create(gpa: Allocator, options: InitOptions) !*Compilation { |
| 992 | 992 | } else if (options.target.os.tag == .windows and link_libcpp) { |
| 993 | 993 | // https://github.com/ziglang/zig/issues/8531 |
| 994 | 994 | break :blk false; |
| 995 | } else if (options.target.cpu.arch.isRISCV()) { |
| 996 | // Clang and LLVM currently don't support RISC-V target-abi for LTO. |
| 997 | // Compiling with LTO may fail or produce undesired results. |
| 998 | // See https://reviews.llvm.org/D71387 |
| 999 | // See https://reviews.llvm.org/D102582 |
| 1000 | break :blk false; |
| 995 | 1001 | } else switch (options.output_mode) { |
| 996 | 1002 | .Lib, .Obj => break :blk false, |
| 997 | 1003 | .Exe => switch (options.optimize_mode) { |
| ... | ... | @@ -1780,8 +1786,8 @@ pub fn getTarget(self: Compilation) Target { |
| 1780 | 1786 | |
| 1781 | 1787 | /// Detect changes to source files, perform semantic analysis, and update the output files. |
| 1782 | 1788 | pub fn update(self: *Compilation) !void { |
| 1783 | | const t = trace(@src()); |
| 1784 | | defer t.end(); |
| 1789 | const tracy_trace = trace(@src()); |
| 1790 | defer tracy_trace.end(); |
| 1785 | 1791 | |
| 1786 | 1792 | self.clearMiscFailures(); |
| 1787 | 1793 | |
| ... | ... | @@ -2822,8 +2828,8 @@ pub fn cImport(comp: *Compilation, c_src: []const u8) !CImportResult { |
| 2822 | 2828 | if (!build_options.have_llvm) |
| 2823 | 2829 | return error.ZigCompilerNotBuiltWithLLVMExtensions; |
| 2824 | 2830 | |
| 2825 | | const t = trace(@src()); |
| 2826 | | defer t.end(); |
| 2831 | const tracy_trace = trace(@src()); |
| 2832 | defer tracy_trace.end(); |
| 2827 | 2833 | |
| 2828 | 2834 | const cimport_zig_basename = "cimport.zig"; |
| 2829 | 2835 | |
| ... | ... | @@ -3077,8 +3083,8 @@ fn updateCObject(comp: *Compilation, c_object: *CObject, c_obj_prog_node: *std.P |
| 3077 | 3083 | const self_exe_path = comp.self_exe_path orelse |
| 3078 | 3084 | return comp.failCObj(c_object, "clang compilation disabled", .{}); |
| 3079 | 3085 | |
| 3080 | | const t = trace(@src()); |
| 3081 | | defer t.end(); |
| 3086 | const tracy_trace = trace(@src()); |
| 3087 | defer tracy_trace.end(); |
| 3082 | 3088 | |
| 3083 | 3089 | log.debug("updating C object: {s}", .{c_object.src.src_path}); |
| 3084 | 3090 | |
| ... | ... | @@ -3590,6 +3596,11 @@ pub fn addCCArgs( |
| 3590 | 3596 | } |
| 3591 | 3597 | }, |
| 3592 | 3598 | } |
| 3599 | |
| 3600 | if (target_util.llvmMachineAbi(target)) |mabi| { |
| 3601 | try argv.append(try std.fmt.allocPrint(arena, "-mabi={s}", .{mabi})); |
| 3602 | } |
| 3603 | |
| 3593 | 3604 | if (out_dep_path) |p| { |
| 3594 | 3605 | try argv.appendSlice(&[_][]const u8{ "-MD", "-MV", "-MF", p }); |
| 3595 | 3606 | } |
| ... | ... | @@ -4036,8 +4047,8 @@ fn wantBuildLibUnwindFromSource(comp: *Compilation) bool { |
| 4036 | 4047 | } |
| 4037 | 4048 | |
| 4038 | 4049 | fn updateBuiltinZigFile(comp: *Compilation, mod: *Module) Allocator.Error!void { |
| 4039 | | const t = trace(@src()); |
| 4040 | | defer t.end(); |
| 4050 | const tracy_trace = trace(@src()); |
| 4051 | defer tracy_trace.end(); |
| 4041 | 4052 | |
| 4042 | 4053 | const source = try comp.generateBuiltinZigSource(comp.gpa); |
| 4043 | 4054 | defer comp.gpa.free(source); |
| ... | ... | @@ -4074,8 +4085,8 @@ pub fn dump_argv(argv: []const []const u8) void { |
| 4074 | 4085 | } |
| 4075 | 4086 | |
| 4076 | 4087 | pub fn generateBuiltinZigSource(comp: *Compilation, allocator: Allocator) Allocator.Error![]u8 { |
| 4077 | | const t = trace(@src()); |
| 4078 | | defer t.end(); |
| 4088 | const tracy_trace = trace(@src()); |
| 4089 | defer tracy_trace.end(); |
| 4079 | 4090 | |
| 4080 | 4091 | var buffer = std.ArrayList(u8).init(allocator); |
| 4081 | 4092 | defer buffer.deinit(); |
| ... | ... | @@ -4320,8 +4331,8 @@ fn buildOutputFromZig( |
| 4320 | 4331 | out: *?CRTFile, |
| 4321 | 4332 | misc_task_tag: MiscTask, |
| 4322 | 4333 | ) !void { |
| 4323 | | const t = trace(@src()); |
| 4324 | | defer t.end(); |
| 4334 | const tracy_trace = trace(@src()); |
| 4335 | defer tracy_trace.end(); |
| 4325 | 4336 | |
| 4326 | 4337 | std.debug.assert(output_mode != .Exe); |
| 4327 | 4338 | const special_sub = "std" ++ std.fs.path.sep_str ++ "special"; |
| ... | ... | @@ -4419,8 +4430,8 @@ fn buildOutputFromZig( |
| 4419 | 4430 | } |
| 4420 | 4431 | |
| 4421 | 4432 | fn updateStage1Module(comp: *Compilation, main_progress_node: *std.Progress.Node) !void { |
| 4422 | | const t = trace(@src()); |
| 4423 | | defer t.end(); |
| 4433 | const tracy_trace = trace(@src()); |
| 4434 | defer tracy_trace.end(); |
| 4424 | 4435 | |
| 4425 | 4436 | var arena_allocator = std.heap.ArenaAllocator.init(comp.gpa); |
| 4426 | 4437 | defer arena_allocator.deinit(); |
| ... | ... | @@ -4566,6 +4577,7 @@ fn updateStage1Module(comp: *Compilation, main_progress_node: *std.Progress.Node |
| 4566 | 4577 | .is_native_cpu = false, // Only true when bootstrapping the compiler. |
| 4567 | 4578 | .llvm_cpu_name = if (target.cpu.model.llvm_name) |s| s.ptr else null, |
| 4568 | 4579 | .llvm_cpu_features = comp.bin_file.options.llvm_cpu_features.?, |
| 4580 | .llvm_target_abi = if (target_util.llvmMachineAbi(target)) |s| s.ptr else null, |
| 4569 | 4581 | }; |
| 4570 | 4582 | |
| 4571 | 4583 | comp.stage1_cache_manifest = &man; |
| ... | ... | @@ -4773,8 +4785,8 @@ pub fn build_crt_file( |
| 4773 | 4785 | output_mode: std.builtin.OutputMode, |
| 4774 | 4786 | c_source_files: []const Compilation.CSourceFile, |
| 4775 | 4787 | ) !void { |
| 4776 | | const t = trace(@src()); |
| 4777 | | defer t.end(); |
| 4788 | const tracy_trace = trace(@src()); |
| 4789 | defer tracy_trace.end(); |
| 4778 | 4790 | |
| 4779 | 4791 | const target = comp.getTarget(); |
| 4780 | 4792 | const basename = try std.zig.binNameAlloc(comp.gpa, .{ |