From patchwork Tue Aug 8 12:27:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 1818595 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=8.43.85.97; helo=server2.sourceware.org; envelope-from=libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=IAwXACjg; dkim-atps=neutral Received: from server2.sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4RKssx5GM7z1yfh for ; Tue, 8 Aug 2023 22:28:21 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 6548F385734D for ; Tue, 8 Aug 2023 12:28:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6548F385734D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1691497699; bh=luJW+/6crfyqRRMXpSyXps58WWXiTmnGdbZ5s8MLICU=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=IAwXACjgYCCXxhWtdBC9knROcx0YK8YwxZiAPyM0tb520sJyU8F8+nb9GCISlDCUb 7mNPTC++iYWF1Dun4TlmBetj6rldQnbbg+6ghNgWLvP2wg5rjmjzwu3fA9c3aUcxla qOSzL21QDDDDtoIMjrAa4j2MntWLAGlOZOXdXaQ8= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-oi1-x234.google.com (mail-oi1-x234.google.com [IPv6:2607:f8b0:4864:20::234]) by sourceware.org (Postfix) with ESMTPS id 884FE3858288 for ; Tue, 8 Aug 2023 12:28:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 884FE3858288 Received: by mail-oi1-x234.google.com with SMTP id 5614622812f47-3a5ad6087a1so3117323b6e.2 for ; Tue, 08 Aug 2023 05:28:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691497683; x=1692102483; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=luJW+/6crfyqRRMXpSyXps58WWXiTmnGdbZ5s8MLICU=; b=a7hwZUb5Z0PKN7R+v5jZcyfD3x62XF1+PehluB57stAdZok/hQtffiUhRPNlAeYT76 TtUF3cLgxejvxyvxlt0nU7cWy7/dYaKqvIAW6FCzhODvXJeVHCr2bNjIwgqrZMGUC/5n Wr8JARK3j41AWTLyWvCvOHJZalLDLfzpgffG1RO3Yps2L7OmWWdI3iTZaMPxEVQSffSA +71bKX+E4je6FvNsjUW3L10uuPQX33Xvb80jO3BBDngfRCNpRRSKYq7PEOFUA8IjD/ww z5iDYiNQgQMfUVjdjVCZsMv2aQbU91ESIUDhe/8l2wQrDG71mCoUtuk1dGm5jTd13iQG YRug== X-Gm-Message-State: AOJu0YzX7HufFOn8htZWCGN0UnfSmkMV5zASCACdoVMIRL2HSSXNYwVs mpWukikd/bCSNCb9VDGDFu3UY3qRA0nfM/UP+fNT8w== X-Google-Smtp-Source: AGHT+IFXbUGM3ad5BKYwaxQuVyxc7cQbt4yQxsLVqH0w8z1mXL4ntdea+ZtBkOj/niubPwpNyaDj5Q== X-Received: by 2002:a05:6808:1382:b0:3a3:820e:2f05 with SMTP id c2-20020a056808138200b003a3820e2f05mr14278796oiw.1.1691497683165; Tue, 08 Aug 2023 05:28:03 -0700 (PDT) Received: from mandiga.. ([2804:1b3:a7c1:9aa9:aad7:32fb:7ea7:f8f5]) by smtp.gmail.com with ESMTPSA id j9-20020a056808118900b003a42c45c109sm5799401oil.2.2023.08.08.05.28.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Aug 2023 05:28:02 -0700 (PDT) To: libc-alpha@sourceware.org, "Andreas K . Huettel" Subject: [PATCH 2/2] i686: Fix build with --disable-multiarch Date: Tue, 8 Aug 2023 09:27:55 -0300 Message-Id: <20230808122755.66307-3-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230808122755.66307-1-adhemerval.zanella@linaro.org> References: <20230808122755.66307-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-12.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, 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 X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Adhemerval Zanella via Libc-alpha From: Adhemerval Zanella Netto Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org Sender: "Libc-alpha" 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. 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