Searching for arc4random in Emscripten codebase gives:
Searching 7677 files for "arc4random"
c:\code\emsdk\emscripten\incoming\src\deps_info.json:
2: "arc4random": ["rand"],
c:\code\emsdk\emscripten\incoming\src\library.js:
796: // For compatibility, call to rand() when code requests
arc4random(), although this is *not* at all
797: // as strong as rc4 is. See
https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man3/arc4random.3.html
798: arc4random: 'rand',
c:\code\emsdk\emscripten\incoming\system\include\libcxx\__config:
215: // Certain architectures provide arc4random(). Prefer using
216: // arc4random() over /dev/{u,}random to make it possible to obtain
c:\code\emsdk\emscripten\incoming\system\lib\libcxx\random.cpp:
53: return arc4random();
c:\code\emsdk\emscripten\incoming\tests\test_other.py:
7205: def test_arc4random(self):
7211: printf("%d\n", arc4random());
7212: printf("%d\n", arc4random());
10 matches across 5 files
so it looks like we do have some support for that, by routing to
calling rand() directly. You can try if deleting line 798 "arc4random:
'rand'," in src/library.js will make expat configure not find
arc4random, and try a proper fallback foute.
Note in particular that there does not exist a declaration of this
function in any Emscripten headers. That is, Emscripten implements the
function in src/library.js, but does not declare it in headers. Trying
to trace the root source of this function finds
-
https://linux.die.net/man/3/arc4random
-
https://developer.apple.com/legacy/library/documentation/Darwin/Reference/ManPages/man3/arc4random.3.html
-
https://man.openbsd.org/arc4random
where it looks like this is a BSD specific standard library function.
You can also try adding a manual declaration of "uint32_t
arc4random(void);" to someplace appropriate. (perhaps first hack that
line in to system/include/libc/stdlib.h" to see if that fixes it,
though that will not be an appropriate permanent place).
> --
> You received this message because you are subscribed to the Google Groups
> "emscripten-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to
emscripten-disc...@googlegroups.com.
> For more options, visit
https://groups.google.com/d/optout.