From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gecko.ash.relay.mailchannels.net (gecko.ash.relay.mailchannels.net [23.83.222.66]) by sourceware.org (Postfix) with ESMTPS id 7E3203858D20 for ; Tue, 8 Aug 2023 21:59:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7E3203858D20 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=gotplt.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gotplt.org X-Sender-Id: dreamhost|x-authsender|siddhesh@gotplt.org Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id D3CA63627D4; Tue, 8 Aug 2023 21:59:44 +0000 (UTC) Received: from pdx1-sub0-mail-a209.dreamhost.com (unknown [127.0.0.6]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 59C46362834; Tue, 8 Aug 2023 21:59:44 +0000 (UTC) ARC-Seal: i=1; s=arc-2022; d=mailchannels.net; t=1691531984; a=rsa-sha256; cv=none; b=VjUqH2x3MQmTkigYiyETjJd6o3K6ljs69mLbp3v24zdPwLdOoomihHAg/nIkeWOm0QNDwN 5HtCv8hp46h2DrquOd33htiPiQKQFQgctORn6gu0vrObQUhGxWAKKDBO8pYyK11gfC/pWN Oth+2nJ+Er8wrQtvjt54R5X0XuunhJ5VshRcDuJl7oSQ6MoKc1x5S5ZxzLcsXQCDIdkP8c IFsL8H5OYQOwTmIIQdWrbJEOkCSne+Qycimr8n/VIijkPvcCfHzyuPK75L5K4bZWUlc0Co 2twzKjBPsiwc4HUuQKHsU9PhuLG1l+ZTAyYX8kProjpeXPcwkPFPayFl710orA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=mailchannels.net; s=arc-2022; t=1691531984; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=xAjTt+5Ft+gjakQ2BL3z60hMFraQKGmNNvt4MbQ0zpM=; b=cWJPL8eu833zCeotpm1hUfWjoE0aMcryAjhWxzSgT/cFgtAfQXp0u5r2otwSg928Nd9Ko/ M8ZBGyzhY5Mk03xnwCVfTDhNZofz0bnEXbNb8x7SbuN5+iLtqKRyvifig98sZuPIvAMC7k uhz7Yddj+dKPvxpK7csDskGwNLL+Mns9jLCaS3xmmXN0Di6dCQ7zjqhs8tqh1LbvrbORz6 FLyYad92cLlezhQGxe3y8ujjqwiG0wBN2YtDpDYXvN4lrEpSWiB9qq/ddFzmPHCxKxEcW1 GGmuvMh6o9OtCkt1L59SMqNQFoUjVWB2FMmvZ+O/jcJOpeWSAzz7l9ynY6a2BA== ARC-Authentication-Results: i=1; rspamd-749bd77c9c-f4jsh; auth=pass smtp.auth=dreamhost smtp.mailfrom=siddhesh@gotplt.org X-Sender-Id: dreamhost|x-authsender|siddhesh@gotplt.org X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|siddhesh@gotplt.org X-MailChannels-Auth-Id: dreamhost X-Cellar-Vacuous: 389e85a5552d9a59_1691531984616_259786472 X-MC-Loop-Signature: 1691531984616:728511923 X-MC-Ingress-Time: 1691531984615 Received: from pdx1-sub0-mail-a209.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384) by 100.126.240.200 (trex/6.9.1); Tue, 08 Aug 2023 21:59:44 +0000 Received: from [192.168.2.12] (bras-vprn-toroon4834w-lp130-02-142-113-138-184.dsl.bell.ca [142.113.138.184]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: siddhesh@gotplt.org) by pdx1-sub0-mail-a209.dreamhost.com (Postfix) with ESMTPSA id 4RL6YC6Wn2zB3; Tue, 8 Aug 2023 14:59:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gotplt.org; s=dreamhost; t=1691531984; bh=PktkuBNXydEXIiVE3amTsD2AUxZ02uw+jWsOOmJQ8Us=; h=Date:Subject:To:From:Content-Type:Content-Transfer-Encoding; b=fS3AgETrpEChawClrbTLnXB7j0lV/0RUVq/x77X1gOzHyHUKm25WSm2nmXOTKXGQN Ygbf9/cnbBWBRoUTpmL2VdHJQzb4HjZNKan9GneClLFe8QJ3gr2YoUuL5lAjuZiuR4 8if0BQJF0hTi9/EDYfgtTKBujDmfZ0vZJn+UGPq9ifiGLiuDqbNcCKBzQDMvGsssh+ WqmW66PbWROjkncQHTtbYldp7JaEYU0q+BPtGjWaNBrNTHCzPtKIukp8adXOsum9+z I5a4hDOVtKw8Js52JiIAht/2ZaBSQtoIZLyWquZEp5/5OBcwxz2rP8TYUdCJSEzuwo zZXtjNDg5hbcQ== Message-ID: Date: Tue, 8 Aug 2023 17:59:42 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 Subject: Re: [PATCH 2/2] i686: Fix build with --disable-multiarch Content-Language: en-US To: Adhemerval Zanella , libc-alpha@sourceware.org, "Andreas K . Huettel" References: <20230808122755.66307-1-adhemerval.zanella@linaro.org> <20230808122755.66307-3-adhemerval.zanella@linaro.org> From: Siddhesh Poyarekar In-Reply-To: <20230808122755.66307-3-adhemerval.zanella@linaro.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3038.2 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,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 2023-08-08 08:27, Adhemerval Zanella via Libc-alpha wrote: > Since i686 provides the fortified wrappers for memcpy, mempcpy, > memmove, and memset on the same string implementation, the static > build tries to optimized it by not tying the fortified wrappers > to string routine (to avoid pulling the fortify function if > they are not required). > > Checked on i686-linux-gnu building with different option: > default and --disable-multi-arch plus default, --disable-default-pie, > --enable-fortify-source={2,3}, and --enable-fortify-source={2,3} > with --disable-default-pie. > --- LGTM, also tested with: ../configure CC="gcc -m32" CXX="g++ -m32" --build=i686-pc-linux-gnu --host=i686-pc-linux-gnu --prefix=/usr --enable-fortify-source --disable-default-pie Reviewed-by: Siddhesh Poyarekar > sysdeps/i386/i686/memcpy.S | 2 +- > sysdeps/i386/i686/mempcpy.S | 2 +- > sysdeps/i386/i686/multiarch/memcpy_chk.c | 2 ++ > sysdeps/i386/i686/multiarch/memmove_chk.c | 2 ++ > sysdeps/i386/i686/multiarch/mempcpy_chk.c | 2 ++ > sysdeps/i386/i686/multiarch/memset_chk.c | 2 ++ > 6 files changed, 10 insertions(+), 2 deletions(-) > > diff --git a/sysdeps/i386/i686/memcpy.S b/sysdeps/i386/i686/memcpy.S > index 9b48ec0ea1..b86af4aac9 100644 > --- a/sysdeps/i386/i686/memcpy.S > +++ b/sysdeps/i386/i686/memcpy.S > @@ -27,7 +27,7 @@ > #define LEN SRC+4 > > .text > -#if defined PIC && IS_IN (libc) > +#if defined SHARED && IS_IN (libc) > ENTRY_CHK (__memcpy_chk) > movl 12(%esp), %eax > cmpl %eax, 16(%esp) > diff --git a/sysdeps/i386/i686/mempcpy.S b/sysdeps/i386/i686/mempcpy.S > index 26f8501e7d..14d9dd681a 100644 > --- a/sysdeps/i386/i686/mempcpy.S > +++ b/sysdeps/i386/i686/mempcpy.S > @@ -27,7 +27,7 @@ > #define LEN SRC+4 > > .text > -#if defined PIC && IS_IN (libc) > +#if defined SHARED && IS_IN (libc) > ENTRY_CHK (__mempcpy_chk) > movl 12(%esp), %eax > cmpl %eax, 16(%esp) > diff --git a/sysdeps/i386/i686/multiarch/memcpy_chk.c b/sysdeps/i386/i686/multiarch/memcpy_chk.c > index ec945dc91f..c3a8aeaf18 100644 > --- a/sysdeps/i386/i686/multiarch/memcpy_chk.c > +++ b/sysdeps/i386/i686/multiarch/memcpy_chk.c > @@ -32,4 +32,6 @@ libc_ifunc_redirected (__redirect_memcpy_chk, __memcpy_chk, > __hidden_ver1 (__memcpy_chk, __GI___memcpy_chk, __redirect_memcpy_chk) > __attribute__ ((visibility ("hidden"))) __attribute_copy__ (__memcpy_chk); > # endif > +#else > +# include > #endif > diff --git a/sysdeps/i386/i686/multiarch/memmove_chk.c b/sysdeps/i386/i686/multiarch/memmove_chk.c > index 55c7601d5d..070dde083a 100644 > --- a/sysdeps/i386/i686/multiarch/memmove_chk.c > +++ b/sysdeps/i386/i686/multiarch/memmove_chk.c > @@ -32,4 +32,6 @@ libc_ifunc_redirected (__redirect_memmove_chk, __memmove_chk, > __hidden_ver1 (__memmove_chk, __GI___memmove_chk, __redirect_memmove_chk) > __attribute__ ((visibility ("hidden"))) __attribute_copy__ (__memmove_chk); > # endif > +#else > +# include > #endif > diff --git a/sysdeps/i386/i686/multiarch/mempcpy_chk.c b/sysdeps/i386/i686/multiarch/mempcpy_chk.c > index 83569cf9d9..14360f1828 100644 > --- a/sysdeps/i386/i686/multiarch/mempcpy_chk.c > +++ b/sysdeps/i386/i686/multiarch/mempcpy_chk.c > @@ -32,4 +32,6 @@ libc_ifunc_redirected (__redirect_mempcpy_chk, __mempcpy_chk, > __hidden_ver1 (__mempcpy_chk, __GI___mempcpy_chk, __redirect_mempcpy_chk) > __attribute__ ((visibility ("hidden"))) __attribute_copy__ (__mempcpy_chk); > # endif > +#else > +# include > #endif > diff --git a/sysdeps/i386/i686/multiarch/memset_chk.c b/sysdeps/i386/i686/multiarch/memset_chk.c > index 1a7503858d..8179ef7c0b 100644 > --- a/sysdeps/i386/i686/multiarch/memset_chk.c > +++ b/sysdeps/i386/i686/multiarch/memset_chk.c > @@ -32,4 +32,6 @@ libc_ifunc_redirected (__redirect_memset_chk, __memset_chk, > __hidden_ver1 (__memset_chk, __GI___memset_chk, __redirect_memset_chk) > __attribute__ ((visibility ("hidden"))) __attribute_copy__ (__memset_chk); > # endif > +#else > +# include > #endif