| ... | ... | @@ -363,18 +363,30 @@ pub fn openPath(allocator: *Allocator, sub_path: []const u8, options: link.Optio |
| 363 | 363 | self.base.file = file; |
| 364 | 364 | |
| 365 | 365 | // Create dSYM bundle. |
| 366 | | const d_sym_path = try fmt.allocPrint(allocator, "{s}.dSYM/Contents/Resources/DWARF/", .{sub_path}); |
| 367 | | defer allocator.free(d_sym_path); |
| 368 | | var d_sym_bundle = try options.emit.?.directory.handle.makeOpenPath(d_sym_path, .{}); |
| 369 | | defer d_sym_bundle.close(); |
| 370 | | const d_sym_file = try d_sym_bundle.createFile(sub_path, .{ |
| 371 | | .truncate = false, |
| 372 | | .read = true, |
| 373 | | }); |
| 374 | | self.d_sym = .{ |
| 375 | | .base = self, |
| 376 | | .file = d_sym_file, |
| 377 | | }; |
| 366 | if (!options.strip and options.module != null) { |
| 367 | const dir = options.module.?.zig_cache_artifact_directory; |
| 368 | log.debug("creating {s}.dSYM bundle in {s}", .{ sub_path, dir.path }); |
| 369 | |
| 370 | const d_sym_path = try fmt.allocPrint( |
| 371 | allocator, |
| 372 | "{s}.dSYM" ++ fs.path.sep_str ++ "Contents" ++ fs.path.sep_str ++ "Resources" ++ fs.path.sep_str ++ "DWARF", |
| 373 | .{sub_path}, |
| 374 | ); |
| 375 | defer allocator.free(d_sym_path); |
| 376 | |
| 377 | var d_sym_bundle = try dir.handle.makeOpenPath(d_sym_path, .{}); |
| 378 | defer d_sym_bundle.close(); |
| 379 | |
| 380 | const d_sym_file = try d_sym_bundle.createFile(sub_path, .{ |
| 381 | .truncate = false, |
| 382 | .read = true, |
| 383 | }); |
| 384 | |
| 385 | self.d_sym = .{ |
| 386 | .base = self, |
| 387 | .file = d_sym_file, |
| 388 | }; |
| 389 | } |
| 378 | 390 | |
| 379 | 391 | // Index 0 is always a null symbol. |
| 380 | 392 | try self.locals.append(allocator, .{ |