aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3/acinclude.m4
diff options
context:
space:
mode:
authorHans-Peter Nilsson <hp@axis.com>2021-11-12 18:04:43 +0100
committerHans-Peter Nilsson <hp@axis.com>2021-11-13 01:45:06 +0100
commit60f761c7e54f96a287c73a71d0b09ee2b2f8426d (patch)
tree8461c3a2b71c485eacc27ee6af8c0fa38e2b19ea /libstdc++-v3/acinclude.m4
parentaf2852b9dc3b1d9ef20d72d20de5a2f7938b87b3 (diff)
downloadgcc-60f761c7e54f96a287c73a71d0b09ee2b2f8426d.zip
gcc-60f761c7e54f96a287c73a71d0b09ee2b2f8426d.tar.gz
gcc-60f761c7e54f96a287c73a71d0b09ee2b2f8426d.tar.bz2
libstdc++: Use GCC_TRY_COMPILE_OR_LINK for getentropy, arc4random
Since r12-5056-g3439657b0286, there has been a regression in test results; an additional 100 FAILs running the g++ and libstdc++ testsuite on cris-elf, a newlib target. The failures are linker errors, not finding a definition for getentropy. It appears newlib has since 2017-12-03 declarations of getentropy and arc4random, and provides an implementation of arc4random using getentropy, but provides no definition of getentropy, not even a stub yielding ENOSYS. This is similar to what it does for many other functions too. While fixing newlib (like adding said stub) would likely help, it still leaves older newlib releases hanging. Thankfully, the libstdc++ configury test can be improved to try linking where possible; using the bespoke GCC_TRY_COMPILE_OR_LINK instead of AC_TRY_COMPILE. BTW, I see a lack of consistency; some tests use AC_TRY_COMPILE and some GCC_TRY_COMPILE_OR_LINK for no apparent reason, but this commit just amends r12-5056-g3439657b0286. libstdc++-v3: PR libstdc++/103166 * acinclude.m4 (GLIBCXX_CHECK_GETENTROPY, GLIBCXX_CHECK_ARC4RANDOM): Use GCC_TRY_COMPILE_OR_LINK instead of AC_TRY_COMPILE. * configure: Regenerate.
Diffstat (limited to 'libstdc++-v3/acinclude.m4')
-rw-r--r--libstdc++-v3/acinclude.m44
1 files changed, 2 insertions, 2 deletions
diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4
index 4adfdf6..30bd92d 100644
--- a/libstdc++-v3/acinclude.m4
+++ b/libstdc++-v3/acinclude.m4
@@ -4839,7 +4839,7 @@ AC_DEFUN([GLIBCXX_CHECK_GETENTROPY], [
AC_LANG_CPLUSPLUS
AC_MSG_CHECKING([for getentropy])
AC_CACHE_VAL(glibcxx_cv_getentropy, [
- AC_TRY_COMPILE(
+ GCC_TRY_COMPILE_OR_LINK(
[#include <unistd.h>],
[unsigned i;
::getentropy(&i, sizeof(i));],
@@ -4862,7 +4862,7 @@ AC_DEFUN([GLIBCXX_CHECK_ARC4RANDOM], [
AC_LANG_CPLUSPLUS
AC_MSG_CHECKING([for arc4random])
AC_CACHE_VAL(glibcxx_cv_arc4random, [
- AC_TRY_COMPILE(
+ GCC_TRY_COMPILE_OR_LINK(
[#include <stdlib.h>],
[unsigned i = ::arc4random();],
[glibcxx_cv_arc4random=yes], [glibcxx_cv_arc4random=no])