* [Qemu-devel] [PATCH 4/4] fix compilation when reconfiguring without dtrace backend
@ 2011-05-02 7:54 Paolo Bonzini
2011-05-08 11:15 ` [Qemu-devel] [Qemu-trivial] " Stefan Hajnoczi
0 siblings, 1 reply; 6+ messages in thread
From: Paolo Bonzini @ 2011-05-02 7:54 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-trivial
If QEMU is configured with the dtrace backend, then built, then
reconfigured without, the build fails.
The culprit is the trace-dtrace.h dependency that many files will
have. Due to this dependency, make will attempt to rebuild
trace-dtrace.dtrace. This is the step that fails. Fix by wrapping
the dtrace rules with ifeq/endif.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Cc: qemu-trivial@nongnu.org
---
Makefile.objs | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/Makefile.objs b/Makefile.objs
index 0ba989f..e4e538a 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -326,6 +326,7 @@ trace.c-timestamp: $(SRC_PATH)/trace-events config-host.mak
trace.o: trace.c $(GENERATED_HEADERS)
+ifeq ($(TRACE_BACKEND),dtrace)
trace-dtrace.h: trace-dtrace.dtrace
$(call quiet-command,dtrace -o $@ -h -s $<, " GEN trace-dtrace.h")
@@ -339,6 +340,7 @@ trace-dtrace.dtrace-timestamp: $(SRC_PATH)/trace-events config-host.mak
trace-dtrace.o: trace-dtrace.dtrace $(GENERATED_HEADERS)
$(call quiet-command,dtrace -o $@ -G -s $<, " GEN trace-dtrace.o")
+endif
simpletrace.o: simpletrace.c $(GENERATED_HEADERS)
--
1.7.4.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] [Qemu-trivial] [PATCH 4/4] fix compilation when reconfiguring without dtrace backend
2011-05-02 7:54 [Qemu-devel] [PATCH 4/4] fix compilation when reconfiguring without dtrace backend Paolo Bonzini
@ 2011-05-08 11:15 ` Stefan Hajnoczi
2011-05-09 6:53 ` Paolo Bonzini
0 siblings, 1 reply; 6+ messages in thread
From: Stefan Hajnoczi @ 2011-05-08 11:15 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: qemu-trivial, qemu-devel
On Mon, May 2, 2011 at 8:54 AM, Paolo Bonzini <pbonzini@redhat.com> wrote:
> If QEMU is configured with the dtrace backend, then built, then
> reconfigured without, the build fails.
>
> The culprit is the trace-dtrace.h dependency that many files will
> have. Due to this dependency, make will attempt to rebuild
> trace-dtrace.dtrace. This is the step that fails. Fix by wrapping
> the dtrace rules with ifeq/endif.
>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> Cc: qemu-trivial@nongnu.org
> ---
> Makefile.objs | 2 ++
> 1 files changed, 2 insertions(+), 0 deletions(-)
I think the real problem is that dependencies need to be regenerated
after ./configure?
Stefan
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] [Qemu-trivial] [PATCH 4/4] fix compilation when reconfiguring without dtrace backend
2011-05-08 11:15 ` [Qemu-devel] [Qemu-trivial] " Stefan Hajnoczi
@ 2011-05-09 6:53 ` Paolo Bonzini
2011-05-09 8:34 ` Stefan Hajnoczi
0 siblings, 1 reply; 6+ messages in thread
From: Paolo Bonzini @ 2011-05-09 6:53 UTC (permalink / raw)
To: Stefan Hajnoczi; +Cc: qemu-trivial, qemu-devel
On 05/08/2011 01:15 PM, Stefan Hajnoczi wrote:
> I think the real problem is that dependencies need to be regenerated
> after ./configure?
There are three ways to do that, the trivial but wrong one, and the
correct but overzealous one:
- delete .d files. This forces regeneration of dependencies, but if you
do not correspondingly delete .o files, you will likely have an
incomplete build (possibly _nothing_ will be built).
- delete .d and .o files. This forces regeneration of dependencies and
recompilation. True, a lot of distros are using ccache nowadays, but
still this will cause a complete walk of all directories to pass those
files to ccache and relink the executables. It will likely take a
minute or three.
- detect changes in the configuration and, if those happen, delete .d
and .o files. This is the correct one, and for one what the Linux
kernel makefiles do, but also the biggest effort to implement.
Paolo
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] [Qemu-trivial] [PATCH 4/4] fix compilation when reconfiguring without dtrace backend
2011-05-09 6:53 ` Paolo Bonzini
@ 2011-05-09 8:34 ` Stefan Hajnoczi
2011-05-09 8:42 ` Paolo Bonzini
0 siblings, 1 reply; 6+ messages in thread
From: Stefan Hajnoczi @ 2011-05-09 8:34 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: qemu-trivial, qemu-devel
On Mon, May 9, 2011 at 7:53 AM, Paolo Bonzini <pbonzini@redhat.com> wrote:
> On 05/08/2011 01:15 PM, Stefan Hajnoczi wrote:
>>
>> I think the real problem is that dependencies need to be regenerated
>> after ./configure?
>
> There are three ways to do that, the trivial but wrong one, and the correct
> but overzealous one:
>
> - delete .d files. This forces regeneration of dependencies, but if you do
> not correspondingly delete .o files, you will likely have an incomplete
> build (possibly _nothing_ will be built).
>
> - delete .d and .o files. This forces regeneration of dependencies and
> recompilation. True, a lot of distros are using ccache nowadays, but still
> this will cause a complete walk of all directories to pass those files to
> ccache and relink the executables. It will likely take a minute or three.
The .o files should depend on GENERATED_HEADERS (especially
config-host.h) and therefore be rebuilt by make when ./configure
outputs a new configuration. If the configuration is identical an
unnecessary rebuild is triggered but this can be mitigated using
ccache like you say.
So I think just deleting .d files is enough. BTW the Makefiles don't
seem to have a step before compilation to generate all the
dependencies, instead dependencies only kick in after the first build
has completed?
> - detect changes in the configuration and, if those happen, delete .d and .o
> files. This is the correct one, and for one what the Linux kernel makefiles
> do, but also the biggest effort to implement.
Is there some smart change detection you are thinking about or just
something like keeping the old copy of config-host.h and friends to
see if they have changed?
Stefan
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] [Qemu-trivial] [PATCH 4/4] fix compilation when reconfiguring without dtrace backend
2011-05-09 8:34 ` Stefan Hajnoczi
@ 2011-05-09 8:42 ` Paolo Bonzini
2011-05-09 9:06 ` Stefan Hajnoczi
0 siblings, 1 reply; 6+ messages in thread
From: Paolo Bonzini @ 2011-05-09 8:42 UTC (permalink / raw)
To: Stefan Hajnoczi; +Cc: qemu-trivial, qemu-devel
On 05/09/2011 10:34 AM, Stefan Hajnoczi wrote:
> BTW the Makefiles don't
> seem to have a step before compilation to generate all the
> dependencies, instead dependencies only kick in after the first build
> has completed?
Yes, the first build doesn't need dependencies on headers. Rules for
.c->.o and .o->executable are enough to get everything built.
> Is there some smart change detection you are thinking about or just
> something like keeping the old copy of config-host.h and friends to
> see if they have changed?
Just that, perhaps for both .h and .mak files. Consider this very
patch; it is plausible that switching to another tracing backend does
not change the .h files, right now the backend is only present in .h
files to enable the monitor/cmdline interfaces.
Paolo
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] [Qemu-trivial] [PATCH 4/4] fix compilation when reconfiguring without dtrace backend
2011-05-09 8:42 ` Paolo Bonzini
@ 2011-05-09 9:06 ` Stefan Hajnoczi
0 siblings, 0 replies; 6+ messages in thread
From: Stefan Hajnoczi @ 2011-05-09 9:06 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: qemu-trivial, qemu-devel
On Mon, May 9, 2011 at 9:42 AM, Paolo Bonzini <pbonzini@redhat.com> wrote:
> On 05/09/2011 10:34 AM, Stefan Hajnoczi wrote:
>> Is there some smart change detection you are thinking about or just
>> something like keeping the old copy of config-host.h and friends to
>> see if they have changed?
>
> Just that, perhaps for both .h and .mak files. Consider this very patch; it
> is plausible that switching to another tracing backend does not change the
> .h files, right now the backend is only present in .h files to enable the
> monitor/cmdline interfaces.
Hmm...I was wrong when I said that just deleting .d files is enough.
If ./configure is run *and* an arbitrary header file was changed then
stale .o files will be used. So we also need to delete .o files on
./configure.
Stefan
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2011-05-09 9:06 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-02 7:54 [Qemu-devel] [PATCH 4/4] fix compilation when reconfiguring without dtrace backend Paolo Bonzini
2011-05-08 11:15 ` [Qemu-devel] [Qemu-trivial] " Stefan Hajnoczi
2011-05-09 6:53 ` Paolo Bonzini
2011-05-09 8:34 ` Stefan Hajnoczi
2011-05-09 8:42 ` Paolo Bonzini
2011-05-09 9:06 ` Stefan Hajnoczi
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).