Skip to content
Snippets Groups Projects
  • Hans-Peter Nilsson's avatar
    60f761c7
    libstdc++: Use GCC_TRY_COMPILE_OR_LINK for getentropy, arc4random · 60f761c7
    Hans-Peter Nilsson authored
    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.
    60f761c7
    History
    libstdc++: Use GCC_TRY_COMPILE_OR_LINK for getentropy, arc4random
    Hans-Peter Nilsson authored
    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.