| ... | @@ -1053,7 +1053,8 @@ pub const LibExeObjStep = struct { | ... | @@ -1053,7 +1053,8 @@ pub const LibExeObjStep = struct { |
| 1053 | installed_path: ?[]const u8, | 1053 | installed_path: ?[]const u8, |
| 1054 | install_step: ?*InstallArtifactStep, | 1054 | install_step: ?*InstallArtifactStep, |
| 1055 | | 1055 | |
| 1056 | libc_file: ?[]const u8, | 1056 | libc_file: ?[]const u8 = null, |
| | 1057 | target_glibc: ?Version = null, |
| 1057 | | 1058 | |
| 1058 | const LinkObject = union(enum) { | 1059 | const LinkObject = union(enum) { |
| 1059 | StaticPath: []const u8, | 1060 | StaticPath: []const u8, |
| ... | @@ -1148,7 +1149,6 @@ pub const LibExeObjStep = struct { | ... | @@ -1148,7 +1149,6 @@ pub const LibExeObjStep = struct { |
| 1148 | .single_threaded = false, | 1149 | .single_threaded = false, |
| 1149 | .installed_path = null, | 1150 | .installed_path = null, |
| 1150 | .install_step = null, | 1151 | .install_step = null, |
| 1151 | .libc_file = null, | | |
| 1152 | }; | 1152 | }; |
| 1153 | self.computeOutFileNames(); | 1153 | self.computeOutFileNames(); |
| 1154 | return self; | 1154 | return self; |
| ... | @@ -1220,6 +1220,14 @@ pub const LibExeObjStep = struct { | ... | @@ -1220,6 +1220,14 @@ pub const LibExeObjStep = struct { |
| 1220 | self.computeOutFileNames(); | 1220 | self.computeOutFileNames(); |
| 1221 | } | 1221 | } |
| 1222 | | 1222 | |
| | 1223 | pub fn setTargetGLibC(self: *LibExeObjStep, major: u32, minor: u32, patch: u32) void { |
| | 1224 | self.target_glibc = Version{ |
| | 1225 | .major = major, |
| | 1226 | .minor = minor, |
| | 1227 | .patch = patch, |
| | 1228 | }; |
| | 1229 | } |
| | 1230 | |
| 1223 | pub fn setOutputDir(self: *LibExeObjStep, dir: []const u8) void { | 1231 | pub fn setOutputDir(self: *LibExeObjStep, dir: []const u8) void { |
| 1224 | self.output_dir = self.builder.dupe(dir); | 1232 | self.output_dir = self.builder.dupe(dir); |
| 1225 | } | 1233 | } |
| ... | @@ -1581,6 +1589,11 @@ pub const LibExeObjStep = struct { | ... | @@ -1581,6 +1589,11 @@ pub const LibExeObjStep = struct { |
| 1581 | }, | 1589 | }, |
| 1582 | } | 1590 | } |
| 1583 | | 1591 | |
| | 1592 | if (self.target_glibc) |ver| { |
| | 1593 | try zig_args.append("-target-glibc"); |
| | 1594 | try zig_args.append(builder.fmt("{}.{}.{}", ver.major, ver.minor, ver.patch)); |
| | 1595 | } |
| | 1596 | |
| 1584 | if (self.linker_script) |linker_script| { | 1597 | if (self.linker_script) |linker_script| { |
| 1585 | zig_args.append("--linker-script") catch unreachable; | 1598 | zig_args.append("--linker-script") catch unreachable; |
| 1586 | zig_args.append(linker_script) catch unreachable; | 1599 | zig_args.append(linker_script) catch unreachable; |