From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by sourceware.org (Postfix) with ESMTPS id DFF8C3882038 for ; Fri, 30 Jun 2023 16:08:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org DFF8C3882038 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=linux.vnet.ibm.com Authentication-Results: sourceware.org; spf=none smtp.mailfrom=linux.vnet.ibm.com Received: from pps.filterd (m0353725.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 35UG5tjD007098; Fri, 30 Jun 2023 16:08:50 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=content-type : message-id : date : mime-version : subject : to : cc : references : from : in-reply-to; s=pp1; bh=IhGj/h40U5+lO57IhnE7WUySMRr9YTAm+oA+lv3FZYo=; b=j8t+VtwWeHoyJ3IwLi1LQ1FlvPFH8/h+NFIG6fHdwdFrwVy3r0piiWdrSZQrFP8h+w8f q8uI7zdZFCVpqb+/lALpGq96SWQi38iBbY0fT0xE7MSSGi8LsFz4ldQnIsiWw4oGulLo lSBla3IdO1EeeNYdqnK0jqN6g85k7toBVySRbtVI/TIZ1KEjs41p6Zg/OeRbAYff+SRI x6a8gzHTTwUwKvQG5xoXa/5QCwiMAIhvhYs++4Zj18k53qaN6f/LuyGg5XJpsMS8D4Hs a63xYFWDrJmGkCMGogZhKbLZuQrRxwX+mS1K5PHa3Wy5JWC15id4kWTdwb3wiHEjhGcJ 1w== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3rj2940762-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 30 Jun 2023 16:08:49 +0000 Received: from m0353725.ppops.net (m0353725.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 35UG69jB008174; Fri, 30 Jun 2023 16:08:45 GMT Received: from ppma01wdc.us.ibm.com (fd.55.37a9.ip4.static.sl-reverse.com [169.55.85.253]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3rj29406nh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 30 Jun 2023 16:08:45 +0000 Received: from pps.filterd (ppma01wdc.us.ibm.com [127.0.0.1]) by ppma01wdc.us.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 35UFaJ8G013240; Fri, 30 Jun 2023 16:08:37 GMT Received: from smtprelay04.wdc07v.mail.ibm.com ([9.208.129.114]) by ppma01wdc.us.ibm.com (PPS) with ESMTPS id 3rdr460x0j-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 30 Jun 2023 16:08:37 +0000 Received: from smtpav04.wdc07v.mail.ibm.com (smtpav04.wdc07v.mail.ibm.com [10.39.53.231]) by smtprelay04.wdc07v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 35UG8aWF38404544 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 30 Jun 2023 16:08:36 GMT Received: from smtpav04.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E6B4E58045; Fri, 30 Jun 2023 16:08:35 +0000 (GMT) Received: from smtpav04.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7FDAC58054; Fri, 30 Jun 2023 16:08:35 +0000 (GMT) Received: from [9.61.166.91] (unknown [9.61.166.91]) by smtpav04.wdc07v.mail.ibm.com (Postfix) with ESMTP; Fri, 30 Jun 2023 16:08:35 +0000 (GMT) Content-Type: multipart/alternative; boundary="------------wnZjWf8sPsgoKOp0wWo46Nmg" Message-ID: <156dccb0-4208-cfab-1edf-292d27cf01e5@linux.vnet.ibm.com> Date: Fri, 30 Jun 2023 11:08:35 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: [PATCH v3 06/16] asprintf_chk: Ensure compatibility for both s390x and ppc64le Content-Language: en-US To: Siddhesh Poyarekar , =?UTF-8?B?RnLDqWTDqXJpYyBCw6lyYXQ=?= , libc-alpha@sourceware.org Cc: Stefan Liebler , Paul E Murphy References: <20230628084246.778302-1-fberat@redhat.com> <20230628084246.778302-7-fberat@redhat.com> <3944c634-1f67-1b67-d0fe-bd67238ecad1@gotplt.org> From: Rajalakshmi Srinivasaraghavan In-Reply-To: <3944c634-1f67-1b67-d0fe-bd67238ecad1@gotplt.org> X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: sodhSvF_pewWrYm3PQaJpWQrfbFBpcAV X-Proofpoint-GUID: Ss0Rm0gCWTdP4QFLWoGZg-0ApTKyUF7o X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-06-30_08,2023-06-30_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 adultscore=0 mlxscore=0 spamscore=0 mlxlogscore=999 malwarescore=0 priorityscore=1501 bulkscore=0 clxscore=1015 lowpriorityscore=0 impostorscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2305260000 definitions=main-2306300137 X-Spam-Status: No, score=-9.7 required=5.0 tests=BAYES_00,BODY_8BITS,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,GIT_PATCH_0,HTML_MESSAGE,NICE_REPLY_A,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE 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: This is a multi-part message in MIME format. --------------wnZjWf8sPsgoKOp0wWo46Nmg Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 6/30/23 10:11 AM, Siddhesh Poyarekar wrote: > Subject: > Re: [PATCH v3 06/16] asprintf_chk: Ensure compatibility for both s390x > and ppc64le > From: > Siddhesh Poyarekar > Date: > 6/30/23, 10:11 AM > > To: > Frédéric Bérat , libc-alpha@sourceware.org > CC: > Stefan Liebler , Rajalakshmi Srinivasaraghavan > > > > > > On 2023-06-28 04:42, Frédéric Bérat wrote: >> If ldbl_* macros are used for asprintf, ABI gets broken on s390x, >> if it isn't, ppc64le isn't building due to multiple asm redirections. >> >> This is due to the inclusion of bits/stdio-lbdl.h for ppc64le whereas it >> isn't for s390x. This header creates redirections, which are not >> compatible with the ones generated using libc_hidden_builtin_def. >> Yet, we can't use libc_hidden_ldbl_proto on s390x since it will not >> create a simple strong alias (e.g. as done on x86_64), but a versioned >> alias, leading to ABI breakage. >> --- > > Looks OK to me, but deferring to the IBM maintainers.  Raji, Stefan, > does this look right to you? Paul Murphy is our expert on this topic.  Paul,  Can you comment on this too?  Thanks. > > Thanks, > Sid > > >> debug/asprintf_chk.c | 12 ++++++++++++ >>   include/stdio.h      |  5 +++++ >>   2 files changed, 17 insertions(+) >> >> diff --git a/debug/asprintf_chk.c b/debug/asprintf_chk.c >> index 06d112de00..7da1cddacb 100644 >> --- a/debug/asprintf_chk.c >> +++ b/debug/asprintf_chk.c >> @@ -36,5 +36,17 @@ ___asprintf_chk (char **result_ptr, int flag, >> const char *format, ...) >>       return ret; >>   } >> +#if defined __LDBL_COMPAT || __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 >> +/* This is needed since is included in this >> case, leading to >> + * multiple asm redirection of the same symbol >> + */ >>   ldbl_hidden_def (___asprintf_chk, __asprintf_chk) >>   ldbl_strong_alias (___asprintf_chk, __asprintf_chk) >> +#else >> +/* Yet, we can't use ldbl_* macros on some systems, even if they >> don't fall in >> + * the first case as this leads to ABI breakage due to the >> long_double_symbol >> + * aliasing, which is versionned. >> + */ >> +strong_alias (___asprintf_chk, __asprintf_chk) >> +libc_hidden_builtin_def (__asprintf_chk) >> +#endif >> diff --git a/include/stdio.h b/include/stdio.h >> index 3afb0ff77b..6755877911 100644 >> --- a/include/stdio.h >> +++ b/include/stdio.h >> @@ -279,7 +279,12 @@ rtld_hidden_proto (__libc_fatal) >>     libc_hidden_proto (__fgets_unlocked_chk) >>   +#if defined __LDBL_COMPAT || __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 >>   libc_hidden_ldbl_proto (__asprintf_chk) >> +#else >> +libc_hidden_proto (__asprintf_chk) >> +#endif >> + >>   libc_hidden_ldbl_proto (__fprintf_chk) >>   libc_hidden_ldbl_proto (__sprintf_chk) >>   libc_hidden_ldbl_proto (__vsprintf_chk) --------------wnZjWf8sPsgoKOp0wWo46Nmg--