authorgravatar for jacoblevgw@gmail.comJacob G-W <jacoblevgw@gmail.com> 2022-10-24 17:01:26-04:00
committergravatar for jacoblevgw@gmail.comJacob G-W <jacoblevgw@gmail.com> 2022-10-24 17:01:26-04:00
log5aef54cbc83cce5c1afe9aededfc505d89559741
treeaa3a60637123d531b5c7834e25019aa46aac82d5
parentc6fb798740119b78def920c649c03a644fa2380b

additional fixes for Plan9

with this, the tests should pass

4 files changed, 12 insertions(+), 5 deletions(-)

src/Compilation.zig+3-3
...@@ -1088,10 +1088,10 @@ pub fn create(gpa: Allocator, options: InitOptions) !*Compilation {...@@ -1088,10 +1088,10 @@ pub fn create(gpa: Allocator, options: InitOptions) !*Compilation {
1088 // Once they are capable this condition could be removed. When removing this condition,1088 // Once they are capable this condition could be removed. When removing this condition,
1089 // also test the use case of `build-obj -fcompiler-rt` with the native backends1089 // also test the use case of `build-obj -fcompiler-rt` with the native backends
1090 // and make sure the compiler-rt symbols are emitted.1090 // and make sure the compiler-rt symbols are emitted.
1091 const capable_of_building_compiler_rt = build_options.have_llvm;1091 const capable_of_building_compiler_rt = build_options.have_llvm and options.target.os.tag != .plan9;
10921092
1093 const capable_of_building_zig_libc = build_options.have_llvm;1093 const capable_of_building_zig_libc = build_options.have_llvm and options.target.os.tag != .plan9;
1094 const capable_of_building_ssp = build_options.have_llvm;1094 const capable_of_building_ssp = build_options.have_llvm and options.target.os.tag != .plan9;
10951095
1096 const comp: *Compilation = comp: {1096 const comp: *Compilation = comp: {
1097 // For allocations that have the same lifetime as Compilation. This arena is used only during this1097 // For allocations that have the same lifetime as Compilation. This arena is used only during this
src/link.zig+1-1
...@@ -581,7 +581,7 @@ pub const File = struct {...@@ -581,7 +581,7 @@ pub const File = struct {
581 .macho => return @fieldParentPtr(MachO, "base", base).updateDeclLineNumber(module, decl),581 .macho => return @fieldParentPtr(MachO, "base", base).updateDeclLineNumber(module, decl),
582 .c => return @fieldParentPtr(C, "base", base).updateDeclLineNumber(module, decl),582 .c => return @fieldParentPtr(C, "base", base).updateDeclLineNumber(module, decl),
583 .wasm => return @fieldParentPtr(Wasm, "base", base).updateDeclLineNumber(module, decl),583 .wasm => return @fieldParentPtr(Wasm, "base", base).updateDeclLineNumber(module, decl),
584 .plan9 => @panic("TODO: implement updateDeclLineNumber for plan9"),584 .plan9 => return @fieldParentPtr(Plan9, "base", base).updateDeclLineNumber(module, decl),
585 .spirv, .nvptx => {},585 .spirv, .nvptx => {},
586 }586 }
587 }587 }
src/link/Plan9.zig+7
...@@ -956,6 +956,13 @@ pub fn allocateDeclIndexes(self: *Plan9, decl_index: Module.Decl.Index) !void {...@@ -956,6 +956,13 @@ pub fn allocateDeclIndexes(self: *Plan9, decl_index: Module.Decl.Index) !void {
956 _ = self;956 _ = self;
957 _ = decl_index;957 _ = decl_index;
958}958}
959/// Must be called only after a successful call to `updateDecl`.
960pub fn updateDeclLineNumber(self: *Plan9, mod: *Module, decl: *const Module.Decl) !void {
961 _ = self;
962 _ = mod;
963 _ = decl;
964}
965
959pub fn getDeclVAddr(966pub fn getDeclVAddr(
960 self: *Plan9,967 self: *Plan9,
961 decl_index: Module.Decl.Index,968 decl_index: Module.Decl.Index,
test/cases/plan9/exit.zig+1-1
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1pub fn main() void {}1pub fn main() void {}
22
3// run3// run
4// target=x86_64-plan9,aarch64-plan94// target=x86_64-plan9
5//5//