From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25247 invoked by alias); 14 Nov 2008 15:54:57 -0000 Received: (qmail 15107 invoked by uid 48); 14 Nov 2008 15:53:35 -0000 Date: Fri, 14 Nov 2008 15:54:00 -0000 Subject: [Bug target/38118] New: gcc emits non-TLS data as TLS on Solaris 11/SPARC X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "ro at gcc dot gnu dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2008-11/txt/msg01084.txt.bz2 While trying to build current mainline with Sun as and GNU ld 2.19 on sparc-sun-solaris2.11, libgomp failed to link with the following error: /vol/gcc/lib/gld-2.19: gomp_thread_attr: TLS reference in .libs/team.o mismatches non-TLS reference in .libs/env.o .libs/team.o: could not read symbols: Bad value Further investigation revealed that this is due to a gcc bug: consider the following testcase: __thread int tsd; int non_tsd; ro@galeras 1510 > ./xgcc -B./ -c ~/tls.c ro@galeras 1511 > readelf -s tls.o|grep tsd 3: 00000004 4 TLS GLOBAL DEFAULT COM non_tsd 4: 00000000 4 TLS GLOBAL DEFAULT 2 tsd ro@galeras 1512 > /opt/onstudio12/SUNWspro/bin/cc -c ~/tls.c ro@galeras 1513 > readelf -s tls.o|grep tsd 9: 00000004 4 TLS GLOBAL DEFAULT COM tsd 10: 00000004 4 OBJECT GLOBAL DEFAULT COM non_tsd I.e. if compiled with gcc, both objects are marked as tls, while Sun Studio 12 cc correctly only marks tsd as TLS. The same bug exists in gcc 4.3, 4.2 and 4.1. -- Summary: gcc emits non-TLS data as TLS on Solaris 11/SPARC Product: gcc Version: 4.4.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: ro at gcc dot gnu dot org GCC build triplet: sparc-sun-solaris2.11 GCC host triplet: sparc-sun-solaris2.11 GCC target triplet: sparc-sun-solaris2.11 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38118