This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Fix libstdc++ tests requiring atomic support on hppa-hpux


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.

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* } }

 #include <memory>
 #include <random>
Index: testsuite/20_util/shared_ptr/thread/mutex_weaktoshared.cc
===================================================================
--- testsuite/20_util/shared_ptr/thread/mutex_weaktoshared.cc	(revision 269442)
+++ testsuite/20_util/shared_ptr/thread/mutex_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* } }

 #include <memory>
 #include <random>
Index: testsuite/experimental/net/timer/waitable/cons.cc
===================================================================
--- testsuite/experimental/net/timer/waitable/cons.cc	(revision 269442)
+++ testsuite/experimental/net/timer/waitable/cons.cc	(working copy)
@@ -16,6 +16,7 @@
 // <http://www.gnu.org/licenses/>.

 // { dg-do run { target c++14 } }
+// { dg-additional-options "-L../../libatomic/.libs -latomic" { target hppa*-*-hpux* } }

 #include <experimental/timer>
 #include <testsuite_hooks.h>
Index: testsuite/experimental/net/timer/waitable/dest.cc
===================================================================
--- testsuite/experimental/net/timer/waitable/dest.cc	(revision 269442)
+++ testsuite/experimental/net/timer/waitable/dest.cc	(working copy)
@@ -16,6 +16,7 @@
 // <http://www.gnu.org/licenses/>.

 // { dg-do run { target c++14 } }
+// { dg-additional-options "-L../../libatomic/.libs -latomic" { target hppa*-*-hpux* } }

 #include <experimental/timer>
 #include <testsuite_hooks.h>
Index: testsuite/experimental/net/timer/waitable/ops.cc
===================================================================
--- testsuite/experimental/net/timer/waitable/ops.cc	(revision 269442)
+++ testsuite/experimental/net/timer/waitable/ops.cc	(working copy)
@@ -16,6 +16,7 @@
 // <http://www.gnu.org/licenses/>.

 // { dg-do run { target c++14 } }
+// { dg-additional-options "-L../../libatomic/.libs -latomic" { target hppa*-*-hpux* } }

 #include <experimental/timer>
 #include <testsuite_hooks.h>
Index: testsuite/lib/libstdc++.exp
===================================================================
--- testsuite/lib/libstdc++.exp	(revision 269442)
+++ testsuite/lib/libstdc++.exp	(working copy)
@@ -161,6 +161,17 @@
     }
     v3track gccdir 3

+    # Locate libatomic.
+    set v3-libatomic 0
+    set libatomicdir [lookfor_file $blddir/../libatomic .libs/libatomic.$shlib_ext]
+    if {$libatomicdir != ""} {
+	set v3-libatomic 1
+	set libatomicdir [file dirname $libatomicdir]
+	append ld_library_path_tmp ":${libatomicdir}"
+	verbose -log "libatomic support detected"
+    }
+    v3track libatomicdir 3
+
     # Locate libgomp. This is only required for parallel mode.
     set v3-libgomp 0
     set libgompdir [lookfor_file $blddir/../libgomp .libs/libgomp.$shlib_ext]


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]