qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] trace: weird issues with makefile dependencies


From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] trace: weird issues with makefile dependencies
Date: Tue, 22 Jan 2013 11:00:30 +0100
User-agent: Mutt/1.5.21 (2010-09-15)

On Mon, Jan 21, 2013 at 11:42:54PM +0000, Peter Maydell wrote:
> There seems to be something wrong with the dependencies
> or makefile runes for some of the trace infrastructure.
> 
> For example:
> address@hidden:~/src/qemu/qemu$ less trace/generated-tracers.c
> /* This file is autogenerated by tracetool, do not edit. */
> address@hidden:~/src/qemu/qemu$ git status trace/generated-tracers.c
> # Not currently on any branch.
> nothing to commit (working directory clean)
> address@hidden:~/src/qemu/qemu$ rm trace/generated-tracers.c
> address@hidden:~/src/qemu/qemu$ make
>   lt CC trace/generated-tracers.lo
> gcc: error: trace/generated-tracers.c: No such file or directory
> gcc: fatal error: no input files
> compilation terminated.
> make: *** [trace/generated-tracers.lo] Error 1
> address@hidden:~/src/qemu/qemu$ make trace/generated-tracers.c
> make: Nothing to be done for `trace/generated-tracers.c'.
> address@hidden:~/src/qemu/qemu$ file trace/generated-tracers.c
> trace/generated-tracers.c: ERROR: cannot open
> `trace/generated-tracers.c' (No such file or directory)
> 
> Removing trace/generated-tracers.c-timestamp is necessary
> to get the makefile to rebuild the .c file.

Michael Tsirkin recently posted Makefile improvements for making the
timestamp files a bit more sane.  IIRC it will delete the timestamp when
you run make clean.  See the email thread for details:
http://comments.gmane.org/gmane.comp.emulators.qemu/188849

> Also, the .c file doesn't include any contents, which
> makes compiling it a bit pointless since it results
> in an empty object file. MacOSX at least warns about
> this:
> 
>   AR    libqemuutil.a
> /usr/bin/ranlib: file: libqemuutil.a(generated-tracers.o) has no symbols

You're hitting this with the (default) "nop" tracer.  We can put an
unused nop function in there to silence the warning.  It will never be
pulled into the final binary because no one uses the symbol.

I'll send a patch.

> I also just spent a long time trying to figure out why
> my MacOS system wouldn't build after a git pull; turns
> out that:
> (1) we used to have a generated trace.h and we don't any more
> (2) make distclean doesn't remove trace.h
> (3) #include "trace.h" prefers the out of date generated one
> to the new non-generated one in include/
> 
> I have no idea whether we can make qemu's build process more
> resistant to that kind of diachronic change, but I mention it
> anyway :-)

Yes, this is an annoying weakness in the build system.  But I think we
should not solve it with more make sophistication because we seem
incapable of handling the current level of complexity already :).

Stefan



reply via email to

[Prev in Thread] Current Thread [Next in Thread]