Created attachment 32584 [details] Proposed patch. When building gcc >= 4.7 on x86_64-pc-solaris2.11 --with-gnu-as, the gcc/configure script incorrectly decides that gnu as does not support real TLS, and so unnecessarily decides to activate emutls instead. The solaris-specific test checks this support by trying to assemble a piece of TLS-using assembly code, and it uses the same 32-bit code for this test both on 32-bit and 64-bit platforms. The solaris assembler will accept this, but gnu as fails on the 32 bit code when targeting x86_64-pc-solaris*, thus causing the detection to fail. Attached patch for 4.9 fixes the problem, and is trivially backported to 4.8 and 4.7.
I'll have a look. The patch is completely bogus, though: it seems to have been hand-edited to the point where it doesn't even apply. That said, we need to make sure that several different configurations correctly detect native TLS support, both for i386-*-solaris2* and x86_64-*-solaris2* configurations: 32-bit gas (not necessarily in x86_64 case) 64-bit gas /bin/as I'm pretty sure this won't make 4.9.0, though. Rainer
I generated the patch cleanly against trunk. What's wrong with it?
> --- Comment #2 from Ruud Koolen <redlizard at redlizard dot nl> --- > I generated the patch cleanly against trunk. What's wrong with it? Seems to be a quirk of bugzilla: if you download the patch via Diff -> Context: File -> Raw Unified you get garbage. As I said, I'll have a look and test in various different configurations. One think I dislike about your current patch is the duplication of tls_section_flag. Rainer
Patch submitted.
Author: ro Date: Wed Apr 16 09:09:42 2014 New Revision: 209440 URL: http://gcc.gnu.org/viewcvs?rev=209440&root=gcc&view=rev Log: Correctly detect native TLS support with 64-bit gas on Solaris/x86 (PR target/60817) PR target/60817 * configure.ac (set_have_as_tls): Merge i[34567]86-*-* and x86_64-*-* cases. Pass necessary as flags on 64-bit Solaris/x86. Use lowercase relocs for x86_64-*-*. * configure: Regenerate. Modified: trunk/gcc/ChangeLog trunk/gcc/configure (contents, props changed) trunk/gcc/configure.ac
Fixed for 4.10.0.