Skip to content
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

std.c: getrandom() with android bionic #22123

Open
Iced-Sun opened this issue Dec 2, 2024 · 0 comments · May be fixed by #22143
Open

std.c: getrandom() with android bionic #22123

Iced-Sun opened this issue Dec 2, 2024 · 0 comments · May be fixed by #22143
Labels
bug Observed behavior contradicts documented or intended behavior

Comments

@Iced-Sun
Copy link

Iced-Sun commented Dec 2, 2024

Zig Version

0.14.0-dev.2319+1a99c99ee

Steps to Reproduce and Observed Behavior

When linking C with android api level<28, get 'undefined symbol: getrandom'.

Bionic C library supports 'getrandom' until api level 28 (https://android.googlesource.com/platform/bionic/+/HEAD/docs/status.md).

The testing target is

.{
    .cpu_arch = .aarch64,
    .cpu_features_add = aarch64_feature,
    .os_tag = .linux,
    .abi = .android,
    // monkey-patch std.c.getrandom with:
    // .linux => if (if (builtin.abi.isAndroid()) versionCheck(.{ .major = 28, .minor = 0, .patch = 0 }) else versionCheck(.{ .major = 2, .minor = 25, .patch = 0 })) private.getrandom else {},
    .android_api_level = 26,
}

Expected Behavior

getrandom works out of the box.

@Iced-Sun Iced-Sun added the bug Observed behavior contradicts documented or intended behavior label Dec 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Observed behavior contradicts documented or intended behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant