* [Qemu-devel] [PATCH] rules: filter out irrelevant files
@ 2016-02-17 15:15 Michael S. Tsirkin
2016-02-17 15:16 ` Paolo Bonzini
0 siblings, 1 reply; 3+ messages in thread
From: Michael S. Tsirkin @ 2016-02-17 15:15 UTC (permalink / raw)
To: qemu-devel; +Cc: Michael Tokarev, Victor Kaplansky, Fam Zheng, Paolo Bonzini
It's often handy to make executables depend on each other, e.g. make a
test depend on a helper. This doesn't work now, as linker
will attempt to use the helper as an object.
To fix, filter only relevant file types before linking an executable.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
rules.mak | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/rules.mak b/rules.mak
index fc5ee41..d1ff311 100644
--- a/rules.mak
+++ b/rules.mak
@@ -102,7 +102,7 @@ LD_REL := $(CC) -nostdlib -Wl,-r
modules:
%$(EXESUF): %.o
- $(call LINK,$^)
+ $(call LINK,$(filter %.o %.a %.mo, $^))
%.a:
$(call quiet-command,rm -f $@ && $(AR) rcs $@ $^," AR $(TARGET_DIR)$@")
--
MST
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH] rules: filter out irrelevant files
2016-02-17 15:15 [Qemu-devel] [PATCH] rules: filter out irrelevant files Michael S. Tsirkin
@ 2016-02-17 15:16 ` Paolo Bonzini
2016-02-17 15:18 ` Michael S. Tsirkin
0 siblings, 1 reply; 3+ messages in thread
From: Paolo Bonzini @ 2016-02-17 15:16 UTC (permalink / raw)
To: Michael S. Tsirkin, qemu-devel
Cc: Michael Tokarev, Victor Kaplansky, Fam Zheng
On 17/02/2016 16:15, Michael S. Tsirkin wrote:
> It's often handy to make executables depend on each other, e.g. make a
> test depend on a helper. This doesn't work now, as linker
> will attempt to use the helper as an object.
> To fix, filter only relevant file types before linking an executable.
Can you provide an example of what you're trying to do?
Paolo
> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
> ---
> rules.mak | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/rules.mak b/rules.mak
> index fc5ee41..d1ff311 100644
> --- a/rules.mak
> +++ b/rules.mak
> @@ -102,7 +102,7 @@ LD_REL := $(CC) -nostdlib -Wl,-r
> modules:
>
> %$(EXESUF): %.o
> - $(call LINK,$^)
> + $(call LINK,$(filter %.o %.a %.mo, $^))
>
> %.a:
> $(call quiet-command,rm -f $@ && $(AR) rcs $@ $^," AR $(TARGET_DIR)$@")
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH] rules: filter out irrelevant files
2016-02-17 15:16 ` Paolo Bonzini
@ 2016-02-17 15:18 ` Michael S. Tsirkin
0 siblings, 0 replies; 3+ messages in thread
From: Michael S. Tsirkin @ 2016-02-17 15:18 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: Michael Tokarev, Victor Kaplansky, Fam Zheng, qemu-devel
On Wed, Feb 17, 2016 at 04:16:31PM +0100, Paolo Bonzini wrote:
>
>
> On 17/02/2016 16:15, Michael S. Tsirkin wrote:
> > It's often handy to make executables depend on each other, e.g. make a
> > test depend on a helper. This doesn't work now, as linker
> > will attempt to use the helper as an object.
> > To fix, filter only relevant file types before linking an executable.
>
> Can you provide an example of what you're trying to do?
>
> Paolo
Write a test that uses vhost-user to talk to a background
process helper (e.g. vhost-user-bridge).
This has to depend on the helper being built.
> > Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
> > ---
> > rules.mak | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/rules.mak b/rules.mak
> > index fc5ee41..d1ff311 100644
> > --- a/rules.mak
> > +++ b/rules.mak
> > @@ -102,7 +102,7 @@ LD_REL := $(CC) -nostdlib -Wl,-r
> > modules:
> >
> > %$(EXESUF): %.o
> > - $(call LINK,$^)
> > + $(call LINK,$(filter %.o %.a %.mo, $^))
> >
> > %.a:
> > $(call quiet-command,rm -f $@ && $(AR) rcs $@ $^," AR $(TARGET_DIR)$@")
> >
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-02-17 15:18 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-17 15:15 [Qemu-devel] [PATCH] rules: filter out irrelevant files Michael S. Tsirkin
2016-02-17 15:16 ` Paolo Bonzini
2016-02-17 15:18 ` Michael S. Tsirkin
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.