-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Fix some libc version checks #24485
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix some libc version checks #24485
Conversation
Fix occurences of potentially errorneous libc version checks due to the differences between glibc and bionic version numbers. https://android.googlesource.com/platform/bionic/+/HEAD/docs/status.md was used as the main reference.
Co-authored-by: Alex Rønne Petersen <alex@alexrp.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM other than the style nit above.
@alexrp I was rechecking changes and this one doesn't seem correct: --- a/lib/std/posix.zig
+++ b/lib/std/posix.zig
@@ -610,8 +610,8 @@ pub fn getrandom(buffer: []u8) GetRandomError!void {
if (@TypeOf(system.getrandom) != void) {
var buf = buffer;
const use_c = native_os != .linux or
- (!builtin.abi.isAndroid() and std.c.versionCheck(std.SemanticVersion{ .major = 2, .minor = 25, .patch = 0 })) or
- (builtin.abi.isAndroid() and std.c.versionCheck(std.SemanticVersion{ .major = 28, .minor = 0, .patch = 0 }));
+ (builtin.abi.isAndroid() and std.c.versionCheck(.{ .major = 28, .minor = 0, .patch = 0 })) or
+ std.c.versionCheck(.{ .major = 2, .minor = 25, .patch = 0 });
while (buf.len != 0) {
const num_read: usize, const err = if (use_c) res: { If we are on android 24, Next commit will fix the check, but maybe you should disable auto-merge for now ? |
Head branch was pushed to by a user without write access
Oh, you're right of course, that was a silly suggestion. That |
Fix usages of
std.c.versionCheck
, where.linux
os tag should also be checked against android libc version.closes #24460