From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, SUBJ_OBFU_PUNCT_FEW,SUBJ_OBFU_PUNCT_MANY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 24794 invoked from network); 27 Aug 2020 22:39:16 -0000 Received: from mother.openwall.net (195.42.179.200) by inbox.vuxu.org with ESMTPUTF8; 27 Aug 2020 22:39:16 -0000 Received: (qmail 7501 invoked by uid 550); 27 Aug 2020 22:39:11 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com Received: (qmail 7483 invoked from network); 27 Aug 2020 22:39:10 -0000 Date: Thu, 27 Aug 2020 18:38:58 -0400 From: Rich Felker To: musl@lists.openwall.com Message-ID: <20200827223858.GS3265@brightrain.aerifal.cx> References: <20200825164316.GQ3265@brightrain.aerifal.cx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Subject: Re: [musl] [PATCH] [RFC] cleanup/refactor pthread_arch.h, pthread_impl.h On Wed, Aug 26, 2020 at 11:52:46PM +0200, Bartosz Brachaczek wrote: > On Tue, Aug 25, 2020 at 6:43 PM Rich Felker wrote: > > > The attached patch series refactors fragments from pthread_arch.h to > > reduce redundancy and allow pthread_arch.h to be included at the top > > of pthread_impl.h, where it can be used to influence the > > definition/layout of struct __pthread, rather than the middle of the > > file. This makes it possible to get rid of the duplicate canary and > > dtv members that existed just to match multiple ABIs silumtaneously. > > > > This involved a good deal of manual conversion/deduplication so it's > > possible there are bugs for some archs. That's why I've posted the > > series for review rather than just pushing. Reports of success/failure > > (disassembly of pthread_self.o before/after probably suffice to > > confirm no regression) would be very helpful. > > > > I mechanically confirmed for all archs that with the first two patches > applied, disassembly of pthread_self.o before/after doesn't change. The > third patch obviously changes the offset for most archs due to change in > sizeof struct pthread. > > Only other remark: ricv64's __get_tp misses the change of the variable type > from char * to uintptr_t. Thanks -- that's very helpful. It also raises a point that we should probably add -Werror=int-conversion to the default CFLAGS. As far as I can tell it only catches invalid (constraint-violation) implicit conversions like the one you found, and does not have any style-policing component to it. Rich