qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] Add CONFIG_QEMU_TIMER to handle qemu-timer-comm


From: Michael Roth
Subject: Re: [Qemu-devel] [PATCH] Add CONFIG_QEMU_TIMER to handle qemu-timer-common.o dep
Date: Tue, 30 Aug 2011 10:20:22 -0500
User-agent: Mozilla/5.0 (X11; Linux i686 on x86_64; rv:6.0) Gecko/20110812 Thunderbird/6.0

On 08/30/2011 07:02 AM, Lluís wrote:
Stefan Hajnoczi writes:

On Mon, Aug 29, 2011 at 8:27 PM, Michael Roth<address@hidden>  wrote:
@@ -380,7 +381,6 @@ else
  trace-obj-y = trace.o
  ifeq ($(TRACE_BACKEND),simple)
  trace-obj-y += simpletrace.o
-user-obj-y += qemu-timer-common.o
  endif
  endif

Now that we have a concrete patch to look at I think this approach is
problematic.  There are several subsystems in QEMU which might be
built outside the main qemu binary for qemu-io, qemu-img, qemu-ga,
etc.
[...]
If QEMU is split up into libraries then having an explicit list of
dependencies for each subsystem will be very useful, whereas the
CONFIG_* approach doesn't collect that information in one place.

So I think explicit subsys-obj-y += qemu-timer-common.o together with
$(sort) during the link stage actually allows for a cleaner build
system.  I prefer that approach.

I couldn't agree more. The only problem I see with '$(sort)' is that it
will invariably change the order of object files, which can influence
code placement.

Whether or not the spatial locality among compilation units is
important, I don't know. Although I believe it won't have much of a
performance penalty.

In any case, I tried to find a straightforward way of filtering-out
repeated words in a list with make, but couldn't find any solution other
than '$(sort)' or calling an external command with '$(shell)'.

Hmm, looking again I'm confused why we need to do this in the first place...the rule is:

LINK = $(call quiet-command,$(CC) $(QEMU_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ $(1) $(LIBS)," LINK $(TARGET_DIR)$@")

%$(EXESUF): %.o
    $(call LINK,$^)

According to the documentation $^ should remove duplicate dependencies, so I'm not getting why we need to de-dupe them once they get passed to LINK:

http://www.gnu.org/software/make/manual/make.html#index-g_t_0024_005e-948

Is there some distinction between duplicate dependencies and duplicate words in the dependency list?



Lluis





reply via email to

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