+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
@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
+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:
// { 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 ();
// { dg-do run }
// { dg-options "-O2" }
// { dg-require-effective-target tls_runtime }
+// { dg-add-options tls }
// { dg-additional-sources "static-1a.cc" }
struct A
/* { 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. */
/* { dg-do run } */
/* { dg-require-effective-target tls_runtime } */
+/* { dg-add-options tls } */
extern void abort (void);
extern void *memset (void *, int, __SIZE_TYPE__);
/* { 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);
/* { dg-do run } */
/* { dg-options "-O2" } */
/* { dg-require-effective-target tls_runtime } */
+/* { dg-add-options tls } */
__thread double thrtest[81];
int main ()
/* { dg-do run } */
/* { dg-options "-O2" } */
/* { dg-require-effective-target tls_runtime } */
+/* { dg-add-options tls } */
__thread double thrtest[81];
int main ()
}]
}
+# 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 {} {