authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2022-01-04 00:11:45-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2022-01-04 00:11:45-07:00
logb6d6152e6514dcb4e67750cbb22b90b38ebedf49
tree7582ae1282cd4ac631c099e40677c22c8bef1d26
parentff66a18555dc6c00bd928f48462c3fc44f86ab6c

link: avoid creating stage2 llvm module when using stage1


4 files changed, 13 insertions(+), 4 deletions(-)

src/link/Coff.zig+4-1
......@@ -409,7 +409,10 @@ pub fn createEmpty(gpa: Allocator, options: link.Options) !*Coff {
409409 },
410410 .ptr_width = ptr_width,
411411 };
412 if (build_options.have_llvm and options.use_llvm) {
412
413 const use_llvm = build_options.have_llvm and options.use_llvm;
414 const use_stage1 = build_options.is_stage1 and options.use_stage1;
415 if (use_llvm and !use_stage1) {
413416 self.llvm_object = try LlvmObject.create(gpa, options);
414417 }
415418 return self;
src/link/Elf.zig+3-1
......@@ -304,7 +304,9 @@ pub fn createEmpty(gpa: Allocator, options: link.Options) !*Elf {
304304 },
305305 .ptr_width = ptr_width,
306306 };
307 if (build_options.have_llvm and options.use_llvm) {
307 const use_llvm = build_options.have_llvm and options.use_llvm;
308 const use_stage1 = build_options.is_stage1 and options.use_stage1;
309 if (use_llvm and !use_stage1) {
308310 self.llvm_object = try LlvmObject.create(gpa, options);
309311 }
310312 return self;
src/link/MachO.zig+3-1
......@@ -396,7 +396,9 @@ pub fn createEmpty(gpa: Allocator, options: link.Options) !*MachO {
396396 .needs_prealloc = needs_prealloc,
397397 };
398398
399 if (build_options.have_llvm and options.use_llvm) {
399 const use_llvm = build_options.have_llvm and options.use_llvm;
400 const use_stage1 = build_options.is_stage1 and options.use_stage1;
401 if (use_llvm and !use_stage1) {
400402 self.llvm_object = try LlvmObject.create(gpa, options);
401403 }
402404
src/link/Wasm.zig+3-1
......@@ -145,7 +145,9 @@ pub fn createEmpty(gpa: Allocator, options: link.Options) !*Wasm {
145145 .allocator = gpa,
146146 },
147147 };
148 if (build_options.have_llvm and options.use_llvm) {
148 const use_llvm = build_options.have_llvm and options.use_llvm;
149 const use_stage1 = build_options.is_stage1 and options.use_stage1;
150 if (use_llvm and !use_stage1) {
149151 self.llvm_object = try LlvmObject.create(gpa, options);
150152 }
151153 return self;