]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gcc:
authorRainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
Mon, 6 Dec 2010 17:28:38 +0000 (17:28 +0000)
committerRainer Orth <ro@gcc.gnu.org>
Mon, 6 Dec 2010 17:28:38 +0000 (17:28 +0000)
Backport from mainline:
2010-07-23  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

* doc/sourcebuild.texi (Add Options): Document tls.

gcc/testsuite:
Backport from mainline:
2010-07-23  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

* lib/target-supports.exp (add_options_for_tls): New proc.
* g++.dg/tls/static-1.C: Use dg-add-options tls.
* g++.dg/tls/static-1a.cc: Likewise.
* gcc.dg/tls/emutls-1.c: Likewise.
* gcc.dg/tls/opt-11.c: Likewise.
* gcc.dg/tls/opt-12.c: Likewise.
* gcc.dg/tls/pr24428-2.c: Likewise.
* gcc.dg/tls/pr24428.c: Likewise.

2010-11-02  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

PR target/46131
* lib/target-supports.exp (add_options_for_tls): Pass -pthread for
*-*-osf*.

From-SVN: r167507

gcc/ChangeLog
gcc/doc/sourcebuild.texi
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/tls/static-1.C
gcc/testsuite/g++.dg/tls/static-1a.cc
gcc/testsuite/gcc.dg/tls/emutls-1.c
gcc/testsuite/gcc.dg/tls/opt-11.c
gcc/testsuite/gcc.dg/tls/opt-12.c
gcc/testsuite/gcc.dg/tls/pr24428-2.c
gcc/testsuite/gcc.dg/tls/pr24428.c
gcc/testsuite/lib/target-supports.exp

index bd39775fbb003240a68e856ae1407e37598fa398..4d52ec8d1e0b10a1c42c4050ed23fdd99491c226 100644 (file)
@@ -1,3 +1,10 @@
+2010-12-06  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
+
+       Backport from mainline:
+       2010-07-23  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
+
+       * doc/sourcebuild.texi (Add Options): Document tls.
+
 2010-12-06  Richard Guenther  <rguenther@suse.de>
 
        PR tree-optimization/46806
index 3db3efd769d5f423ba64d07a7fc24f93b5b23331..02b85ac3e7ca9194b45a1fd7b0624604b84e1f10 100644 (file)
@@ -1892,6 +1892,9 @@ compliance mode.
 @item mips16_attribute
 @code{mips16} function attributes.
 Only MIPS targets support this feature, and only then in certain modes.
+
+@item tls
+Add the target-specific flags needed to use thread-local storage.
 @end table
 
 @node Require Support
index 77857cd9c393b120004e16b6e9b06272efb38bf5..3c708befede4776a5c98c03c996280a65f67ba4e 100644 (file)
@@ -1,3 +1,23 @@
+2010-12-06  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
+
+       Backport from mainline:
+       2010-07-23  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
+
+       * lib/target-supports.exp (add_options_for_tls): New proc.
+       * g++.dg/tls/static-1.C: Use dg-add-options tls.
+       * g++.dg/tls/static-1a.cc: Likewise.
+       * gcc.dg/tls/emutls-1.c: Likewise.
+       * gcc.dg/tls/opt-11.c: Likewise.
+       * gcc.dg/tls/opt-12.c: Likewise.
+       * gcc.dg/tls/pr24428-2.c: Likewise.
+       * gcc.dg/tls/pr24428.c: Likewise.
+
+       2010-11-02  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
+
+       PR target/46131
+       * lib/target-supports.exp (add_options_for_tls): Pass -pthread for
+       *-*-osf*.
+
 2010-12-06  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
 
        Backport from mainline:
index 027a94297662acf0fed01aab517ddb2d29b3c9a0..506b0fcf7a0eecde254bb7b7643e0566467c990e 100644 (file)
@@ -1,6 +1,7 @@
 // { dg-do run }
 // { dg-options "-O2" }
 // { dg-require-effective-target tls_runtime }
+// { dg-add-options tls }
 // { dg-additional-sources "static-1a.cc" }
 
 extern "C" void abort ();
index 47a7a2717c0c0522b054db3b9e865ffcc225e3d8..1c6109f861ece30dd1e51d44ff714ec81628b7c7 100644 (file)
@@ -1,6 +1,7 @@
 // { dg-do run }
 // { dg-options "-O2" }
 // { dg-require-effective-target tls_runtime }
+// { dg-add-options tls }
 // { dg-additional-sources "static-1a.cc" }
 
 struct A
index a0dea509434784f68f6157853992605b7a844eb0..3b3577c895efd70d78632b51e2fc080b93fc9e6d 100644 (file)
@@ -1,5 +1,6 @@
 /* { dg-do run { target *-wrs-vxworks } } */
 /* { dg-require-effective-target tls } */
+/* { dg-add-options tls } */
 
 /* vxworks' TLS model requires no extra padding on the tls proxy
    objects.  */
index 3739645257ab02e0fff6b4b3ebbbe33cbf6f0ead..0069c484a2c43c7df4c82f1c21234f456ddd991a 100644 (file)
@@ -1,5 +1,6 @@
 /* { dg-do run } */
 /* { dg-require-effective-target tls_runtime } */
+/* { dg-add-options tls } */
 
 extern void abort (void);
 extern void *memset (void *, int, __SIZE_TYPE__);
index 7c6e73430a188057813dabe2a00aa2ddbe9b0f09..7b9e498a5a8dc06a9181e48c20e35db6191381ac 100644 (file)
@@ -2,6 +2,7 @@
 /* { dg-do run } */
 /* { dg-options "-O2 -fpic" } */
 /* { dg-require-effective-target tls_runtime } */
+/* { dg-add-options tls } */
 /* { dg-require-effective-target fpic } */
 
 extern void abort (void);
index a0ceecc06243e2c470f13a14ed9513cff9d2456f..b147f60d6a911f9099db097eb193d77009e906f6 100644 (file)
@@ -1,6 +1,7 @@
 /* { dg-do run } */
 /* { dg-options "-O2" } */
 /* { dg-require-effective-target tls_runtime } */
+/* { dg-add-options tls } */
 
 __thread double thrtest[81];
 int main ()
index ecb747ede6de74fb1bb13478c0613abf5c2420f1..6439698775a848a518e569dc088986739e5c6aa4 100644 (file)
@@ -1,6 +1,7 @@
 /* { dg-do run } */
 /* { dg-options "-O2" } */
 /* { dg-require-effective-target tls_runtime } */
+/* { dg-add-options tls } */
 
 __thread double thrtest[81];
 int main ()
index 1234261b4bffdf86b36a1c744199c657a5b2f3c8..0587ebcfaa4956889a8cd269a1b0c2e1f2bb50a1 100644 (file)
@@ -569,6 +569,17 @@ proc check_effective_target_pcc_bitfield_type_matters { } {
     }]
 }
 
+# Add to FLAGS all the target-specific flags needed to use thread-local storage.
+
+proc add_options_for_tls { flags } {
+    # Tru64 UNIX uses emutls, which relies on a couple of pthread functions
+    # which only live in libpthread, so always pass -pthread for TLS.
+    if { [istarget *-*-osf*] } {
+       return "$flags -pthread"
+    }
+    return $flags
+}
+
 # Return 1 if thread local storage (TLS) is supported, 0 otherwise.
 
 proc check_effective_target_tls {} {