| ... | @@ -724,26 +724,25 @@ fn getDeclOutputSection( | ... | @@ -724,26 +724,25 @@ fn getDeclOutputSection( |
| 724 | _ = self; | 724 | _ = self; |
| 725 | const mod = macho_file.base.comp.module.?; | 725 | const mod = macho_file.base.comp.module.?; |
| 726 | const any_non_single_threaded = macho_file.base.comp.config.any_non_single_threaded; | 726 | const any_non_single_threaded = macho_file.base.comp.config.any_non_single_threaded; |
| 727 | _ = any_non_single_threaded; | | |
| 728 | const sect_id: u8 = switch (decl.ty.zigTypeTag(mod)) { | 727 | const sect_id: u8 = switch (decl.ty.zigTypeTag(mod)) { |
| 729 | .Fn => macho_file.zig_text_sect_index.?, | 728 | .Fn => macho_file.zig_text_sect_index.?, |
| 730 | else => blk: { | 729 | else => blk: { |
| 731 | if (decl.getOwnedVariable(mod)) |variable| { | 730 | if (decl.getOwnedVariable(mod)) |variable| { |
| 732 | // if (variable.is_threadlocal and any_non_single_threaded) { | 731 | if (variable.is_threadlocal and any_non_single_threaded) { |
| 733 | // const is_all_zeroes = for (code) |byte| { | 732 | const is_all_zeroes = for (code) |byte| { |
| 734 | // if (byte != 0) break false; | 733 | if (byte != 0) break false; |
| 735 | // } else true; | 734 | } else true; |
| 736 | // if (is_all_zeroes) break :blk macho_file.getSectionByName("__DATA", "__thread_bss") orelse try macho_file.addSection( | 735 | if (is_all_zeroes) break :blk macho_file.getSectionByName("__DATA", "__thread_bss") orelse try macho_file.addSection( |
| 737 | // "__DATA", | 736 | "__DATA", |
| 738 | // "__thread_bss", | 737 | "__thread_bss", |
| 739 | // .{ .flags = macho.S_THREAD_LOCAL_ZEROFILL }, | 738 | .{ .flags = macho.S_THREAD_LOCAL_ZEROFILL }, |
| 740 | // ); | 739 | ); |
| 741 | // break :blk macho_file.getSectionByName("__DATA", "__thread_data") orelse try macho_file.addSection( | 740 | break :blk macho_file.getSectionByName("__DATA", "__thread_data") orelse try macho_file.addSection( |
| 742 | // "__DATA", | 741 | "__DATA", |
| 743 | // "__thread_data", | 742 | "__thread_data", |
| 744 | // .{ .flags = macho.S_THREAD_LOCAL_REGULAR }, | 743 | .{ .flags = macho.S_THREAD_LOCAL_REGULAR }, |
| 745 | // ); | 744 | ); |
| 746 | // } | 745 | } |
| 747 | | 746 | |
| 748 | if (variable.is_const) break :blk macho_file.zig_const_sect_index.?; | 747 | if (variable.is_const) break :blk macho_file.zig_const_sect_index.?; |
| 749 | if (Value.fromInterned(variable.init).isUndefDeep(mod)) { | 748 | if (Value.fromInterned(variable.init).isUndefDeep(mod)) { |
| ... | @@ -1112,17 +1111,15 @@ pub fn getOrCreateMetadataForDecl( | ... | @@ -1112,17 +1111,15 @@ pub fn getOrCreateMetadataForDecl( |
| 1112 | const gop = try self.decls.getOrPut(gpa, decl_index); | 1111 | const gop = try self.decls.getOrPut(gpa, decl_index); |
| 1113 | if (!gop.found_existing) { | 1112 | if (!gop.found_existing) { |
| 1114 | const any_non_single_threaded = macho_file.base.comp.config.any_non_single_threaded; | 1113 | const any_non_single_threaded = macho_file.base.comp.config.any_non_single_threaded; |
| 1115 | _ = any_non_single_threaded; | | |
| 1116 | const sym_index = try self.addAtom(macho_file); | 1114 | const sym_index = try self.addAtom(macho_file); |
| 1117 | const mod = macho_file.base.comp.module.?; | 1115 | const mod = macho_file.base.comp.module.?; |
| 1118 | const decl = mod.declPtr(decl_index); | 1116 | const decl = mod.declPtr(decl_index); |
| 1119 | _ = decl; | | |
| 1120 | const sym = macho_file.getSymbol(sym_index); | 1117 | const sym = macho_file.getSymbol(sym_index); |
| 1121 | // if (decl.getOwnedVariable(mod)) |variable| { | 1118 | if (decl.getOwnedVariable(mod)) |variable| { |
| 1122 | // if (variable.is_threadlocal and any_non_single_threaded) { | 1119 | if (variable.is_threadlocal and any_non_single_threaded) { |
| 1123 | // sym.flags.tlv = true; | 1120 | sym.flags.tlv = true; |
| 1124 | // } | 1121 | } |
| 1125 | // } | 1122 | } |
| 1126 | if (!sym.flags.tlv) { | 1123 | if (!sym.flags.tlv) { |
| 1127 | sym.flags.needs_zig_got = true; | 1124 | sym.flags.needs_zig_got = true; |
| 1128 | } | 1125 | } |