From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7195 invoked by alias); 14 Jan 2010 01:15:31 -0000 Received: (qmail 7185 invoked by uid 22791); 14 Jan 2010 01:15:31 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (216.239.44.51) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 14 Jan 2010 01:15:26 +0000 Received: from kpbe15.cbf.corp.google.com (kpbe15.cbf.corp.google.com [172.25.105.79]) by smtp-out.google.com with ESMTP id o0E1FN5J010386 for ; Wed, 13 Jan 2010 17:15:24 -0800 Received: from qw-out-2122.google.com (qwd5.prod.google.com [10.241.193.197]) by kpbe15.cbf.corp.google.com with ESMTP id o0E1FJnb023465 for ; Wed, 13 Jan 2010 17:15:20 -0800 Received: by qw-out-2122.google.com with SMTP id 5so130832qwd.45 for ; Wed, 13 Jan 2010 17:15:19 -0800 (PST) Received: by 10.224.42.134 with SMTP id s6mr26217qae.352.1263431719443; Wed, 13 Jan 2010 17:15:19 -0800 (PST) Received: from coign.google.com ([67.218.106.32]) by mx.google.com with ESMTPS id 2sm324122qwi.37.2010.01.13.17.15.15 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 13 Jan 2010 17:15:18 -0800 (PST) To: Gary Funck Cc: GCC List Subject: Re: multiple defs. of TLS common symbols? References: <20100113193306.GF9119@intrepid.com> From: Ian Lance Taylor Date: Thu, 14 Jan 2010 01:15:00 -0000 In-Reply-To: <20100113193306.GF9119@intrepid.com> (Gary Funck's message of "Wed\, 13 Jan 2010 11\:33\:06 -0800") Message-ID: User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-System-Of-Record: true X-IsSubscribed: yes Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org X-SW-Source: 2010-01/txt/msg00291.txt.bz2 Gary Funck writes: > We use TLS relocated symbols to create thread-local symbols > in the GCC UPC compiler, and have run into an issue illustrated > by the following program, on a test case that defines a > common symbol in several files, and uses it in a single file. The only way I know to get a TLS common symbol out of gcc is to use an omp pragma: int x; #pragma omp threadprivate (x) Otherwise TLS variables are generated as definitions rather than as common variables. Personally I tend to think that that is a good thing. Treating uninitialized variables as common variables is a non-standard extension even for C90. We can't get rid of them for existing code, but __thread code is by definition new. Why do you want them to be common? Ian