From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 49441 invoked by alias); 20 Sep 2017 21:45:26 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 49417 invoked by uid 89); 20 Sep 2017 21:45:25 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_PASS,URIBL_RED autolearn=ham version=3.3.2 spammy= X-Spam-User: qpsmtpd, 2 recipients X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 20 Sep 2017 21:45:23 +0000 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=svr-ies-mbx-01.mgc.mentorg.com) by relay1.mentorg.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-SHA384:256) id 1dumnu-0003TE-UC from joseph_myers@mentor.com ; Wed, 20 Sep 2017 14:45:10 -0700 Received: from digraph.polyomino.org.uk (137.202.0.87) by svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) with Microsoft SMTP Server (TLS) id 15.0.1263.5; Wed, 20 Sep 2017 22:45:07 +0100 Received: from jsm28 (helo=localhost) by digraph.polyomino.org.uk with local-esmtp (Exim 4.86_2) (envelope-from ) id 1dumnm-0000ph-Mn; Wed, 20 Sep 2017 21:45:02 +0000 Date: Wed, 20 Sep 2017 21:45:00 -0000 From: Joseph Myers To: Martin Sebor CC: , Gcc Patch List , Jonathan Wakely , libstdc++ , Subject: Re: [PATCH] detect incompatible aliases (PR c/81854) In-Reply-To: Message-ID: References: <61673e8d-6f5c-9bc0-dcf8-75eee71f98de@gmail.com> <1505921857.2286.101.camel@cavium.com> <3d1bd511-dfe3-d965-248e-a2ec108187d5@gmail.com> <1505925525.2286.106.camel@cavium.com> <5ba5c4ce-b7bd-a7fe-fa66-298bdac6880e@gmail.com> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" X-ClientProxiedBy: svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) To svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) X-SW-Source: 2017-09/txt/msg01414.txt.bz2 On Wed, 20 Sep 2017, Martin Sebor wrote: > The warning is because in the declaration: > > extern __typeof (__libc_memmove) > memmove __attribute__ ((alias ("__libc_memmove"))); > > __typeof (__libc_memmove) is the same as the type of memmove > as it should be but the type of the alias ("__libc_memmove") is > that of __libc_memmove_ifunc, presumably because of the following: > > __typeof (__libc_memmove)* > __libc_memmove_ifunc (void) __asm__ ("__libc_memmove"); > > I think this is because the type of "__libc_memmove" in the alias > is looked up "late" after the asm above has associated its type > with __libc_memmove_ifunc. > > Besides suppressing the warning using a pragma it can also be > suppressed by declaring memove with no prototype (which would > mean changing the definition of the strong_alias macro for this > kind of builds as you suggest). But this would just paper over > the type mismatch. I'm afraid I don't know enough about this > machinery to tell what might be an appropriate fix (i.e., what > would declare memove as an alias for __libc_memmove_ifunc but > with the correct type), or even if there is one. I think in the case of IFUNCs defined without the attribute, a symbol inherently has two incompatible types, one at C level and one at assembler level. So disabling this particular warning for the combination of (multi-arch, no IFUNC attribute) may make sense - but maybe it would be better to enable the IFUNC attribute for all GNU/Linux targets (without regard to whether the assembler and linker support the feature, but arranging as needed for the assembler to give an error if support is missing). We do *not* however want to disable any other warnings relating to attributes. The x32 case should be fixed by using the common ifunc macros in make-syscalls.sh. -- Joseph S. Myers joseph@codesourcery.com