When, for example, running 'check-target-libgomp' with
'RUNTESTFLAGS="--target_board=unix/-static"', the test results are full of
'FAIL: [...] (test for excess errors)' due to:

    ld: [...]/x86_64-pc-linux-gnu/./libgomp/.libs/libgomp.a(allocator.o): in 
function `gomp_init_memkind':
    [...]/source-gcc/libgomp/config/linux/../../allocator.c:357:(.text+0x18): 
warning: Using 'dlopen' in statically linked applications requires at runtime 
the shared libraries from the glibc version used for linking

..., or:

    ld: [...]/x86_64-pc-linux-gnu/./libgomp/.libs/libgomp.a(target.o): in 
function `gomp_load_plugin_for_device':
    [...]/source-gcc/libgomp/target.c:6624:(.text+0xb5d): warning: Using 
'dlopen' in statically linked applications requires at runtime the shared 
libraries from the glibc version used for linking

Prune these.

        gcc/testsuite/
        * lib/prune.exp (prune_gcc_output): Ignore 'ld' diagnostics for
        glibc plus '-static' plus 'dlopen'.
---
 gcc/testsuite/lib/prune.exp | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/gcc/testsuite/lib/prune.exp b/gcc/testsuite/lib/prune.exp
index 0b2f1db98c3a..5cb284959a81 100644
--- a/gcc/testsuite/lib/prune.exp
+++ b/gcc/testsuite/lib/prune.exp
@@ -109,6 +109,9 @@ proc prune_gcc_output { text } {
     # Many tests that use visibility will still pass on platforms that don't 
support it.
     regsub -all "(^|\n)\[^\n\]*lto1: warning: visibility attribute not 
supported in this configuration; ignored\[^\n\]*" $text "" text
 
+    # Ignore 'ld' diagnostics for glibc plus '-static' plus 'dlopen'.
+    regsub -all "(^|\n)\[^\n\]*warning: Using 'dlopen' in statically linked 
applications requires at runtime the shared libraries from the glibc version 
used for linking" $text "" text
+
     #send_user "After:$text\n"
 
     return $text
-- 
2.53.0

Reply via email to