From patchwork Mon Jul 24 17:15:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 1811958 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=2620:52:3:1:0:246e:9693:128c; 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=E1PV/c0z; dkim-atps=neutral Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (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 4R8myh6C4mz1yYc for ; Tue, 25 Jul 2023 03:15:56 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 8BDA13856DD0 for ; Mon, 24 Jul 2023 17:15:54 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8BDA13856DD0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1690218954; bh=luVvpo0erkeDd0qdObtktBos9yyxcg8uHjr8Zl0iPq4=; 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=E1PV/c0zREF72nkRKhT3L3Hn8uXD119Lz/OhpU7fDVMmsWNM39Nff7c5hXuVSeRUN Lwi/Nz0H1bwXAO0TNdIbkeAQ78z97lt9AY6a48OWjC7HDP//wpikGV2CTrWRQLYtDr DduNgwDAyZ/v7FmiAxgv8gBGjn5GJoi4eL0vrtoY= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-oo1-xc29.google.com (mail-oo1-xc29.google.com [IPv6:2607:f8b0:4864:20::c29]) by sourceware.org (Postfix) with ESMTPS id 728A03858C66 for ; Mon, 24 Jul 2023 17:15:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 728A03858C66 Received: by mail-oo1-xc29.google.com with SMTP id 006d021491bc7-56584266c41so2801079eaf.2 for ; Mon, 24 Jul 2023 10:15:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690218932; x=1690823732; 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=luVvpo0erkeDd0qdObtktBos9yyxcg8uHjr8Zl0iPq4=; b=LhxDL5+lq6wRv6UTl/ItHiLno2BxRQqJARe1NOElqU/JPPHOerVqWURA4zynqkGE+Q k5OvNfk0Qm2jtOnJXzwrTZGa8n6G/r5neKFGVKO/JsLuNRJCSD8+CJcPQDwiEDGgncnz QhT2dET6Sfqd3vnGPzvhWHz/VUSoiYVQKlhQev5yS6mBJsV/+KJp801/WIqiBBuhYils cy4HbfkqrvtDOCiWTaP3vTsYea+1BlgbN+id1QKfR8NkFCdSd7txDKwBxeQMxDx8lOaf e4UCSaxW4GPLpgu3xjNIS7Us4yjU0t8qzQub2lRQ/4NdH59kPBOFp7rF2MX6sRu8Hpcc BNSw== X-Gm-Message-State: ABy/qLbNrQriywmV3UGQNzkqdFCJ/LqsN0ddjE8Wf7dERvLgvMn7eXoU Oauvb5OukPUgbW/903d2on8glJZ2uwrpz0K+iYfgJg== X-Google-Smtp-Source: APBJJlGeAS1xKAHVjlEUB71hxF7VG+B7RQFi4cuVFA67KKC4jiGr2WwBjfpl/hynWE4R9/cFm9Gs0A== X-Received: by 2002:a4a:2401:0:b0:566:f94f:cd28 with SMTP id m1-20020a4a2401000000b00566f94fcd28mr9197613oof.3.1690218932066; Mon, 24 Jul 2023 10:15:32 -0700 (PDT) Received: from mandiga.. ([2804:1b3:a7c0:d4d2:46e0:428c:6669:da90]) by smtp.gmail.com with ESMTPSA id x140-20020a4a4192000000b0055e489a7fdasm4602286ooa.0.2023.07.24.10.15.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Jul 2023 10:15:31 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH 1/3] malloc: Fix set-freeres.c with gcc 6 Date: Mon, 24 Jul 2023 14:15:22 -0300 Message-Id: <20230724171524.2687112-2-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230724171524.2687112-1-adhemerval.zanella@linaro.org> References: <20230724171524.2687112-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_NUMSUBJECT, RCVD_IN_DNSWL_NONE, 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 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" Old GCC might trigger the the comparison will always evaluate as ‘true’ warnig for static build: set-freeres.c:87:14: error: the comparison will always evaluate as ‘true’ for the address of ‘__libc_getgrgid_freemem_ptr’ will never be NULL [-Werror=address] if (&__ptr != NULL) \ So add pragma weak for all affected usages. Checked on x86_64 and i686 with gcc 6 and 13. Reviewed-by: Carlos O'Donell --- malloc/set-freeres.c | 46 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/malloc/set-freeres.c b/malloc/set-freeres.c index 1aab34b586..41ef9c2dd6 100644 --- a/malloc/set-freeres.c +++ b/malloc/set-freeres.c @@ -63,6 +63,52 @@ # pragma weak __libpthread_freeres # pragma weak __libc_dlerror_result_free # pragma weak __check_pf_freemem +# pragma weak __libc_fgetgrent_freemem_ptr +# pragma weak __libc_fgetsgent_freeres_ptr +# pragma weak __libc_getnetgrent_freemem_ptr +# pragma weak __libc_rcmd_freemem_ptr +# pragma weak __libc_rexec_freemem_ptr +# pragma weak __libc_mntent_freemem_ptr +# pragma weak __libc_fgetpwent_freemem_ptr +# pragma weak __libc_getspent_freemem_ptr +# pragma weak __libc_resolv_res_hconf_freemem_ptr +# pragma weak __libc_fgetspent_freemem_ptr +# pragma weak __libc_tzfile_freemem_ptr +# pragma weak __libc_getnameinfo_freemem_ptr +# pragma weak __libc_getutent_freemem_ptr +# pragma weak __libc_getutid_freemem_ptr +# pragma weak __libc_getutline_freemem_ptr +# pragma weak __libc_reg_printf_freemem_ptr +# pragma weak __libc_reg_type_freemem_ptr +# pragma weak __libc_getgrgid_freemem_ptr +# pragma weak __libc_getgrnam_freemem_ptr +# pragma weak __libc_getpwnam_freemem_ptr +# pragma weak __libc_getpwuid_freemem_ptr +# pragma weak __libc_getspnam_freemem_ptr +# pragma weak __libc_getaliasbyname_freemem_ptr +# pragma weak __libc_gethostbyaddr_freemem_ptr +# pragma weak __libc_gethostbyname_freemem_ptr +# pragma weak __libc_gethostbyname2_freemem_ptr +# pragma weak __libc_getnetbyaddr_freemem_ptr +# pragma weak __libc_getnetbyname_freemem_ptr +# pragma weak __libc_getprotobynumber_freemem_ptr +# pragma weak __libc_getprotobyname_freemem_ptr +# pragma weak __libc_getrpcbyname_freemem_ptr +# pragma weak __libc_getrpcbynumber_freemem_ptr +# pragma weak __libc_getservbyname_freemem_ptr +# pragma weak __libc_getservbyport_freemem_ptr +# pragma weak __libc_getgrent_freemem_ptr +# pragma weak __libc_getpwent_freemem_ptr +# pragma weak __libc_getaliasent_freemem_ptr +# pragma weak __libc_gethostent_freemem_ptr +# pragma weak __libc_getnetent_freemem_ptr +# pragma weak __libc_getprotoent_freemem_ptr +# pragma weak __libc_getrpcent_freemem_ptr +# pragma weak __libc_getservent_freemem_ptr +# pragma weak __libc_efgcvt_freemem_ptr +# pragma weak __libc_qefgcvt_freemem_ptr +# pragma weak __libc_qefgcvt_freemem_ptr +# pragma weak __ttyname_freemem_ptr #endif #ifdef SHARED From patchwork Mon Jul 24 17:15:23 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: 1811959 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=2620:52:3:1:0:246e:9693:128c; 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=Xe6tl0pD; dkim-atps=neutral Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (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 4R8mym6Js4z1yYc for ; Tue, 25 Jul 2023 03:16:00 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A6A543855592 for ; Mon, 24 Jul 2023 17:15:58 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A6A543855592 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1690218958; bh=ueiKvhjs3Pd4Qxj2arAbfdLyx8wL6klYYnAO+/NqWFg=; 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=Xe6tl0pDvFmAcmeX0m26bxizbe5s5PCbLgNNzPW8WrKXxgYl/QXEM88PidAYemSIz lcMuBexqXipfm5ZafWkabRi1yxwLly05q4l8T6Wxw6X62+etJB/6+MmK0vtB216NR1 XNW5Hr8cNM09/F+Gut6AjsOvUCUC5CJUOc0TqhNc= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-oo1-xc29.google.com (mail-oo1-xc29.google.com [IPv6:2607:f8b0:4864:20::c29]) by sourceware.org (Postfix) with ESMTPS id 13AD23858408 for ; Mon, 24 Jul 2023 17:15:35 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 13AD23858408 Received: by mail-oo1-xc29.google.com with SMTP id 006d021491bc7-5657d8ecdd3so2732285eaf.1 for ; Mon, 24 Jul 2023 10:15:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690218933; x=1690823733; 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=ueiKvhjs3Pd4Qxj2arAbfdLyx8wL6klYYnAO+/NqWFg=; b=Yo8/c7v4r6npGNR0CtdbyrcJ0CGbWiMk+YzmvsjfNYCFyVsfRuNM+I1GieGVX9lLe7 6sSkIoh++ezgCJt21S4mWy/kqKfkffxRKMDyTKPZX10SyShBDXBUACJaVMKEWD27Vc6u Eai5E1U353KUvYlJMcyMVg+8a8KBISwQ4nt7+VJL/dGsVRYkX3kG0DwCDCksRdHj9bPI qUcGSiZrNjFDWJi4jRCUMulkN1kuDy3zsXhoir4xzaWUO3eoPkePIQxmjMUZ1Rp1v7jf Yk+qkdT0PSxfRPdk61Jy8X2otueVtAsjcjhIvUCQMzFyBs0AujInqahT8kmkkcVKqKz2 blIQ== X-Gm-Message-State: ABy/qLYb9zhppIDgd/eN6ex6LkGT3Zo33LLxLltzFIzuJVZopaOTfdmk DOHtIcOJpJi1+trxliL4qyqXAW6aIEVce0SqjuFDwg== X-Google-Smtp-Source: APBJJlEnbpc83bWUxwqPd5aLLrZRWoJoiciZ7BjyuZLOT8VdiQ5TImLxlaalN+TMZZUoKU6d4rFeDw== X-Received: by 2002:a4a:3008:0:b0:566:f406:9b7c with SMTP id q8-20020a4a3008000000b00566f4069b7cmr6900766oof.3.1690218933601; Mon, 24 Jul 2023 10:15:33 -0700 (PDT) Received: from mandiga.. ([2804:1b3:a7c0:d4d2:46e0:428c:6669:da90]) by smtp.gmail.com with ESMTPSA id x140-20020a4a4192000000b0055e489a7fdasm4602286ooa.0.2023.07.24.10.15.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Jul 2023 10:15:33 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH 2/3] sunrpc: Fix netname build with older gcc Date: Mon, 24 Jul 2023 14:15:23 -0300 Message-Id: <20230724171524.2687112-3-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230724171524.2687112-1-adhemerval.zanella@linaro.org> References: <20230724171524.2687112-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, 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 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" The -Wformat-overflow was added by gcc 8. Reviewed-by: Carlos O'Donell --- sunrpc/netname.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sunrpc/netname.c b/sunrpc/netname.c index d9d82501b0..9e2f78329e 100644 --- a/sunrpc/netname.c +++ b/sunrpc/netname.c @@ -52,10 +52,14 @@ user2netname (char netname[MAXNETNAMELEN + 1], const uid_t uid, /* GCC with -Os or -O1 warns that sprint might overflow while handling dfltdom, however the above test does check if an overflow would happen. */ +#if __GNUC_PREREQ (8, 0) DIAG_PUSH_NEEDS_COMMENT; DIAG_IGNORE_NEEDS_COMMENT (8, "-Wformat-overflow"); +#endif sprintf (netname, "%s.%d@%s", OPSYS, uid, dfltdom); +#if __GNUC_PREREQ (8, 0) DIAG_POP_NEEDS_COMMENT; +#endif i = strlen (netname); if (netname[i - 1] == '.') netname[i - 1] = '\0'; From patchwork Mon Jul 24 17:15:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 1811960 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=2620:52:3:1:0:246e:9693:128c; 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=hRs6C08Y; dkim-atps=neutral Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (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 4R8mzX2Xt7z1yYc for ; Tue, 25 Jul 2023 03:16:40 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 2E7C23857354 for ; Mon, 24 Jul 2023 17:16:38 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2E7C23857354 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1690218998; bh=gU74aJaFwi5jx/sP8p6G2Xs176/qZHHwq/MHjJ+EVUI=; 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=hRs6C08YjvPd5OmCjDSNml699UNv1rgkkXp8KKApyI3H6OIMYB+DqW7MFVBXHpQVC FONHPTqg1iBrF5xxw9kz6s4uukUlMZGZmKRnEYhcMQEADBXrb1MpVl+yeSYLjH1Rnz ObFdlpnsP2J2JheUmfv/xd0S0Ixc/7xKfWL9/FlA= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-oa1-x36.google.com (mail-oa1-x36.google.com [IPv6:2001:4860:4864:20::36]) by sourceware.org (Postfix) with ESMTPS id 5EBB838582BE for ; Mon, 24 Jul 2023 17:15:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5EBB838582BE Received: by mail-oa1-x36.google.com with SMTP id 586e51a60fabf-1bb575a6ed3so1229073fac.2 for ; Mon, 24 Jul 2023 10:15:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690218935; x=1690823735; 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=gU74aJaFwi5jx/sP8p6G2Xs176/qZHHwq/MHjJ+EVUI=; b=Y6LdW3Sre1JzNYuBnda4WAF9bzXZEAlWbDPJb03DpVimRiMcQAQ6k06ZA6UW7FdMQn kpch9+1IaJ52nnK54ZpeWrU035Ul6bT8spI/mhavf7YWwxJk2hbPourqTGE9kc4N9i3y bToqQCYOT7vclMYLxwC5rpGr+sCcmvIcTErVwGe5d3/38UwPHIB313POD+dr4KBDjGwF BOOfGP7HcwctVsM/V3Z8Pj/jtXiC+zhz4XFAI5IlU67B+sPyTnDZ9iQxn+XzxHEXc0a8 NBOWI5VszMcg5/0T5PyaMWySb2PROYJRom47stBbrFNDWYg3opgOmPApvUubGlcP9BVW MO+Q== X-Gm-Message-State: ABy/qLb43JV66MTvH4MZxBAQBnA/bdQ2vJYSjMCl5Lf1LN+srBzm0FTi X+jOObvhGqGSM+PlfGX4YN/0cqDJjcTNlK+kwnYtbQ== X-Google-Smtp-Source: APBJJlGix7z0tHPkzi7R62a5cxAXhx8+y/u7qF2KQt/werJza7pnOgTWC96DMpTX1KvQV5gosvPzdg== X-Received: by 2002:a05:6870:1691:b0:1bb:7bab:d4 with SMTP id j17-20020a056870169100b001bb7bab00d4mr3113466oae.15.1690218935335; Mon, 24 Jul 2023 10:15:35 -0700 (PDT) Received: from mandiga.. ([2804:1b3:a7c0:d4d2:46e0:428c:6669:da90]) by smtp.gmail.com with ESMTPSA id x140-20020a4a4192000000b0055e489a7fdasm4602286ooa.0.2023.07.24.10.15.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Jul 2023 10:15:34 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH 3/3] powerpc: Fix powerpc64 strchrnul build with old gcc Date: Mon, 24 Jul 2023 14:15:24 -0300 Message-Id: <20230724171524.2687112-4-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230724171524.2687112-1-adhemerval.zanella@linaro.org> References: <20230724171524.2687112-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-12.5 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, T_FILL_THIS_FORM_SHORT, 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 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" The compiler might not see that internal definition is an alias due the libc_ifunc macro, which redefines __strchrnul. With gcc 6 it fails with: In file included from :0:0: ./../include/libc-symbols.h:472:33: error: ‘__EI___strchrnul’ aliased to undefined symbol ‘__GI___strchrnul’ extern thread __typeof (name) __EI_##name \ ^ ./../include/libc-symbols.h:468:3: note: in expansion of macro ‘__hidden_ver2’ __hidden_ver2 (, local, internal, name) ^~~~~~~~~~~~~ ./../include/libc-symbols.h:476:29: note: in expansion of macro ‘__hidden_ver1’ # define hidden_def(name) __hidden_ver1(__GI_##name, name, name); ^~~~~~~~~~~~~ ./../include/libc-symbols.h:557:32: note: in expansion of macro ‘hidden_def’ # define libc_hidden_def(name) hidden_def (name) ^~~~~~~~~~ ../sysdeps/powerpc/powerpc64/multiarch/strchrnul.c:38:1: note: in expansion of macro ‘libc_hidden_def’ libc_hidden_def (__strchrnul) ^~~~~~~~~~~~~~~ Use libc_ifunc_hidden as stpcpy. Checked on powerpc64 with gcc 6 and gcc 13. Reviewed-by: Carlos O'Donell --- sysdeps/powerpc/powerpc64/multiarch/strchrnul.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/sysdeps/powerpc/powerpc64/multiarch/strchrnul.c b/sysdeps/powerpc/powerpc64/multiarch/strchrnul.c index 94873507a6..87dd41f72d 100644 --- a/sysdeps/powerpc/powerpc64/multiarch/strchrnul.c +++ b/sysdeps/powerpc/powerpc64/multiarch/strchrnul.c @@ -27,13 +27,13 @@ extern __typeof (__strchrnul) __strchrnul_power8 attribute_hidden; /* Avoid DWARF definition DIE on ifunc symbol so that GDB can handle ifunc symbol properly. */ -libc_ifunc (__strchrnul, - (hwcap2 & PPC_FEATURE2_ARCH_2_07 - && hwcap & PPC_FEATURE_HAS_ALTIVEC) - ? __strchrnul_power8 : - (hwcap & PPC_FEATURE_ARCH_2_06) - ? __strchrnul_power7 - : __strchrnul_ppc); +libc_ifunc_hidden (__strchrnul, __strchrnul, + (hwcap2 & PPC_FEATURE2_ARCH_2_07 + && hwcap & PPC_FEATURE_HAS_ALTIVEC) + ? __strchrnul_power8 : + (hwcap & PPC_FEATURE_ARCH_2_06) + ? __strchrnul_power7 + : __strchrnul_ppc); libc_hidden_def (__strchrnul) weak_alias (__strchrnul, strchrnul)