aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIsaac Freund <ifreund@ifreund.xyz>2021-05-10 23:12:17 +0200
committerIsaac Freund <ifreund@ifreund.xyz>2021-05-11 21:30:13 +0200
commit01e30002c52eda1ab3574f55c2e0568c56f2ed09 (patch)
tree9930c4da623ccb1f200f9eb5f446c9930b5c35d6
parent5ac91794cce8bd53916a378815be01e4365d53d9 (diff)
downloadzig-01e30002c52eda1ab3574f55c2e0568c56f2ed09.tar.gz
zig-01e30002c52eda1ab3574f55c2e0568c56f2ed09.zip
stage2: error if requested glibc version too high
Falling back to the max provided glibc version is insufficient as linking to shared objects compiled against the requested version will fail.
-rw-r--r--src/glibc.zig9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/glibc.zig b/src/glibc.zig
index 7600f19503..6b288ac46d 100644
--- a/src/glibc.zig
+++ b/src/glibc.zig
@@ -764,16 +764,17 @@ pub fn buildSharedObjects(comp: *Compilation) !void {
.lt => continue,
.gt => {
// TODO Expose via compile error mechanism instead of log.
- std.log.warn("invalid target glibc version: {}", .{target_version});
+ std.log.err("invalid target glibc version: {}", .{target_version});
return error.InvalidTargetGLibCVersion;
},
}
- } else blk: {
+ } else {
const latest_index = metadata.all_versions.len - 1;
- std.log.warn("zig cannot build new glibc version {}; providing instead {}", .{
+ // TODO Expose via compile error mechanism instead of log.
+ std.log.err("zig does not yet provide glibc version {}, the max provided version is {}", .{
target_version, metadata.all_versions[latest_index],
});
- break :blk latest_index;
+ return error.InvalidTargetGLibCVersion;
};
{
var map_contents = std.ArrayList(u8).init(arena);