From: Joseph Myers <joseph@codesourcery.com>
To: Martin Sebor <msebor@gmail.com>
Cc: <sellcey@cavium.com>, Gcc Patch List <gcc-patches@gcc.gnu.org>,
Jonathan Wakely <jwakely@redhat.com>,
libstdc++ <libstdc++@gcc.gnu.org>, <hjl.tools@gmail.com>
Subject: Re: [PATCH] detect incompatible aliases (PR c/81854)
Date: Wed, 20 Sep 2017 21:45:00 -0000 [thread overview]
Message-ID: <alpine.DEB.2.20.1709202138210.31948@digraph.polyomino.org.uk> (raw)
In-Reply-To: <a96567b8-27dd-9227-2a3d-7fc6ee0645f2@gmail.com>
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
next prev parent reply other threads:[~2017-09-20 21:45 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-18 8:10 Martin Sebor
2017-08-18 13:10 ` Joseph Myers
2017-08-18 13:57 ` Jonathan Wakely
2017-08-18 18:22 ` Martin Sebor
2017-08-18 18:37 ` Jonathan Wakely
2017-08-18 21:02 ` Martin Sebor
2017-09-02 22:50 ` [PING] " Martin Sebor
2017-09-12 16:17 ` Joseph Myers
2017-09-18 21:21 ` Martin Sebor
2017-09-18 21:44 ` Joseph Myers
2017-09-19 15:16 ` Martin Sebor
2017-09-20 15:37 ` Steve Ellcey
2017-09-20 16:17 ` Martin Sebor
2017-09-20 16:38 ` Steve Ellcey
2017-09-20 17:23 ` Steve Ellcey
2017-09-20 17:32 ` Martin Sebor
2017-09-20 17:45 ` Steve Ellcey
2017-09-20 18:05 ` Joseph Myers
2017-09-20 18:01 ` Joseph Myers
2017-09-20 18:08 ` Steve Ellcey
2017-09-20 18:14 ` Joseph Myers
2017-09-20 21:01 ` Joseph Myers
2017-09-20 21:32 ` Martin Sebor
2017-09-20 21:45 ` Joseph Myers [this message]
2017-10-02 19:49 ` Steve Ellcey
2017-10-02 19:53 ` Joseph Myers
2017-10-02 20:17 ` Martin Sebor
2017-10-03 21:41 ` Andreas Schwab
2017-10-03 23:43 ` Martin Sebor
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=alpine.DEB.2.20.1709202138210.31948@digraph.polyomino.org.uk \
--to=joseph@codesourcery.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=hjl.tools@gmail.com \
--cc=jwakely@redhat.com \
--cc=libstdc++@gcc.gnu.org \
--cc=msebor@gmail.com \
--cc=sellcey@cavium.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).