From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oi1-x22b.google.com (mail-oi1-x22b.google.com [IPv6:2607:f8b0:4864:20::22b]) by sourceware.org (Postfix) with ESMTPS id 430FB3858D37 for ; Wed, 5 Oct 2022 17:38:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 430FB3858D37 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-oi1-x22b.google.com with SMTP id g130so18336998oia.13 for ; Wed, 05 Oct 2022 10:38:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:in-reply-to:organization:from:references :cc:to:content-language:subject:user-agent:mime-version:date :message-id:from:to:cc:subject:date; bh=tOdkU21++dI6nuyGv1Nnuj4EJAQDB3eEmbg5BCaYAdM=; b=jNH7UZ6Ht5wj6BDTiDlYnm8MUneFVw/Bt/r8K5j/V+8TRdQzsGs3Xcor4dMtGEX+8m 7h+WiS87njyALyqss4C9tpbL4Kq1mrd2U88217lnJJYOmWqxM+TGKhuzdCnUGmqkQOyu bgzS5bdmoxWbpIfWnW6euKcDCBT9l6Kgf/veH6AY/KYmkfHWsSnM2xkhTK3L7Lb9arsr URz1niq9XpC7Se4+nsKRxDkpqUVr4QDDJkNAwGIopW3kwCk7BY1Lsc8G6tVZa4cXalVl 948NTYhlgd/3ssggJd4aBbjouit4Bf89QjNprM96OG6UzpHNSgL4PB6Z7NCyj/DN3n2g BIaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:organization:from:references :cc:to:content-language:subject:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date; bh=tOdkU21++dI6nuyGv1Nnuj4EJAQDB3eEmbg5BCaYAdM=; b=5k2wYgrgoID6BW58ycauz53SO3qWFkOYuCNI++qq7oQg7VHWm+m6Mmzr8Or7+r8Kxd SVkNU7/DgiU6leubGtXYgPRLSyo0/Sa9VAJ9PxXY688bAqszXgw7AqS59f4nIC6e/Xhe MjfD1v6D11GDdOXypsyAZHeCHS3MSymVIDRMjVZZQAl7fO4UaqAlxuorht54zioVVHmD U1/JGeAM2ZyWiFo4y4+GiWsCmRG/FJiNjzRfmKEOOPDvhwCWh7ssMTz0nZwiAURjf/Ti tIaonY5G7osGKOcxd5iwa4vZXQxU2xedHCmA6EMuIDo/umlfPVnRkU+ewgqGKVUVbAPO sD8Q== X-Gm-Message-State: ACrzQf38JDSUG59AydB5AsQ9fDnaGpmmh6AxRgL3S/D+LTjrnNJYd4Xn g2IzC7tZGhsuuV0WTKO6RMIhxw== X-Google-Smtp-Source: AMsMyM5HNj/cY4GAb6E1fge7Wq4hPwTlxgViTeNCli2dx6nCdey/nFTKhvbrls97TGzRQFSsJnyhhw== X-Received: by 2002:a05:6808:15a2:b0:350:4f5c:1440 with SMTP id t34-20020a05680815a200b003504f5c1440mr2896308oiw.129.1664991517669; Wed, 05 Oct 2022 10:38:37 -0700 (PDT) Received: from ?IPV6:2804:1b3:a7c2:b87d:f903:d4b9:fce3:59f9? ([2804:1b3:a7c2:b87d:f903:d4b9:fce3:59f9]) by smtp.gmail.com with ESMTPSA id y14-20020a056870b48e00b00127fbb7afffsm3113077oap.5.2022.10.05.10.38.36 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 05 Oct 2022 10:38:37 -0700 (PDT) Message-ID: Date: Wed, 5 Oct 2022 14:38:35 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.3.1 Subject: Re: [PATCH 6/6] x86: Fix -Os build (BZ #29576) Content-Language: en-US To: "H.J. Lu" , Carlos O'Donell Cc: libc-alpha@sourceware.org References: <20220921135108.3324737-1-adhemerval.zanella@linaro.org> <20220921135108.3324737-7-adhemerval.zanella@linaro.org> From: Adhemerval Zanella Netto Organization: Linaro In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-13.8 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,KAM_SHORT,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,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 05/10/22 14:21, H.J. Lu wrote: > On Wed, Oct 5, 2022 at 7:10 AM Carlos O'Donell wrote: >> >> On Wed, Sep 21, 2022 at 10:51:08AM -0300, Adhemerval Zanella via Libc-alpha wrote: >>> The compiler might transform __stpcpy calls (which are routed to >>> __builtin_stpcpy as an optimization) to strcpy and x86_64 strcpy >>> multiarch implementation does not build any working symbol due >>> ISA_SHOULD_BUILD not being evaluated for IS_IN(rtld). >> >> Ohhhhhh... that is interesting. This changes the strcpy used in rtld for >> all x86_64 build options, and I'm going to ACK this, but we may need to >> revisit this if it shows up in a profile. > > Will this lead to both strcpy and stpcpy in ld.so? Currently there is only > stpcpy in ld.so. I think that is expected behavior if compiler creates a reference for a supported string function in the loader (rtld build pulls the implementation). > >> CC'ing HJ here in case he wants to comment as a machine maintainer. >> >> LGTM. >> >> No regressions on x86_64. >> >> Reviewed-by: Carlos O'Donell >> Tested-by: Carlos O'Donell >> >>> Checked on x86_64-linux-gnu. >>> --- >>> sysdeps/x86_64/multiarch/rtld-strcpy.S | 18 ++++++++++++++++++ >>> 1 file changed, 18 insertions(+) >>> create mode 100644 sysdeps/x86_64/multiarch/rtld-strcpy.S >>> >>> diff --git a/sysdeps/x86_64/multiarch/rtld-strcpy.S b/sysdeps/x86_64/multiarch/rtld-strcpy.S >>> new file mode 100644 >>> index 0000000000..19439c553d >>> --- /dev/null >>> +++ b/sysdeps/x86_64/multiarch/rtld-strcpy.S >>> @@ -0,0 +1,18 @@ >>> +/* Copyright (C) 2022 Free Software Foundation, Inc. >>> + This file is part of the GNU C Library. >>> + >>> + The GNU C Library is free software; you can redistribute it and/or >>> + modify it under the terms of the GNU Lesser General Public >>> + License as published by the Free Software Foundation; either >>> + version 2.1 of the License, or (at your option) any later version. >>> + >>> + The GNU C Library is distributed in the hope that it will be useful, >>> + but WITHOUT ANY WARRANTY; without even the implied warranty of >>> + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU >>> + Lesser General Public License for more details. >>> + >>> + You should have received a copy of the GNU Lesser General Public >>> + License along with the GNU C Library; if not, see >>> + . */ >>> + >>> +#include "../strcpy.S" >> >> OK. Uses Makeconfig:sysd-rules-patterns to capture rtld-*. >> >>> -- >>> 2.34.1 >>> >> > >