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 27E783858D20 for ; Wed, 31 Jan 2024 12:09:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 27E783858D20 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=linux.ibm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linux.ibm.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 27E783858D20 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=148.163.158.5 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706702944; cv=none; b=KOm5e6WlegZrSKqln+A5d0++wFFoJKZZQJpLKw4xoz/I0y5wGLdJ31Vv6050aBBrev+5prx3X6Yt47KEZki2mCAgimIj3l/4XY3y2HSDD7Iaxk2m2TgZih/Ww3BiMXEORaFT/yKI2igauqdOutMeZ8+JRwqAgW9Td6xtI/bn7Yk= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706702944; c=relaxed/simple; bh=Vf8IcjD3oFNDBRbG/1QURmAywq1+s9eX4BE4LZSkZFk=; h=DKIM-Signature:Message-ID:Date:Subject:To:From:MIME-Version; b=I0VjoxQxUPN6p4fmLGdIgdmbK5IIP2sJkZu6VQB2zY0a8+ZYS8wJ/YMV/hzLzqzCdQShMsnyRcQnuRTYvlgwaLIARHtAIFicNQIBCS1V8AzGccosiDpnEyfTOICnwI9+aFd8UpyJF4hNnSRzevhSLZebJudQhCeJ35h05XVf0mo= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from pps.filterd (m0353723.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 40VBMRNi030025; Wed, 31 Jan 2024 12:09:01 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=message-id : date : subject : to : references : from : in-reply-to : content-type : content-transfer-encoding : mime-version; s=pp1; bh=u0mhFbJH8cOOW0WFSIMyBMXqLJTPIHj6ngwp55HBuR8=; b=p6pqwIxZXm6yWSDQcb44Iz8nG+hLranEhGTrLDDX+Tado3foQJD/pn47kj6vmhxuvNEo kfd7RaKUTCcqc0yY0eFI5VAUrjXhX5A0eQiMZPCfv0Ks/WcdrM+kf2J13lRyD62FFRWU 6Nlr2nvLIJFwAjWFlJDDBEQOjtgqegYYBgYr1+qfc5MY1Qmnea+ldk4mQFUOPFvFoJd4 8f1+lg3US9dc1Eyo/hLYoFsWjNdxYZH8lJ7AFe1YqQklidQcpLkhDwq4bf1nAJdBWuVD qm7TcuscRmS7brYek4yjUETEKru65pcvQxF0r5miu+nGQToiqsUBytTwW1e3ZX7g0hOV /g== Received: from ppma23.wdc07v.mail.ibm.com (5d.69.3da9.ip4.static.sl-reverse.com [169.61.105.93]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3vyn998uk3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 31 Jan 2024 12:08:59 +0000 Received: from pps.filterd (ppma23.wdc07v.mail.ibm.com [127.0.0.1]) by ppma23.wdc07v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 40VC5pZ0008234; Wed, 31 Jan 2024 12:06:40 GMT Received: from smtprelay07.fra02v.mail.ibm.com ([9.218.2.229]) by ppma23.wdc07v.mail.ibm.com (PPS) with ESMTPS id 3vwdnm53vw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 31 Jan 2024 12:06:40 +0000 Received: from smtpav01.fra02v.mail.ibm.com (smtpav01.fra02v.mail.ibm.com [10.20.54.100]) by smtprelay07.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 40VC6cM049086772 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 31 Jan 2024 12:06:38 GMT Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 0820920040; Wed, 31 Jan 2024 12:06:38 +0000 (GMT) Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E3DA12004B; Wed, 31 Jan 2024 12:06:37 +0000 (GMT) Received: from [9.152.222.232] (unknown [9.152.222.232]) by smtpav01.fra02v.mail.ibm.com (Postfix) with ESMTP; Wed, 31 Jan 2024 12:06:37 +0000 (GMT) Message-ID: Date: Wed, 31 Jan 2024 13:06:37 +0100 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] S390: Fix building with --disable-mutli-arch [BZ #31196] Content-Language: en-US To: Adhemerval Zanella Netto , libc-alpha@sourceware.org References: <20240130083432.544403-1-stli@linux.ibm.com> <126240ac-8194-4e92-b3b8-fe8b2820b6c4@linaro.org> From: Stefan Liebler In-Reply-To: <126240ac-8194-4e92-b3b8-fe8b2820b6c4@linaro.org> Content-Type: text/plain; charset=UTF-8 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: MZBwPbwCdAYLFvAduYUvBx2gBSpVZ7Yj X-Proofpoint-ORIG-GUID: MZBwPbwCdAYLFvAduYUvBx2gBSpVZ7Yj Content-Transfer-Encoding: 8bit X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-01-31_06,2024-01-30_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 impostorscore=0 phishscore=0 malwarescore=0 spamscore=0 priorityscore=1501 mlxlogscore=443 mlxscore=0 suspectscore=0 lowpriorityscore=0 clxscore=1015 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2401310092 X-Spam-Status: No, score=-5.2 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS,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: On 30.01.24 18:21, Adhemerval Zanella Netto wrote: > > > On 30/01/24 05:34, Stefan Liebler wrote: >> Starting with commits >> - 7ea510127e2067efa07865158ac92c330c379950 >> string: Add libc_hidden_proto for strchrnul >> - 22999b2f0fb62eed1af4095d062bd1272d6afeb1 >> string: Add libc_hidden_proto for memrchr >> >> building glibc on s390x with --disable-multi-arch fails if only >> the C-variant of strchrnul / memrchr is used. This is the case >> if gcc uses -march < z13. >> >> The build fails with: >> ../sysdeps/s390/strchrnul-c.c:28:49: error: ‘__strchrnul_c’ undeclared here (not in a function); did you mean ‘__strchrnul’? >> 28 | __hidden_ver1 (__strchrnul_c, __GI___strchrnul, __strchrnul_c); >> >> With --disable-multi-arch, __strchrnul_c is not available as string/strchrnul.c >> is just included without defining STRCHRNUL and thus we also don't have to create >> the internal hidden symbol. > > LGTM, thanks. In same topic, why s390 is not following the multiarch sysdep > folder organization followed by all others ports, where ifunc implementation > are put only in multiarch folder? > > The multiarch mechanism was added to simplify this kind of code, the s390 > seems gratuitous over complicated in this regard. > Thanks for reviewing. Andreas has already committed it to be within glibc 2.39 release. Yes, the mechanism on s390 is complicated. It decides at build time which variants are needed depending on the gcc -march=cpu-level. If the cpu-level is new enough, it skips generating IFUNC at all and just uses the variant for the latest cpu-level directly. Also the __GI symbol points to this variant and it is also used in ld.so. If IFUNC is used, variants for older than the used cpu-level are omitted. And the __GI symbols point to the variants fitting best to the specified cpu-level. Those are also used in ld.so. Newer variants are available via IFUNC. E.g. sysdeps/x86_64/strlen.S is also using a mechanism to determine the default implementation. There it just includes the concrete xyz.S file in multiarch directory. On s390 we have plenty of cases where we have an assembler implementation for e.g. z13-vector-instructions and for older cpu-levels the common-code implementation in C. Thus we can't just do an include like done in sysdeps/x86_64/strlen.S. Therefore all the variants are not in the multiarch-folder and there are the guards with #if directives to omit or include the variant. As the __GI symbol is pointing to a concrete variant instead of to the IFUNC symbol, maintaining those is more complicated. I've just posted this patch to add more configurations in build-many-glibcs.py: [PATCH] build-many-glibcs.py: Add s390 --disable-multi-arch / multi-arch configurations. https://sourceware.org/pipermail/libc-alpha/2024-January/154342.html