This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [PATCH] Fix libstdc++ tests requiring atomic support on hppa-hpux
- From: Jonathan Wakely <jwakely at redhat dot com>
- To: John David Anglin <dave dot anglin at bell dot net>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, libstdc++ at gcc dot gnu dot org
- Date: Mon, 11 Mar 2019 12:01:37 +0000
- Subject: Re: [PATCH] Fix libstdc++ tests requiring atomic support on hppa-hpux
- References: <54b2ad46-4e9c-1abe-07f9-7d123ff63c47@bell.net>
On 09/03/19 12:46 -0500, John David Anglin wrote:
The hppa*-*-hpux* target has no builtin atomic support, so we need to explicitly link
applications requiring atomic support against libatomic.
Okay?
Dave
--
John David Anglin dave.anglin@bell.net
2019-03-09 John David Anglin <dave.anglin@bell.net>
PR libstdc++/89461
* testsuite/20_util/shared_ptr/thread/default_weaktoshared.cc: Link
against libatomic on hppa*-*-hpux*.
* testsuite/20_util/shared_ptr/thread/mutex_weaktoshared.cc: Likewise.
* testsuite/experimental/net/timer/waitable/cons.cc: Likewise.
* testsuite/experimental/net/timer/waitable/dest.cc: Likewise.
* testsuite/experimental/net/timer/waitable/ops.cc: Likewise.
* testsuite/lib/libstdc++.exp: Locate libatomic.
What do you think about adding the following?
--- a/libstdc++-v3/testsuite/lib/dg-options.exp
+++ b/libstdc++-v3/testsuite/lib/dg-options.exp
@@ -257,6 +257,15 @@ proc add_options_for_net_ts { flags } {
return $flags
}
+# Add to FLAGS all the target-specific flags to link to libatomic, if required.
+
+proc add_options_for_libatomic { flags } {
+ if { [istarget hppa*-*-hpux*] } {
+ return "$flags -L../../libatomic/.libs -latomic"
+ }
+ return $flags
+}
+
# Like dg-options, but adds to the default options rather than replacing them.
proc dg-additional-options { args } {
Index: testsuite/20_util/shared_ptr/thread/default_weaktoshared.cc
===================================================================
--- testsuite/20_util/shared_ptr/thread/default_weaktoshared.cc (revision 269442)
+++ testsuite/20_util/shared_ptr/thread/default_weaktoshared.cc (working copy)
@@ -22,6 +22,7 @@
// { dg-require-effective-target c++11 }
// { dg-require-effective-target pthread }
// { dg-require-cstdint "" }
+// { dg-additional-options "-L../../libatomic/.libs -latomic" { target hppa*-*-hpux* } }
And then this would be:
--- a/libstdc++-v3/testsuite/20_util/shared_ptr/thread/default_weaktoshared.cc
+++ b/libstdc++-v3/testsuite/20_util/shared_ptr/thread/default_weaktoshared.cc
@@ -19,6 +19,7 @@
// { dg-do run }
// { dg-options "-pthread" }
+// { dg-add-options libatomic }
// { dg-require-effective-target c++11 }
// { dg-require-effective-target pthread }
// { dg-require-cstdint "" }