diff mbox

Dejagnu fixes for TLS on AIX

Message ID CAGWvny=qY823AcibkD10Xr0dtnWw9TTYrUQDQZeiyj3gUCgzSA@mail.gmail.com
State New
Headers show

Commit Message

David Edelsohn Dec. 31, 2014, 4:44 p.m. UTC
On AIX, GCC needs to build a multilib for AIX.  When testing in tree,
the Dejagnu infrastructure adds linking options for the default,
non-pthread multilib.  This causes failures for the G++ TLS tests.

The following patch uses the existing add_options_for_tls
infrastructure to adjust the flags to prepend the pthread multilib
before the other options.  The patch also XFAILs three assembler tests
on AIX.  This fixes all of the TLS tests on AIX.

Is the Dejagnu library change okay?

Bootstrapped on powerpc-ibm-aix7.1.2.0

Thanks, David

* lib/target-support.exp (add_options_for_tls): Prepend pthread link flags.
* g++.dg/tls/thread_local1.C: XFAIL on AIX.
* g++.dg/tls/thread_local7.C: Same.
* g++.dg/tls/thread_local7g.C: Same.

Comments

Mike Stump Dec. 31, 2014, 11:04 p.m. UTC | #1
On Dec 31, 2014, at 8:44 AM, David Edelsohn <dje.gcc@gmail.com> wrote:
> On AIX, GCC needs to build a multilib for AIX.  When testing in tree,
> the Dejagnu infrastructure adds linking options for the default,
> non-pthread multilib.  This causes failures for the G++ TLS tests.
> 
> The following patch uses the existing add_options_for_tls
> infrastructure to adjust the flags to prepend the pthread multilib
> before the other options.  The patch also XFAILs three assembler tests
> on AIX.  This fixes all of the TLS tests on AIX.
> 
> Is the Dejagnu library change okay?

Ok.
diff mbox

Patch

Index: lib/target-supports.exp
===================================================================
--- lib/target-supports.exp     (revision 219126)
+++ lib/target-supports.exp     (working copy)
@@ -596,7 +596,7 @@ 
             int f (void) { return i; }
             void g (int j) { i = j; }
         }] } {
-       return "$flags -pthread"
+       return "-pthread [g++_link_flags [get_multilibs "-pthread"] ] $flags "
     }
     return $flags
 }
Index: g++.dg/tls/thread_local1.C
===================================================================
--- g++.dg/tls/thread_local1.C  (revision 219126)
+++ g++.dg/tls/thread_local1.C  (working copy)
@@ -7,7 +7,7 @@ 
 // simultaneous execution.
 // { dg-final { scan-assembler-not "cxa_guard" } }
 // The guard should be TLS, not local common.
-// { dg-final { scan-assembler-not "\.comm" } }
+// { dg-final { scan-assembler-not "\.comm" { xfail powerpc-*-aix* } } }

 struct A
 {
Index: g++.dg/tls/thread_local7.C
===================================================================
--- g++.dg/tls/thread_local7.C  (revision 219126)
+++ g++.dg/tls/thread_local7.C  (working copy)
@@ -2,7 +2,7 @@ 
 // { dg-require-effective-target tls }

 // The reference temp should be TLS, not normal data.
-// { dg-final { scan-assembler-not "\\.data" { target tls_native } } }
+// { dg-final { scan-assembler-not "\\.data" { target tls_native
xfail powerpc-*-aix* } } }

 void f()
 {
Index: g++.dg/tls/thread_local7g.C
===================================================================
--- g++.dg/tls/thread_local7g.C (revision 219126)
+++ g++.dg/tls/thread_local7g.C (working copy)
@@ -2,7 +2,7 @@ 
 // { dg-require-effective-target tls }

 // The reference temp should be TLS, not normal data.
-// { dg-final { scan-assembler-not "\\.data" { target tls_native } } }
+// { dg-final { scan-assembler-not "\\.data" { target tls_native
xfail powerpc-*-aix* } } }

 thread_local int&& ir = 42;