qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: John Snow <jsnow@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: QEMU Developers <qemu-devel@nongnu.org>,
	Stefan Hajnoczi <stefanha@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v3 4/4] configure: Add workaround for ccache and clang
Date: Mon, 23 Mar 2015 10:52:00 -0400	[thread overview]
Message-ID: <55102890.5070201@redhat.com> (raw)
In-Reply-To: <CAFEAcA9D=NJQXfx98+ieUuZXg+C30m0JPg3NXWifhS4hoS=EAw@mail.gmail.com>



On 03/23/2015 09:11 AM, Peter Maydell wrote:
> On 19 March 2015 at 19:01, John Snow <jsnow@redhat.com> wrote:
>> Test if ccache is interfering with our life, and
>> disable its habit of trying to compile already pre-processed
>> versions of code if so.
>>
>> In particular, clang has different semantic warnings based on
>> if the warning arose from a macro or not. By trying to build
>> preprocessed versions of code, we get more errors than we should.
>>
>> ccache allows us to disable this feature, opting instead to
>> compile the original version instead of its preprocessed version.
>>
>> This makes ccache much slower for cache misses, but at least it
>> becomes usable with QEMU/clang.
>>
>> Thanks to Peter Eisentraut for his writeup on the issue:
>> http://peter.eisentraut.org/blog/2014/12/01/ccache-and-clang-part-3/
>
> This is really working around a bug in either ccache or
> in the way Fedora has configured ccache, so I kind of
> feel it ought to be dealt with there. However I don't
> object too much to our including the workaround in our
> configure...
>
> -- PMM
>

I feel like it might be an inescapable consequence of using both ccache 
and clang together on any system, not just Fedora.

This at least ONLY turns on the workaround if it is observed to 
interfering, so it should improve the "ease of build" for clang + ccache 
in general, and not just on Fedora.

Of course, even if it is a workaround that only benefits out of the box 
configurations on Fedora, It's still useful to be able to build from 
source on Fedora, instead of waiting for a package maintainer to update ...

So unless there's a strong reason against this workaround in particular, 
I think it is harmless enough for inclusion. It certainly won't make the 
build worse for anyone.

For cases where you might be using ccache and gcc, for instance, this 
workaround won't even trigger. Further good news: We don't suppress any 
extra warnings we don't have to. Instead, we just tell ccache to 
re-process a file instead of trying to compile the preprocessed version.

--js

  reply	other threads:[~2015-03-23 14:52 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-19 19:01 [Qemu-devel] [PATCH v3 0/4] configure: clang 3.5.0 build fixes John Snow
2015-03-19 19:01 ` [Qemu-devel] [PATCH v3 1/4] configure: handle clang -nopie argument warning John Snow
2015-03-19 19:01 ` [Qemu-devel] [PATCH v3 2/4] configure: factor out supported flag check John Snow
2015-03-23 13:03   ` Stefan Hajnoczi
2015-03-23 14:44     ` John Snow
2015-03-23 14:48       ` Paolo Bonzini
2015-03-23 14:50       ` Stefan Hajnoczi
2015-03-19 19:01 ` [Qemu-devel] [PATCH v3 3/4] configure: silence glib unknown attribute __alloc_size__ John Snow
2015-03-19 19:01 ` [Qemu-devel] [PATCH v3 4/4] configure: Add workaround for ccache and clang John Snow
2015-03-23 12:58   ` Stefan Hajnoczi
2015-03-23 13:11   ` Peter Maydell
2015-03-23 14:52     ` John Snow [this message]
2015-03-23 15:14       ` Peter Maydell
2015-03-23 16:32         ` John Snow

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=55102890.5070201@redhat.com \
    --to=jsnow@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.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 NNTP newsgroup(s).