I'm seeing various failures in the g++.dg/tls/thread_local* tests on Solaris 9: With Sun as, I have XPASS: g++.dg/tls/thread_local-cse.C execution test XPASS: g++.dg/tls/thread_local2.C execution test XPASS: g++.dg/tls/thread_local2g.C execution test XPASS: g++.dg/tls/thread_local6.C execution test on both SPARC and x86. The Solaris 9 with as configuration uses emutls. These errors are due to Eric's patch 2012-11-19 Eric Botcazou * g++.dg/tls/thread_local-order1.C: Add dg-require-cxa-atexit. * g++.dg/tls/thread_local3g.C: Likewise. * g++.dg/tls/thread_local4g.C: Likewise. * g++.dg/tls/thread_local5g.C: Likewise. * g++.dg/tls/thread_local6g.C: Likewise. * g++.dg/tls/thread_local-cse.C: XFAIL on Solaris 9. * g++.dg/tls/thread_local2.C: Likewise. * g++.dg/tls/thread_local2g.C: Likewise. * g++.dg/tls/thread_local6.C: Likewise. The XFAILs are wrong, instead one just needs to use dg-add-options tls, which the patch below does. Solaris 9/x86 with as also has FAIL: g++.dg/tls/thread_local-wrap4.C scan-assembler-not _ZTW1i@PLT The difference between the as and gas outputs is -.LCFI2: - call .LPR3 - addl $_GLOBAL_OFFSET_TABLE_, %ebx - call _ZTW1i@PLT + call _ZTW1i No idea how best to handle this. On Solaris 9, 10, and 11/x86 with gas and gld, I find FAIL: g++.dg/tls/thread_local-order1.C execution test FAIL: g++.dg/tls/thread_local3g.C -std=gnu++11 execution test FAIL: g++.dg/tls/thread_local4g.C -std=gnu++11 execution test FAIL: g++.dg/tls/thread_local5g.C -std=gnu++11 execution test FAIL: g++.dg/tls/thread_local6g.C execution test This happens (as in two other testcases, cf. PR c++/51923) since the dg-require-cxa-atexit test passes on Solaris with gld though the platform doesn't have __cxa_atexit and I'm ignoring it for now. The patch below adds the missing dg-add-options tls in all run tests, not just the immediately affected ones. Tested with the appropriate runtest invocations on {i386-pc,sparc-sun}-solaris2.{9,10} and x86_64-unknown-linux-gnu. Ok for mainline? Rainer 2013-01-08 Rainer Orth * g++.dg/tls/thread_local-cse.C: Don't xfail on *-*-solaris2.9. Add tls options. * g++.dg/tls/thread_local2.C: Likewise. * g++.dg/tls/thread_local2g.C: Likewise. * g++.dg/tls/thread_local6.C: Likewise. * g++.dg/tls/thread_local-order1.C: Add tls options. * g++.dg/tls/thread_local-order2.C: Likewise. * g++.dg/tls/thread_local3.C: Likewise. * g++.dg/tls/thread_local3g.C: Likewise. * g++.dg/tls/thread_local4.C: Likewise. * g++.dg/tls/thread_local4g.C: Likewise. * g++.dg/tls/thread_local5.C: Likewise. * g++.dg/tls/thread_local5g.C: Likewise. * g++.dg/tls/thread_local6g.C: Likewise.