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

Remove dependency on libM::getrandom #686

Closed
tgraupmann opened this issue Dec 8, 2020 · 1 comment
Closed

Remove dependency on libM::getrandom #686

tgraupmann opened this issue Dec 8, 2020 · 1 comment

Comments

@tgraupmann
Copy link

tgraupmann commented Dec 8, 2020

Note: for general questions and comments, please use the forums at:
https://groups.google.com/forum/#!forum/json-c

Describe the bug
This JSON library has a dependency on getrandom from the math library libM which can't be statically linked. This is fine for compiling with gcc or clang. This is an issue for some LLVM pipelines (Google cough).

ret = getrandom(&r, sizeof(r), GRND_NONBLOCK);

You can use a random lookup table instead.

Steps To Reproduce
List the steps to reproduce the behavior.
If possible, please attach a sample json file and/or a minimal code example.
Try to compile a C static library linking libM.a. This isn't possible.

Version and Platform

  • json-c version: [e.g. json-c-0.14, or a specific commit hash]
  • OS: [e.g. Ubuntu 20.04, Debian Buster, NetBSD 9, etc...]
  • Custom cmake/build flags, if any
    Latest master branch has this issue.

OS: Ubuntu 20.04

@hawicz
Copy link
Member

hawicz commented Jul 1, 2023

If you have some environment where linking in getrandom is a problem, you can always arrange for HAVE_GETRANDOM to not be set, though I would expect the check_symbol_exists() call in CMakeLists.txt to already handle this.
I really have no interest in including an implementation of a random number generator in json-c, closing.

@hawicz hawicz closed this as completed Jul 1, 2023
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

No branches or pull requests

2 participants