| ... | @@ -1140,6 +1140,18 @@ pub fn flushModule(self: *Elf, comp: *Compilation, prog_node: *std.Progress.Node | ... | @@ -1140,6 +1140,18 @@ pub fn flushModule(self: *Elf, comp: *Compilation, prog_node: *std.Progress.Node |
| 1140 | | 1140 | |
| 1141 | var system_libs = std.ArrayList(SystemLib).init(arena); | 1141 | var system_libs = std.ArrayList(SystemLib).init(arena); |
| 1142 | | 1142 | |
| | 1143 | // libc++ dep |
| | 1144 | if (self.base.options.link_libcpp) { |
| | 1145 | try system_libs.ensureUnusedCapacity(2); |
| | 1146 | system_libs.appendAssumeCapacity(.{ .path = comp.libcxxabi_static_lib.?.full_object_path }); |
| | 1147 | system_libs.appendAssumeCapacity(.{ .path = comp.libcxx_static_lib.?.full_object_path }); |
| | 1148 | } |
| | 1149 | |
| | 1150 | // libunwind dep |
| | 1151 | if (self.base.options.link_libunwind) { |
| | 1152 | try system_libs.append(.{ .path = comp.libunwind_static_lib.?.full_object_path }); |
| | 1153 | } |
| | 1154 | |
| 1143 | // libc dep | 1155 | // libc dep |
| 1144 | self.error_flags.missing_libc = false; | 1156 | self.error_flags.missing_libc = false; |
| 1145 | if (self.base.options.link_libc) { | 1157 | if (self.base.options.link_libc) { |
| ... | @@ -1240,7 +1252,6 @@ pub fn flushModule(self: *Elf, comp: *Compilation, prog_node: *std.Progress.Node | ... | @@ -1240,7 +1252,6 @@ pub fn flushModule(self: *Elf, comp: *Compilation, prog_node: *std.Progress.Node |
| 1240 | self.files.set(index, .{ .linker_defined = .{ .index = index } }); | 1252 | self.files.set(index, .{ .linker_defined = .{ .index = index } }); |
| 1241 | self.linker_defined_index = index; | 1253 | self.linker_defined_index = index; |
| 1242 | } | 1254 | } |
| 1243 | try self.addLinkerDefinedSymbols(); | | |
| 1244 | | 1255 | |
| 1245 | // Now, we are ready to resolve the symbols across all input files. | 1256 | // Now, we are ready to resolve the symbols across all input files. |
| 1246 | // We will first resolve the files in the ZigModule, next in the parsed | 1257 | // We will first resolve the files in the ZigModule, next in the parsed |
| ... | @@ -1248,6 +1259,7 @@ pub fn flushModule(self: *Elf, comp: *Compilation, prog_node: *std.Progress.Node | ... | @@ -1248,6 +1259,7 @@ pub fn flushModule(self: *Elf, comp: *Compilation, prog_node: *std.Progress.Node |
| 1248 | // Any qualifing unresolved symbol will be upgraded to an absolute, weak | 1259 | // Any qualifing unresolved symbol will be upgraded to an absolute, weak |
| 1249 | // symbol for potential resolution at load-time. | 1260 | // symbol for potential resolution at load-time. |
| 1250 | self.resolveSymbols(); | 1261 | self.resolveSymbols(); |
| | 1262 | try self.addLinkerDefinedSymbols(); |
| 1251 | self.markEhFrameAtomsDead(); | 1263 | self.markEhFrameAtomsDead(); |
| 1252 | self.markImportsExports(); | 1264 | self.markImportsExports(); |
| 1253 | self.claimUnresolved(); | 1265 | self.claimUnresolved(); |