[v3, testsuite] Introduce dg-add-options net_ts

Jonathan Wakely jwakely@redhat.com
Tue Oct 16 16:25:00 GMT 2018


On 16/10/18 13:38 +0200, Rainer Orth wrote:
>Some of the new Networking TS tests FAIL before Solaris 11.4 like this:
>
>FAIL: experimental/net/internet/address/v4/members.cc (test for excess errors)
>Excess errors:
>Undefined                       first referenced
> symbol                             in file
>inet_ntop                           /var/tmp//ccpcIRXj.o
>gai_strerror                        /var/tmp//ccpcIRXj.o
>ld: fatal: symbol referencing errors. No output written to ./members.exe
>collect2: error: ld returned 1 exit status
>
>This happens because until the socket etc. functions were integrated
>into libc in Solaris 11.4, they only lived in libsocket and libnsl.
>
>The following patch fixes this by introducing a new dg-add-options
>keyword net_ts (I'm open for suggestions for the name, of course;
>networking_ts might be an option, too) and adding the requirement to the
>tests involved.
>
>With the patch below, all but one of the tests PASS on
>i386-pc-solaris2.10:
>
>FAIL: experimental/net/internet/resolver/ops/lookup.cc execution test
>
>/vol/gcc/src/hg/trunk/local/libstdc++-v3/testsuite/experimental/net/internet/res
>olver/ops/lookup.cc:35: void test01(): Assertion '!ec' failed.
>
>The code in question is
>
>  auto addrs = resolv.resolve("localhost", "http", ec);
>  VERIFY( !ec );
>
>but "http" is missing from /etc/services before Solaris 11.4.
>
>Ok for mainline?
>
>Btw., one may want to do similarly for the Filesystem TS tests,
>introducing dg-add-options fs_ts (or filesystem_ts) instead of repeating
>dg-options "-DUSE_FILESYSTEM_TS -lstdc++fs" over and over again.

I tried to add this:

diff --git a/libstdc++-v3/testsuite/lib/dg-options.exp b/libstdc++-v3/testsuite/lib/dg-options.exp
index f73ce06..fae0b0d 100644
--- a/libstdc++-v3/testsuite/lib/dg-options.exp
+++ b/libstdc++-v3/testsuite/lib/dg-options.exp
@@ -254,6 +254,9 @@ proc add_options_for_net_ts { flags } {
     if { [istarget *-*-solaris2*] } {
        return "$flags -lsocket -lnsl"
     }
+    if { [istarget *-*-aix*] } {
+       return "$flags -pthread"
+    }
     return $flags
 }

But it doesn't work. It seems to be ignored, as the test log shows:

extra_tool_flags are:
  -Wl,-bmaxdata:0x20000000

That suggests I need to add:

{ dg-additional-options "-pthread" { target *-*-aix* } }

Which is a shame, given that we have your new net_ts that should work.




More information about the Libstdc++ mailing list