| author | |
| committer | |
| log | 7266d4497e7879491c4394bb01e3057d75823cea |
| tree | 220b8d53a17ba590cc827d8c531d0be17e442240 |
| parent | 53a232e51d193ffc816347bda64921e869e6f32a |
| parent | 11e54a3559d6cfebd09c48e16b8315e13d7de337 |
| signature |
link: fix failing incremental test cases6 files changed, 12 insertions(+), 11 deletions(-)
src/dev.zig+3-1| ... | @@ -23,7 +23,7 @@ pub const Env = enum { | ... | @@ -23,7 +23,7 @@ pub const Env = enum { |
| 23 | sema, | 23 | sema, |
| 24 | 24 | ||
| 25 | /// - sema | 25 | /// - sema |
| 26 | /// - `zig build-* -fno-llvm -fno-lld -target x86_64-linux` | 26 | /// - `zig build-* -fincremental -fno-llvm -fno-lld -target x86_64-linux --listen=-` |
| 27 | @"x86_64-linux", | 27 | @"x86_64-linux", |
| 28 | 28 | ||
| 29 | /// - sema | 29 | /// - sema |
| ... | @@ -130,6 +130,8 @@ pub const Env = enum { | ... | @@ -130,6 +130,8 @@ pub const Env = enum { |
| 130 | else => Env.ast_gen.supports(feature), | 130 | else => Env.ast_gen.supports(feature), |
| 131 | }, | 131 | }, |
| 132 | .@"x86_64-linux" => switch (feature) { | 132 | .@"x86_64-linux" => switch (feature) { |
| 133 | .stdio_listen, | ||
| 134 | .incremental, | ||
| 133 | .x86_64_backend, | 135 | .x86_64_backend, |
| 134 | .elf_linker, | 136 | .elf_linker, |
| 135 | => true, | 137 | => true, |
src/link/Elf/ZigObject.zig+5-4| ... | @@ -1496,7 +1496,7 @@ pub fn updateFunc( | ... | @@ -1496,7 +1496,7 @@ pub fn updateFunc( |
| 1496 | }); | 1496 | }); |
| 1497 | defer gpa.free(name); | 1497 | defer gpa.free(name); |
| 1498 | const osec = if (self.text_index) |sect_sym_index| | 1498 | const osec = if (self.text_index) |sect_sym_index| |
| 1499 | self.atom(self.symbol(sect_sym_index).ref.index).?.output_section_index | 1499 | self.symbol(sect_sym_index).output_section_index |
| 1500 | else osec: { | 1500 | else osec: { |
| 1501 | const osec = try elf_file.addSection(.{ | 1501 | const osec = try elf_file.addSection(.{ |
| 1502 | .name = try elf_file.insertShString(".text"), | 1502 | .name = try elf_file.insertShString(".text"), |
| ... | @@ -1896,12 +1896,13 @@ pub fn deleteExport( | ... | @@ -1896,12 +1896,13 @@ pub fn deleteExport( |
| 1896 | } orelse return; | 1896 | } orelse return; |
| 1897 | const zcu = elf_file.base.comp.zcu.?; | 1897 | const zcu = elf_file.base.comp.zcu.?; |
| 1898 | const exp_name = name.toSlice(&zcu.intern_pool); | 1898 | const exp_name = name.toSlice(&zcu.intern_pool); |
| 1899 | const esym_index = metadata.@"export"(self, exp_name) orelse return; | 1899 | const sym_index = metadata.@"export"(self, exp_name) orelse return; |
| 1900 | log.debug("deleting export '{s}'", .{exp_name}); | 1900 | log.debug("deleting export '{s}'", .{exp_name}); |
| 1901 | const esym = &self.symtab.items(.elf_sym)[esym_index.*]; | 1901 | const esym_index = self.symbol(sym_index.*).esym_index; |
| 1902 | const esym = &self.symtab.items(.elf_sym)[esym_index]; | ||
| 1902 | _ = self.globals_lookup.remove(esym.st_name); | 1903 | _ = self.globals_lookup.remove(esym.st_name); |
| 1903 | esym.* = Elf.null_sym; | 1904 | esym.* = Elf.null_sym; |
| 1904 | self.symtab.items(.shndx)[esym_index.*] = elf.SHN_UNDEF; | 1905 | self.symtab.items(.shndx)[esym_index] = elf.SHN_UNDEF; |
| 1905 | } | 1906 | } |
| 1906 | 1907 | ||
| 1907 | pub fn getGlobalSymbol(self: *ZigObject, elf_file: *Elf, name: []const u8, lib_name: ?[]const u8) !u32 { | 1908 | pub fn getGlobalSymbol(self: *ZigObject, elf_file: *Elf, name: []const u8, lib_name: ?[]const u8) !u32 { |
test/incremental/add_decl+1-2| ... | @@ -1,5 +1,4 @@ | ... | @@ -1,5 +1,4 @@ |
| 1 | // Disabled on self-hosted due to linker crash | 1 | #target=x86_64-linux-selfhosted |
| 2 | // #target=x86_64-linux-selfhosted | ||
| 3 | #target=x86_64-linux-cbe | 2 | #target=x86_64-linux-cbe |
| 4 | #target=x86_64-windows-cbe | 3 | #target=x86_64-windows-cbe |
| 5 | #update=initial version | 4 | #update=initial version |
test/incremental/fix_astgen_failure+1-2| ... | @@ -1,5 +1,4 @@ | ... | @@ -1,5 +1,4 @@ |
| 1 | // Disabled on self-hosted due to linker crash | 1 | #target=x86_64-linux-selfhosted |
| 2 | // #target=x86_64-linux-selfhosted | ||
| 3 | #target=x86_64-linux-cbe | 2 | #target=x86_64-linux-cbe |
| 4 | #target=x86_64-windows-cbe | 3 | #target=x86_64-windows-cbe |
| 5 | #update=initial version with error | 4 | #update=initial version with error |
test/incremental/function_becomes_inline+1-1| ... | @@ -1,4 +1,4 @@ | ... | @@ -1,4 +1,4 @@ |
| 1 | //#target=x86_64-linux-selfhosted | 1 | #target=x86_64-linux-selfhosted |
| 2 | #target=x86_64-linux-cbe | 2 | #target=x86_64-linux-cbe |
| 3 | #target=x86_64-windows-cbe | 3 | #target=x86_64-windows-cbe |
| 4 | #update=non-inline version | 4 | #update=non-inline version |
test/incremental/recursive_function_becomes_non_recursive+1-1| ... | @@ -1,4 +1,4 @@ | ... | @@ -1,4 +1,4 @@ |
| 1 | //#target=x86_64-linux-selfhosted | 1 | #target=x86_64-linux-selfhosted |
| 2 | #target=x86_64-linux-cbe | 2 | #target=x86_64-linux-cbe |
| 3 | #target=x86_64-windows-cbe | 3 | #target=x86_64-windows-cbe |
| 4 | #update=initial version | 4 | #update=initial version |