From owner-dev-commits-src-all@freebsd.org Thu Feb 18 20:52:09 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AF06054E222; Thu, 18 Feb 2021 20:52:09 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4DhRj52J8kz3krB; Thu, 18 Feb 2021 20:52:09 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.16.1/8.16.1) with ESMTPS id 11IKq0qc008190 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Thu, 18 Feb 2021 22:52:03 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 11IKq0qc008190 Received: (from kostik@localhost) by tom.home (8.16.1/8.16.1/Submit) id 11IKq0Sf008189; Thu, 18 Feb 2021 22:52:00 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 18 Feb 2021 22:52:00 +0200 From: Konstantin Belousov To: John Baldwin Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 24fd63e0970f - main - mips: Don't set __NO_TLS to disable some uses of TLS. Message-ID: References: <202102180035.11I0ZnL3070354@gitrepo.freebsd.org> <9687575c-dd7c-1496-850b-2018f4bca3da@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9687575c-dd7c-1496-850b-2018f4bca3da@FreeBSD.org> X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on tom.home X-Rspamd-Queue-Id: 4DhRj52J8kz3krB X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Feb 2021 20:52:09 -0000 On Wed, Feb 17, 2021 at 04:48:22PM -0800, John Baldwin wrote: > On 2/17/21 4:35 PM, John Baldwin wrote: > > The branch main has been updated by jhb: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=24fd63e0970f91189dd2acde987bd2e4c8c04a50 > > > > commit 24fd63e0970f91189dd2acde987bd2e4c8c04a50 > > Author: John Baldwin > > AuthorDate: 2021-02-18 00:34:23 +0000 > > Commit: John Baldwin > > CommitDate: 2021-02-18 00:34:23 +0000 > > > > mips: Don't set __NO_TLS to disable some uses of TLS. > > __NO_TLS was originally added to disable use of _Thread in the locale > > code in libc in 82dd5016bd749d1d9e1531bd1703aebeecceab34. At the time > > libc did not support TLS on MIPS (I believe), but TLS support was > > added to libc (at least _set_tp.c) for MIPS about a month after > > __NO_TLS was added, but __NO_TLS was still left around. > > Reviewed by: imp > > Sponsored by: DARPA > > Differential Revision: https://reviews.freebsd.org/D28713 > > --- > > sys/sys/cdefs.h | 3 +-- > > 1 file changed, 1 insertion(+), 2 deletions(-) > > > > diff --git a/sys/sys/cdefs.h b/sys/sys/cdefs.h > > index 64f26480a2f5..ff18911f6acf 100644 > > --- a/sys/sys/cdefs.h > > +++ b/sys/sys/cdefs.h > > @@ -768,8 +768,7 @@ > > #endif > > #endif /* __STDC_WANT_LIB_EXT1__ */ > > -#if defined(__mips) || \ > > - (defined(__powerpc64__) && (!defined(_CALL_ELF) || _CALL_ELF == 1)) > > +#if defined(__powerpc64__) && (!defined(_CALL_ELF) || _CALL_ELF == 1) > > #define __NO_TLS 1 > > #endif > > It would be really nice to kill __NO_TLS entirely. There is at least one > unconditional use of _Thread_local (sorry, should have used that instead > of _Thread above) in libc in stdlib/cxa_thread_atexit_impl.c, so it seems > highly unlikely that TLS is actually broken on any of our platforms as the > libc build would have been broken instead. There is a difference between compile and runtime. The mentioned libc use in cxa_thread_atexit_impl.c is to support some (I believe) rarely used C++ feature of thread-local storage with destructors, so it might be simply not observed often. OTOH, locale functions infect almost everything string-related in libc, so the breakage would be quite visible. But, I wonder, what does CALL_ELF mean? Is it for old 64bit PowerPC ABI, that was abandoned with the switch to ELFv2?