public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [qemu-kvm tests PATCH v2] qemu-kvm tests: fix linker script problem
@ 2010-05-05 13:53 Naphtali Sprei
  2010-05-05 15:05 ` Avi Kivity
  0 siblings, 1 reply; 2+ messages in thread
From: Naphtali Sprei @ 2010-05-05 13:53 UTC (permalink / raw)
  To: kvm; +Cc: Avi Kivity


commit 848bd0c89c83814023cf51c72effdbc7de0d18b7 causes the linker script
itself (flat.lds) to become part of the linked objects, which messed
the output file, specifically, the symbol edata is not the last symbol
anymore.


change v1 -> v2
Instead of dropping the dependency, put it on a separate line/rule, so the
lds file will not be considered as one of the dependencies in the linking line/rule.

Signed-off-by: Naphtali Sprei <nsprei@redhat.com>
---
 kvm/user/config-x86-common.mak |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/kvm/user/config-x86-common.mak b/kvm/user/config-x86-common.mak
index 61cc2f0..241c422 100644
--- a/kvm/user/config-x86-common.mak
+++ b/kvm/user/config-x86-common.mak
@@ -19,7 +19,8 @@ CFLAGS += -m$(bits)
 libgcc := $(shell $(CC) -m$(bits) --print-libgcc-file-name)
 
 FLATLIBS = test/lib/libcflat.a $(libgcc)
-%.flat: %.o $(FLATLIBS) flat.lds
+%.flat: flat.lds
+%.flat: %.o $(FLATLIBS)
 	$(CC) $(CFLAGS) -nostdlib -o $@ -Wl,-T,flat.lds $^ $(FLATLIBS)
 
 tests-common = $(TEST_DIR)/vmexit.flat $(TEST_DIR)/tsc.flat \
-- 
1.6.3.3


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [qemu-kvm tests PATCH v2] qemu-kvm tests: fix linker script problem
  2010-05-05 13:53 [qemu-kvm tests PATCH v2] qemu-kvm tests: fix linker script problem Naphtali Sprei
@ 2010-05-05 15:05 ` Avi Kivity
  0 siblings, 0 replies; 2+ messages in thread
From: Avi Kivity @ 2010-05-05 15:05 UTC (permalink / raw)
  To: Naphtali Sprei; +Cc: kvm

On 05/05/2010 04:53 PM, Naphtali Sprei wrote:
> commit 848bd0c89c83814023cf51c72effdbc7de0d18b7 causes the linker script
> itself (flat.lds) to become part of the linked objects, which messed
> the output file, specifically, the symbol edata is not the last symbol
> anymore.
>
>
> change v1 ->  v2
> Instead of dropping the dependency, put it on a separate line/rule, so the
> lds file will not be considered as one of the dependencies in the linking line/rule.
>
>
>
>   FLATLIBS = test/lib/libcflat.a $(libgcc)
> -%.flat: %.o $(FLATLIBS) flat.lds
> +%.flat: flat.lds
> +%.flat: %.o $(FLATLIBS)
>   	$(CC) $(CFLAGS) -nostdlib -o $@ -Wl,-T,flat.lds $^ $(FLATLIBS)
>    

I don't think that works - $^ selects all prerequisites, not just the 
ones in the line for the make rule.

prereq-%:
     touch $@

dummy: prereq-1

dummy: prereq-2
     echo $^

$ make dummy
touch prereq-2
touch prereq-1
echo prereq-2 prereq-1
prereq-2 prereq-1

-- 
error compiling committee.c: too many arguments to function


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-05-05 15:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-05 13:53 [qemu-kvm tests PATCH v2] qemu-kvm tests: fix linker script problem Naphtali Sprei
2010-05-05 15:05 ` Avi Kivity

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox