-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Check for declaration of getentropy #14382
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
base: trunk
Are you sure you want to change the base?
Conversation
This helps on Termux running on versions of Android that have getentropy in libc, but targetting an API level before getentropy was added (as Termux clang does by default).
|
Oh, this needs configure regenerated, does CI do anything about that or does that need to be done in the PR branch? I suspect doing this under Termux may be suboptimal as it does not follow the FHS, but I could do it later on my computer. |
|
Oh, looking at HACKING.adoc, it seems I am meant to update configure in my changes, converted to draft until I get a chance to hop on my computer and do that. |
|
@SamB thank you for the PR!
Yeah, sorry for the burden. Basically what you need to do is to run
`autogen` and commit the configure file as updated by this script.
|
|
A question in addition to my previous comments:
Your code replaces the call to the `AC_CHECK_FUNC` macro by a call to `AC_CHECK_DECL`. My understanding is that, if one is not cross-compiling, then this change slightly weakens the test as it only checks whether the function's declaration exists, whereas `AC_CHECK_FUNC` was also doing a linking test.
I am wondering whether it wouldn't be possible and better to try and get best of both words: keeping the former test when not cross-compiling and falling back to your test when cross-compiling.
I realize this is not how things are done elsewhere for the moment, but I am still sharing the idea so that we can start from somewhere.
Cc the experts, @dra27, @MisterDA, @shym
|
|
I think you need both. |
|
There’s a number of things which are confusing me here. If configure wasn’t originally being regenerated, can I just double-check how this has been being tested? For the original Android part of the problem, what changes later in the build system to allow this to work? i.e. I’m not yet clear what the connection is between what is failing in the check here (which sounds like a missing CFLAGS entry?) but then why it’s the build doesn’t subsequently have the same problem? |
I don't think opam can cross-comile, and I assume people running opam in android (where opam can tell that it's running on Android) are using Termux.
This helps on Termux running on versions of Android that have getentropy in libc, but targetting an API level before getentropy was added (as Termux clang does by default).