| ... | ... | @@ -225,7 +225,10 @@ pub fn findNative(gpa: Allocator, io: Io, args: FindNativeOptions) FindError!Lib |
| 225 | 225 | try self.findNativeIncludeDirPosix(gpa, io, args); |
| 226 | 226 | switch (builtin.target.os.tag) { |
| 227 | 227 | .freebsd, .netbsd, .openbsd, .dragonfly => self.crt_dir = try gpa.dupe(u8, "/usr/lib"), |
| 228 | | .linux => try self.findNativeCrtDirPosix(gpa, io, args), |
| 228 | .linux => { |
| 229 | try self.findNativeCrtDirPosix(gpa, io, args); |
| 230 | try self.findNativeGccDirPosix(gpa, io, args); |
| 231 | }, |
| 229 | 232 | else => {}, |
| 230 | 233 | } |
| 231 | 234 | } else { |
| ... | ... | @@ -760,26 +763,36 @@ pub const CrtBasenames = struct { |
| 760 | 763 | .linux => switch (mode) { |
| 761 | 764 | .dynamic_lib => .{ |
| 762 | 765 | .crti = "crti.o", |
| 766 | .crtbegin = "crtbeginS.o", |
| 767 | .crtend = "crtendS.o", |
| 763 | 768 | .crtn = "crtn.o", |
| 764 | 769 | }, |
| 765 | 770 | .dynamic_exe => .{ |
| 766 | 771 | .crt0 = "crt1.o", |
| 767 | 772 | .crti = "crti.o", |
| 773 | .crtbegin = "crtbegin.o", |
| 774 | .crtend = "crtend.o", |
| 768 | 775 | .crtn = "crtn.o", |
| 769 | 776 | }, |
| 770 | 777 | .dynamic_pie => .{ |
| 771 | 778 | .crt0 = "Scrt1.o", |
| 772 | 779 | .crti = "crti.o", |
| 780 | .crtbegin = "crtbeginS.o", |
| 781 | .crtend = "crtendS.o", |
| 773 | 782 | .crtn = "crtn.o", |
| 774 | 783 | }, |
| 775 | 784 | .static_exe => .{ |
| 776 | 785 | .crt0 = "crt1.o", |
| 777 | 786 | .crti = "crti.o", |
| 787 | .crtbegin = "crtbegin.o", |
| 788 | .crtend = "crtend.o", |
| 778 | 789 | .crtn = "crtn.o", |
| 779 | 790 | }, |
| 780 | 791 | .static_pie => .{ |
| 781 | 792 | .crt0 = "rcrt1.o", |
| 782 | 793 | .crti = "crti.o", |
| 794 | .crtbegin = "crtbeginS.o", |
| 795 | .crtend = "crtendS.o", |
| 783 | 796 | .crtn = "crtn.o", |
| 784 | 797 | }, |
| 785 | 798 | }, |
| ... | ... | @@ -994,6 +1007,7 @@ pub fn resolveCrtPaths( |
| 994 | 1007 | .root_dir = Cache.Directory.cwd(), |
| 995 | 1008 | .sub_path = lci.crt_dir orelse return error.LibCInstallationMissingCrtDir, |
| 996 | 1009 | }; |
| 1010 | |
| 997 | 1011 | switch (target.os.tag) { |
| 998 | 1012 | .dragonfly => { |
| 999 | 1013 | const gccv: []const u8 = if (target.os.version_range.semver.isAtLeast(.{ |
| ... | ... | @@ -1015,7 +1029,7 @@ pub fn resolveCrtPaths( |
| 1015 | 1029 | .crtn = if (crt_basenames.crtn) |basename| try crt_dir_path.join(arena, basename) else null, |
| 1016 | 1030 | }; |
| 1017 | 1031 | }, |
| 1018 | | .haiku, .serenity => { |
| 1032 | .haiku, .serenity, .linux => { |
| 1019 | 1033 | const gcc_dir_path: Path = .{ |
| 1020 | 1034 | .root_dir = Cache.Directory.cwd(), |
| 1021 | 1035 | .sub_path = lci.gcc_dir orelse return error.LibCInstallationMissingCrtDir, |