From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9045 invoked by alias); 10 May 2017 12:03:20 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 8797 invoked by uid 89); 10 May 2017 12:03:18 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=wishes X-HELO: mx1.redhat.com DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 079BFE9A50 Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=fweimer@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 079BFE9A50 Subject: Re: [PATCH 05/10] Remove __need macros from errno.h (__need_Emath, __need_error_t). To: Joseph Myers Cc: Zack Weinberg , libc-alpha@sourceware.org, adhemerval.zanella@linaro.org, Wilco.Dijkstra@arm.com, carlos@redhat.com, schwab@suse.de References: <20170509154103.11973-1-zackw@panix.com> <20170509154103.11973-6-zackw@panix.com> <9d81a666-ecd7-578e-3475-9f3922619980@redhat.com> From: Florian Weimer Message-ID: <7401509c-93fd-f1da-abe8-d0e6a844e886@redhat.com> Date: Wed, 10 May 2017 12:03:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2017-05/txt/msg00234.txt.bz2 On 05/10/2017 01:47 PM, Joseph Myers wrote: > On Wed, 10 May 2017, Florian Weimer wrote: > >> On 05/09/2017 11:38 PM, Joseph Myers wrote: >>> On Tue, 9 May 2017, Zack Weinberg wrote: >>> >>>> diff --git a/misc/sys/cdefs.h b/misc/sys/cdefs.h >>>> index 74f9a49b05..075c996f28 100644 >>>> --- a/misc/sys/cdefs.h >>>> +++ b/misc/sys/cdefs.h >>>> @@ -326,6 +326,13 @@ >>>> # define __attribute_artificial__ /* Ignore */ >>>> #endif >>>> +/* Force use of the initial-exec TLS model. */ >>>> +#if __GNUC_PREREQ (3,3) >>>> +# define __attribute_tls_model_ie__ __attribute__ ((tls_model >>>> ("initial-exec"))) >>> >>> This is not namespace-clean for an installed header (needs to be >>> __tls_model__). >> >> The larger problem is that we need to error out if __GLIBC_USE (TLS_ERRNO) and >> the compiler does not support the initial-exec TLS model because it cannot >> produce the required ABI for the errno symbol. > > You don't need initial-exec TLS for errno. If a port wishes to export TLS > errno directly, it's perfectly valid for the headers to do > > extern _Thread_local int errno; > #define errno errno > > with any C11 compiler, and if the compiler only supports GD model TLS, > that's fine for accessing an IE variable (it may or may not get optimized > to IE by the linker). Declaring the TLS model is simply an optimization. That's true if we want to create a port which is effectively C11-only. (The NaCl header generator uses __thread, though, so it's still non-standard.) However, I still think that the NaCl port should be aligned with the rest of glibc in this regard, and that Zack's cleanup should not introduce a new extension point for it. Particularly since we don't have a working port right now which would exercise this functionality, so it's likely to be broken anyway. Thanks, Florian