From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from cmx-mtlrgo002.bell.net (mta-mtl-001.bell.net [209.71.208.11]) by sourceware.org (Postfix) with ESMTP id 3DD303858D37 for ; Mon, 27 Mar 2023 01:58:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3DD303858D37 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=bell.net Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=bell.net X-RG-CM-BuS: 0 X-RG-CM-SC: 0 X-RG-CM: Clean X-Originating-IP: [174.95.58.126] X-RG-Env-Sender: dave.anglin@bell.net X-RG-Rigid: 640C55490207ABAC X-CM-Envelope: MS4xfA7yja+zzWsd5CGbrOoE1pOw6ZbIwRpwJ0VFp6gwKYSFKMZLkRdKxOhlMo5944ZUiOzpG1OHjNxrDyrr8dzssvFvdSo98zNHy5oN3HAgn1gw9BIq7sbI EAT5n+wiTjkQutn5Jsw7gewUDTXuIPsi1BpqgSAHDdJcI9gfSMluJ5faz+Y89TeDurNrSFpPgvobarB5DvBhnmOVWY29BJOon0vgHndvOwrdBHjAAHO1uJqw FJlJZCZ3Nucm5u2J34CR0sTUvqJxNvAc1Ia+iDw70RTDkK+br8Od9x9BnSXgbmz8PNiGV6bWzGgfwhG1mmiVQWXFmkDPB9L050XcAv3iOcBFz4I6pd0xhcV6 BBzeJ428 X-CM-Analysis: v=2.4 cv=GcB0ISbL c=1 sm=1 tr=0 ts=6420f83b a=ZvkN53RyrFzj2rA+7ad7AA==:117 a=ZvkN53RyrFzj2rA+7ad7AA==:17 a=IkcTkHD0fZMA:10 a=NEAV23lmAAAA:8 a=FBHGMhGWAAAA:8 a=bkRfpRdZppEIM01-l_gA:9 a=QEXdDO2ut3YA:10 a=9gvnlMMaQFpL9xblJ6ne:22 Received: from [192.168.2.49] (174.95.58.126) by cmx-mtlrgo002.bell.net (5.8.814) (authenticated as dave.anglin@bell.net) id 640C55490207ABAC; Sun, 26 Mar 2023 21:58:19 -0400 Message-ID: <20cc14ed-d49d-d655-b866-f8f9bb49e0eb@bell.net> Date: Sun, 26 Mar 2023 21:58:19 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 Subject: Re: [committed] hppa: Drop 16-byte pthread lock alignment Content-Language: en-US To: Sam James , Florian Weimer Cc: John David Anglin , deller@gmx.de, libc-alpha@sourceware.org References: <87sfdrvxry.fsf@mid.deneb.enyo.de> <87zg7zc9km.fsf@gentoo.org> From: John David Anglin In-Reply-To: <87zg7zc9km.fsf@gentoo.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.0 required=5.0 tests=BAYES_00,KAM_DMARC_STATUS,NICE_REPLY_A,SPF_HELO_PASS,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 2023-03-26 8:37 p.m., Sam James wrote: > Florian Weimer writes: > >> * John David Anglin: >> >>> hppa: Drop 16-byte pthread lock alignment >>> >>> Linux threads were removed about 12 years ago and the current >>> nptl implementation only requires 4-byte alignment for pthread >>> locks. >>> >>> The 16-byte alignment causes various issues. For example in >>> building ignition-msgs, we have: >>> >>> /usr/include/google/protobuf/map.h:124:37: error: static assertion failed >>> 124 | static_assert(alignof(value_type) <= 8, ""); >>> | ~~~~~~~~~~~~~~~~~~~~^~~~ >>> >>> This is caused by the 16-byte pthread lock alignment. >> This was done deliberately to preserve ABI. This change needs a mass >> rebuild because struct offsets after pthread_mutex_t members are >> likely to change. Although the change may change some structure offsets, I don't believe the change requires a mass rebuild. I am running a Debian hppa system with the reduced lock alignment and so far I haven't observed any breakage. I checked this prior to committing the change. Packages in Debian unstable are rebuilt frequently. I don't see that we had much choice.  Either we break the ABI or we live with packages that don't work on hppa. Here is comment in map.h:   // MapAllocator does not support alignments beyond 8. Technically we should   // support up to std::max_align_t, but this fails with ubsan and tcmalloc   // debug allocation logic which assume 8 as default alignment.   static_assert(alignof(value_type) <= 8, ""); It was the above comment that convinced me that we needed to change the pthread lock alignment. The analysis in the protobuf issue is exactly correct: https://github.com/protocolbuffers/protobuf/issues/9433 Protobuf is not the only package affected by this issue. Regards, Dave -- John David Anglin dave.anglin@bell.net