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

Add stub for getentropy syscall #32

Open
wants to merge 1 commit into
base: devkitPro
Choose a base branch
from

Conversation

noxrim
Copy link

@noxrim noxrim commented Jan 8, 2025

Currently calling getentropy (and by extension arc4random) causes a link error because the reentrant version is not present in libc, with this change it should at least compile now

$ cat test.c
#include <unistd.h>

int main(void) {
    getentropy(NULL, 0);
}
$ /opt/devkitpro/devkitPPC/bin/powerpc-eabi-gcc test.c
/opt/devkitpro/devkitPPC/bin/../lib/gcc/powerpc-eabi/14.2.0/../../../../powerpc-eabi/bin/ld: warning: cannot find entry symbol _start; defaulting to 018000b8
/opt/devkitpro/devkitPPC/bin/../lib/gcc/powerpc-eabi/14.2.0/../../../../powerpc-eabi/bin/ld: /opt/devkitpro/devkitPPC/bin/../lib/gcc/powerpc-eabi/14.2.0/../../../../powerpc-eabi/lib/libc.a(libc_a-sysgetentropy.o): in function `getentropy':
(.text.getentropy+0x3c): undefined reference to `_getentropy_r'
collect2: error: ld returned 1 exit status

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant