Patchwork [4/5] configure: move common libraries to config-host.mak

login
register
mail settings
Submitter Paolo Bonzini
Date April 2, 2013, 6:51 p.m.
Message ID <515B28BC.3020505@redhat.com>
Download mbox | patch
Permalink /patch/233121/
State New
Headers show

Comments

Paolo Bonzini - April 2, 2013, 6:51 p.m.
Il 02/04/2013 20:17, Peter Maydell ha scritto:

> This is because we seem to have lost the trailing "-lm -lz"; here's
> the tail end of the link command from a build on master for
> comparison:
> 
> translate-all.o xen-stub.o ../libqemuutil.a ../libqemustub.a  -lrt
> -pthread -lgthread-2.0 -lglib-2.0 -lrt -lpcre    -lutil -lbluetooth
> -lncurses -ltinfo    -lvdeplug -luuid -lpng12 -lz -lm    -laio -lfdt
> -lpixman-1    -lm -lz

I can fix this, but apparently upstream pixman doesn't support static linking:

$ pkg-config pixman-1 --libs
-lpixman-1  
$ pkg-config pixman-1 --libs --static
-lpixman-1  

which is why my distro vendor does not provide static libraries. :)

Here is the fix:


Paolo

Patch

diff --git a/Makefile.target b/Makefile.target
index c8513f1..2636103 100644
--- a/Makefile.target
+++ b/Makefile.target
@@ -31,10 +31,6 @@  PROGS+=$(QEMU_PROGW)
 endif
 STPFILES=
 
-ifndef CONFIG_HAIKU
-LIBS+=-lm
-endif
-
 config-target.h: config-target.h-timestamp
 config-target.h-timestamp: config-target.mak
 
@@ -149,6 +145,10 @@  include $(SRC_PATH)/Makefile.objs
 all-obj-y = $(obj-y)
 all-obj-y += $(addprefix ../, $(common-obj-y))
 
+ifndef CONFIG_HAIKU
+LIBS+=-lm
+endif
+
 ifdef QEMU_PROGW
 # The linker builds a windows executable. Make also a console executable.
 $(QEMU_PROGW): $(all-obj-y) ../libqemuutil.a ../libqemustub.a