On Wed, 14 Aug 2024, 18:00 Hans-Peter Nilsson, <[email protected]> wrote:
> (CC to the dejagnu project as a heads-up)
>
> Regtested cris-elf with a fresh newlib checkout where 2640
> libstdc++-v3 tests otherwise fail due to the stubbed newlib
> _getentropy. Ok to commit?
>
OK for trunk and release branches too if you want. Thanks.
> -- >8 --
> Newer newlib trigger warnings about certain functions not implemented
> (_getentropy) when testing libstdc++-v3.
>
> Since 2018 (circa binutils-2.10) the "in function" prefix isn't
> capitalized for those "not implemented" warnings when generated from
> the linker (a GNU ld feature used by newlib). Dejagnu up to and
> including at least dejagnu-1.6.3 (and git @ 42979bd3b9) assumes a
> capital "In function", leaving that part unpruned, and boom we have
> thousands of "excess errors" from the libstdc++-v3 testsuite.
>
> While gcc/testsuite/lib/prune.exp:prune_gcc_output already deals with
> this quirk with a vastly more generic pattern, I choose this simpler
> tweak.
>
> libstdc++-v3:
> * testsuite/lib/prune.exp (libstdc++-dg-prune): Prune
> uncapitalized "in function" warning from linker.
> ---
> libstdc++-v3/testsuite/lib/prune.exp | 9 +++++++++
> 1 file changed, 9 insertions(+)
>
> diff --git a/libstdc++-v3/testsuite/lib/prune.exp
> b/libstdc++-v3/testsuite/lib/prune.exp
> index 071dcf34c1e8..4250e2d39e7d 100644
> --- a/libstdc++-v3/testsuite/lib/prune.exp
> +++ b/libstdc++-v3/testsuite/lib/prune.exp
> @@ -80,6 +80,15 @@ proc libstdc++-dg-prune { system text } {
> # Ignore dsymutil warning (tool bug is actually in the linker)
> regsub -all "(^|\n)\[^\n\]*could not find object file symbol for
> symbol\[^\n\]*" $text "" text
>
> + # This pattern, except requiring a capitalized "In" and with a
> + # sub-pattern matching a subsequent line "is not implemented and will
> + # always fail", is part of the standard dejagnu prune_warnings
> function.
> + # There's also a separate single-line pattern pruning the "is not
> + # implemented and will always fail". Since that pattern is processed
> + # before this ${tool}-dg-prune function is called, we have to handle
> + # the single uncapitalized "in function" line.
> + regsub -all "(^|\n)\[^\n\]*: in function\[^\n\]*" $text "" text
> +
> # If exceptions are disabled, mark tests expecting exceptions to be
> enabled
> # as unsupported.
> if { ![check_effective_target_exceptions_enabled] } {
> --
> 2.30.2
>
>