]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: testsuite: use -lbsd for net_ts on RTEMS
authorAlexandre Oliva <oliva@adacore.com>
Fri, 24 Jun 2022 02:20:46 +0000 (23:20 -0300)
committerAlexandre Oliva <oliva@gnu.org>
Fri, 24 Jun 2022 02:25:52 +0000 (23:25 -0300)
Networking functions that net_ts tests rely on are defined in libbsd
on RTEMS, so link with it.

for  libstdc++-v3/ChangeLog

* testsuite/lib/dg-options.exp (add_options_for_net_ts): Add
-lbsd for RTEMS targets.

libstdc++-v3/testsuite/lib/dg-options.exp

index 203bb0dfed5054096f292e1d31e3da03a06a98f0..15f37da468a5be9bc6bfec61d02179ce7f185dd5 100644 (file)
@@ -253,6 +253,12 @@ proc add_options_for_net_ts { flags } {
     # libsocket and libnsl for networking applications.
     if { [istarget *-*-solaris2*] } {
        return "$flags -lsocket -lnsl"
+    } elseif { [istarget *-*-rtems*] } {
+       # Adding -Wl,--gc-sections would enable a few more tests to
+       # link, but all of them fail at runtime anyway, because the
+       # io_context ctor calls pipe(), which always fails, and thus
+       # the ctor throws a system error.
+       return "$flags -lbsd"
     }
     return $flags
 }