From: Blue Swirl <blauwirbel@gmail.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: qemu-devel@nongnu.org, patches@linaro.org
Subject: Re: [Qemu-devel] [PATCH v2] configure: Make epoll_create1 test work around SPARC glibc bug
Date: Tue, 26 Apr 2011 23:08:58 +0300 [thread overview]
Message-ID: <BANLkTi=2X8cU_SZADb47=sFbNOdu1iHXjg@mail.gmail.com> (raw)
In-Reply-To: <1303833400-13458-1-git-send-email-peter.maydell@linaro.org>
Thanks, applied.
On Tue, Apr 26, 2011 at 6:56 PM, Peter Maydell <peter.maydell@linaro.org> wrote:
> Work around a SPARC glibc bug which caused the epoll_create1 configure
> test to wrongly claim that the function was present. Some versions of
> SPARC glibc provided the function in the library but didn't declare
> it in the include file; the result is that gcc warns about an implicit
> declaration but a link succeeds. So we reference the function as a
> value rather than a function call to induce a compile time error
> if the declaration was not present.
>
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
> v1->v2: instead of compiling the test with -Werror, use the approach
> suggested by Blue Swirl to force a compile-time failure if the
> declaration is missing from the header file.
>
> configure | 10 +++++++++-
> 1 files changed, 9 insertions(+), 1 deletions(-)
>
> diff --git a/configure b/configure
> index de44bac..2bbbbf5 100755
> --- a/configure
> +++ b/configure
> @@ -2225,7 +2225,15 @@ cat > $TMPC << EOF
>
> int main(void)
> {
> - epoll_create1(0);
> + /* Note that we use epoll_create1 as a value, not as
> + * a function being called. This is necessary so that on
> + * old SPARC glibc versions where the function was present in
> + * the library but not declared in the header file we will
> + * fail the configure check. (Otherwise we will get a compiler
> + * warning but not an error, and will proceed to fail the
> + * qemu compile where we compile with -Werror.)
> + */
> + epoll_create1;
> return 0;
> }
> EOF
> --
> 1.7.1
>
>
prev parent reply other threads:[~2011-04-26 20:09 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-26 15:56 [Qemu-devel] [PATCH v2] configure: Make epoll_create1 test work around SPARC glibc bug Peter Maydell
2011-04-26 20:08 ` Blue Swirl [this message]
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='BANLkTi=2X8cU_SZADb47=sFbNOdu1iHXjg@mail.gmail.com' \
--to=blauwirbel@gmail.com \
--cc=patches@linaro.org \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
/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 NNTP newsgroup(s).