qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH RFC] Makefile.target: prepend $libs_softmmu to $LIBS
@ 2015-03-09 14:54 Wei Liu
  2015-03-09 15:11 ` Peter Maydell
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Wei Liu @ 2015-03-09 14:54 UTC (permalink / raw)
  To: qemu-devel; +Cc: pbonzini, Wei Liu, stefano.stabellini

I discovered a problem when trying to build QEMU statically with gcc.
libm is an element of LIBS while libpixman-1 is an element in
libs_softmmu. Libpixman references functions in libm, so the original
ordering makes linking fail.

This fix is to reorder $libs_softmmu and $LIBS to make -lm appear after
-lpixman-1. However I'm not quite sure if this is the right fix, hence
the RFC tag.

Normally QEMU is built with c++ compiler which happens to link in libm
(at least this is the case with g++), so building QEMU statically
normally just works and nobody notices this issue.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
---
 Makefile.target | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile.target b/Makefile.target
index 2262d89..1083377 100644
--- a/Makefile.target
+++ b/Makefile.target
@@ -134,7 +134,7 @@ obj-$(CONFIG_KVM) += kvm-all.o
 obj-y += memory.o savevm.o cputlb.o
 obj-y += memory_mapping.o
 obj-y += dump.o
-LIBS+=$(libs_softmmu)
+LIBS := $(libs_softmmu) $(LIBS)
 
 # xen support
 obj-$(CONFIG_XEN) += xen-common.o
-- 
1.9.1

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

end of thread, other threads:[~2015-03-10 12:02 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-09 14:54 [Qemu-devel] [PATCH RFC] Makefile.target: prepend $libs_softmmu to $LIBS Wei Liu
2015-03-09 15:11 ` Peter Maydell
2015-03-09 15:23   ` Wei Liu
2015-03-09 16:01     ` Stefano Stabellini
2015-03-09 16:36     ` Peter Maydell
2015-03-09 16:49       ` Wei Liu
2015-03-09 16:13 ` Paolo Bonzini
2015-03-10 10:16 ` Paolo Bonzini
2015-03-10 11:57   ` Wei Liu
2015-03-10 12:00     ` Paolo Bonzini
2015-03-10 12:02       ` Wei Liu

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).