From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by sourceware.org (Postfix) with ESMTPS id C43DB3857801 for ; Mon, 16 Nov 2020 20:49:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org C43DB3857801 Received: from pps.filterd (m0098414.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 0AGKW4ou004967 for ; Mon, 16 Nov 2020 15:49:41 -0500 Received: from pps.reinject (localhost [127.0.0.1]) by mx0b-001b2d01.pphosted.com with ESMTP id 34usvfm2xe-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 16 Nov 2020 15:49:41 -0500 Received: from m0098414.ppops.net (m0098414.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 0AGKhksC041609 for ; Mon, 16 Nov 2020 15:49:40 -0500 Received: from ppma01dal.us.ibm.com (83.d6.3fa9.ip4.static.sl-reverse.com [169.63.214.131]) by mx0b-001b2d01.pphosted.com with ESMTP id 34usvfm2x9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 16 Nov 2020 15:49:40 -0500 Received: from pps.filterd (ppma01dal.us.ibm.com [127.0.0.1]) by ppma01dal.us.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 0AGKgUDr032377; Mon, 16 Nov 2020 20:49:40 GMT Received: from b01cxnp22034.gho.pok.ibm.com (b01cxnp22034.gho.pok.ibm.com [9.57.198.24]) by ppma01dal.us.ibm.com with ESMTP id 34uttr2p5j-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 16 Nov 2020 20:49:40 +0000 Received: from b01ledav004.gho.pok.ibm.com (b01ledav004.gho.pok.ibm.com [9.57.199.109]) by b01cxnp22034.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 0AGKndZQ8258088 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 16 Nov 2020 20:49:39 GMT Received: from b01ledav004.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 34CCD112063; Mon, 16 Nov 2020 20:49:39 +0000 (GMT) Received: from b01ledav004.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id DC8A6112061; Mon, 16 Nov 2020 20:49:37 +0000 (GMT) Received: from [9.160.10.22] (unknown [9.160.10.22]) by b01ledav004.gho.pok.ibm.com (Postfix) with ESMTP; Mon, 16 Nov 2020 20:49:37 +0000 (GMT) Subject: Re: [2.32] struct _Unwind_Exception alignment should not depend on compiler flags To: tuliom@linux.ibm.com, fweimer@redhat.com, Libc-stable Mailing List References: <20201116204659.40340-1-msc@linux.ibm.com> From: Matheus Castanho Message-ID: <77a05ee0-9d5e-98fe-7586-21361e1a1aa8@linux.ibm.com> Date: Mon, 16 Nov 2020 17:49:36 -0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.4.0 MIME-Version: 1.0 In-Reply-To: <20201116204659.40340-1-msc@linux.ibm.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.312, 18.0.737 definitions=2020-11-16_10:2020-11-13, 2020-11-16 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 clxscore=1011 priorityscore=1501 impostorscore=0 mlxscore=0 bulkscore=0 malwarescore=0 phishscore=0 mlxlogscore=999 lowpriorityscore=0 suspectscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2011160116 X-Spam-Status: No, score=-11.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, GIT_PATCH_0, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP, URIBL_BLACK autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-stable@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-stable mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Nov 2020 20:49:43 -0000 Sorry, sent to the wrong list. - libc-alpha + libc-stable On 11/16/20 5:46 PM, Matheus Castanho via Libc-alpha wrote: > From: Florian Weimer > > Hi Florian and Tulio, > > Could we backport this patch to the 2.32 branch? It would be helpful to fix the > issue downstream. > > Thanks, > Matheus Castanho > > ---8<--- > > __attribute__((__aligned__)) selects an alignment that depends on > the micro-architecture selected by GCC flags. Enabling vector > extensions may increase the allignment. This is a problem when > building glibc as a collection of ELF multilibs with different > GCC flags because ld.so and libc.so/libpthread.so/&c may end up > with a different layout of struct pthread because of the > changing offset of its struct _Unwind_Exception field. > > Tested-By: Matheus Castanho > > (cherry picked from commit 30af7c7fa13e17d82c3f1f91536384715844f432) > --- > sysdeps/generic/unwind.h | 24 +++++++++++++++--------- > 1 file changed, 15 insertions(+), 9 deletions(-) > > diff --git a/sysdeps/generic/unwind.h b/sysdeps/generic/unwind.h > index b667a5b652..c229603af3 100644 > --- a/sysdeps/generic/unwind.h > +++ b/sysdeps/generic/unwind.h > @@ -75,15 +75,21 @@ typedef void (*_Unwind_Exception_Cleanup_Fn) (_Unwind_Reason_Code, > > struct _Unwind_Exception > { > - _Unwind_Exception_Class exception_class; > - _Unwind_Exception_Cleanup_Fn exception_cleanup; > - _Unwind_Word private_1; > - _Unwind_Word private_2; > - > - /* @@@ The IA-64 ABI says that this structure must be double-word aligned. > - Taking that literally does not make much sense generically. Instead we > - provide the maximum alignment required by any type for the machine. */ > -} __attribute__((__aligned__)); > + union > + { > + struct > + { > + _Unwind_Exception_Class exception_class; > + _Unwind_Exception_Cleanup_Fn exception_cleanup; > + _Unwind_Word private_1; > + _Unwind_Word private_2; > + }; > + > + /* The IA-64 ABI says that this structure must be double-word aligned. */ > + _Unwind_Word unwind_exception_align[2] > + __attribute__ ((__aligned__ (2 * sizeof (_Unwind_Word)))); > + }; > +}; > > > /* The ACTIONS argument to the personality routine is a bitwise OR of one > -- > 2.26.2 >