qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH RFC] Makefile.target: prepend $libs_softmmu to $


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH RFC] Makefile.target: prepend $libs_softmmu to $LIBS
Date: Mon, 09 Mar 2015 17:13:28 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0


On 09/03/2015 15:54, Wei Liu wrote:
> 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.

That's a bug in pixman:

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

It should have included -lm as well.

However, I think I'm okay with this patch.  There's nothing
fundamentally wrong with it, and running modern QEMU as stubdom is
definitely a valuable usecase.

Paolo

> 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 <address@hidden>
> ---
>  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
> 



reply via email to

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