Bug 60817 - gcc configure script misdetects TLS support on x86_64-pc-solaris* with gnu as
Summary: gcc configure script misdetects TLS support on x86_64-pc-solaris* with gnu as
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 4.9.0
: P3 minor
Target Milestone: 5.0
Assignee: Rainer Orth
URL: http://gcc.gnu.org/ml/gcc-patches/201...
Keywords:
Depends on:
Blocks:
 
Reported: 2014-04-11 05:56 UTC by Ruud Koolen
Modified: 2014-04-16 09:11 UTC (History)
1 user (show)

See Also:
Host: x86_64-pc-solaris2.11
Target: x86_64-pc-solaris2.11
Build:
Known to work:
Known to fail:
Last reconfirmed: 2014-04-15 00:00:00


Attachments
Proposed patch. (731 bytes, patch)
2014-04-11 05:56 UTC, Ruud Koolen
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ruud Koolen 2014-04-11 05:56:34 UTC
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.
Comment 1 ro@CeBiTec.Uni-Bielefeld.DE 2014-04-11 13:19:47 UTC
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
Comment 2 Ruud Koolen 2014-04-11 15:49:48 UTC
I generated the patch cleanly against trunk. What's wrong with it?
Comment 3 ro@CeBiTec.Uni-Bielefeld.DE 2014-04-15 11:44:13 UTC
> --- 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
Comment 4 Rainer Orth 2014-04-15 15:22:45 UTC
Patch submitted.
Comment 5 Rainer Orth 2014-04-16 09:10:15 UTC
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
Comment 6 Rainer Orth 2014-04-16 09:11:14 UTC
Fixed for 4.10.0.