Commit 722afb4
committed
libstdc++: Do not check getentropy and arc4random for cross builds
The "getentropy" and "arc4random" check may not yield a correct result
for the cross compile builds because linking is often not available for
them and the C library headers (notoriously, newlib) may still declare
these function prototypes even if they are not actually part of the
final library -- for this reason, this commit disables the "getentropy"
and "arc4random" checks for non-native builds.
This effectively prevents the std::random_device from making use of
these functions when `--with-newlib` is specified, which is indeed a
correct behaviour because the newlib does not provide a default stub
for the "getentropy" function (also note that the newlib "arc4random"
implementation internally calls the missing "getentropy" function).
For other C libraries, the `GLIBCXX_CROSSCONFIG` function may hard-code
the availability of these functions by manually defining
`HAVE_GETENTROPY` and `HAVE_ARC4RANDOM`, or by calling the
`GLIBCXX_CHECK_GETENTROPY` and `GLIBCXX_CHECK_ARC4RANDOM` functions.
Signed-off-by: Stephanos Ioannidis <[email protected]>1 parent 27eef47 commit 722afb4
1 file changed
+4
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
269 | 269 | | |
270 | 270 | | |
271 | 271 | | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
272 | 276 | | |
273 | 277 | | |
274 | 278 | | |
| |||
474 | 478 | | |
475 | 479 | | |
476 | 480 | | |
477 | | - | |
478 | | - | |
479 | | - | |
480 | | - | |
481 | 481 | | |
482 | 482 | | |
483 | 483 | | |
| |||
0 commit comments