diff mbox series

configure: Don't add Xen's libs to LDFLAGS

Message ID 20190121144841.24467-1-anthony.perard@citrix.com (mailing list archive)
State New, archived
Headers show
Series configure: Don't add Xen's libs to LDFLAGS | expand

Commit Message

Anthony PERARD Jan. 21, 2019, 2:48 p.m. UTC
When Xen is detected via pkg-config, it isn't necessary to modify
LDFLAGS as modifying libs_softmmu is enough.

Reported-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
---
 configure | 1 -
 1 file changed, 1 deletion(-)

Comments

Philippe Mathieu-Daudé Jan. 21, 2019, 3:15 p.m. UTC | #1
On 1/21/19 3:48 PM, Anthony PERARD wrote:
> When Xen is detected via pkg-config, it isn't necessary to modify
> LDFLAGS as modifying libs_softmmu is enough.
> 
> Reported-by: Peter Maydell <peter.maydell@linaro.org>
> Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
> ---
>  configure | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/configure b/configure
> index 12fd34f30b..98b270974d 100755
> --- a/configure
> +++ b/configure
> @@ -2355,7 +2355,6 @@ if test "$xen" != "no" ; then
>      fi
>      QEMU_CFLAGS="$QEMU_CFLAGS $($pkg_config --cflags $xen_pc)"
>      libs_softmmu="$($pkg_config --libs $xen_pc) $libs_softmmu"
> -    LDFLAGS="$($pkg_config --libs $xen_pc) $LDFLAGS"
>    else
>  
>      xen_libs="-lxenstore -lxenctrl -lxenguest"
> 

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Peter Maydell Jan. 21, 2019, 3:17 p.m. UTC | #2
On Mon, 21 Jan 2019 at 14:49, Anthony PERARD <anthony.perard@citrix.com> wrote:
>
> When Xen is detected via pkg-config, it isn't necessary to modify
> LDFLAGS as modifying libs_softmmu is enough.
>
> Reported-by: Peter Maydell <peter.maydell@linaro.org>
> Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
> ---
>  configure | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/configure b/configure
> index 12fd34f30b..98b270974d 100755
> --- a/configure
> +++ b/configure
> @@ -2355,7 +2355,6 @@ if test "$xen" != "no" ; then
>      fi
>      QEMU_CFLAGS="$QEMU_CFLAGS $($pkg_config --cflags $xen_pc)"
>      libs_softmmu="$($pkg_config --libs $xen_pc) $libs_softmmu"
> -    LDFLAGS="$($pkg_config --libs $xen_pc) $LDFLAGS"
>    else
>
>      xen_libs="-lxenstore -lxenctrl -lxenguest"
> --
> Anthony PERARD

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

Cc'ing MJT, who first pointed out to me that this bug
was resulting in various binaries like the linux-user ones
getting linked against the Xen libs unnecessarily.

thanks
-- PMM
Michael Tokarev Jan. 22, 2019, 5:40 a.m. UTC | #3
21.01.2019 18:17, Peter Maydell wrote:
> On Mon, 21 Jan 2019 at 14:49, Anthony PERARD <anthony.perard@citrix.com> wrote:
>>
>> When Xen is detected via pkg-config, it isn't necessary to modify
>> LDFLAGS as modifying libs_softmmu is enough.
>>
>> Reported-by: Peter Maydell <peter.maydell@linaro.org>
>> Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
>> ---
>>   configure | 1 -
>>   1 file changed, 1 deletion(-)
>>
>> diff --git a/configure b/configure
>> index 12fd34f30b..98b270974d 100755
>> --- a/configure
>> +++ b/configure
>> @@ -2355,7 +2355,6 @@ if test "$xen" != "no" ; then
>>       fi
>>       QEMU_CFLAGS="$QEMU_CFLAGS $($pkg_config --cflags $xen_pc)"
>>       libs_softmmu="$($pkg_config --libs $xen_pc) $libs_softmmu"
>> -    LDFLAGS="$($pkg_config --libs $xen_pc) $LDFLAGS"
>>     else
>>
>>       xen_libs="-lxenstore -lxenctrl -lxenguest"
>> --
>> Anthony PERARD
> 
> Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
> 
> Cc'ing MJT, who first pointed out to me that this bug
> was resulting in various binaries like the linux-user ones
> getting linked against the Xen libs unnecessarily.

Well, at that time I confirmed the patch fixes this issue, and this
is the same change I come across too, and it is already used on Debian.
So

Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Revieved-by: Michael Tokarev <mjt@tls.msk.ru>

Thanks,

/mjt
Markus Armbruster Jan. 24, 2019, 8:45 a.m. UTC | #4
Michael Tokarev <mjt@tls.msk.ru> writes:

> 21.01.2019 18:17, Peter Maydell wrote:
>> On Mon, 21 Jan 2019 at 14:49, Anthony PERARD <anthony.perard@citrix.com> wrote:
>>>
>>> When Xen is detected via pkg-config, it isn't necessary to modify
>>> LDFLAGS as modifying libs_softmmu is enough.
>>>
>>> Reported-by: Peter Maydell <peter.maydell@linaro.org>
>>> Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
>>> ---
>>>   configure | 1 -
>>>   1 file changed, 1 deletion(-)
>>>
>>> diff --git a/configure b/configure
>>> index 12fd34f30b..98b270974d 100755
>>> --- a/configure
>>> +++ b/configure
>>> @@ -2355,7 +2355,6 @@ if test "$xen" != "no" ; then
>>>       fi
>>>       QEMU_CFLAGS="$QEMU_CFLAGS $($pkg_config --cflags $xen_pc)"
>>>       libs_softmmu="$($pkg_config --libs $xen_pc) $libs_softmmu"
>>> -    LDFLAGS="$($pkg_config --libs $xen_pc) $LDFLAGS"
>>>     else
>>>
>>>       xen_libs="-lxenstore -lxenctrl -lxenguest"
>>> --
>>> Anthony PERARD
>>
>> Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
>>
>> Cc'ing MJT, who first pointed out to me that this bug
>> was resulting in various binaries like the linux-user ones
>> getting linked against the Xen libs unnecessarily.
>
> Well, at that time I confirmed the patch fixes this issue, and this
> is the same change I come across too, and it is already used on Debian.
> So
>
> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
> Revieved-by: Michael Tokarev <mjt@tls.msk.ru>

Typo in Reviewed-by.
Eric Blake Jan. 24, 2019, 5:40 p.m. UTC | #5
On 1/24/19 2:45 AM, Markus Armbruster wrote:

>> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
>> Revieved-by: Michael Tokarev <mjt@tls.msk.ru>
> 
> Typo in Reviewed-by.

Should we tighten checkpatch.pl to flag suspicious-looking 'xxx-by:'
tags, to catch instances of typos?
Peter Maydell Jan. 24, 2019, 6:29 p.m. UTC | #6
On Thu, 24 Jan 2019 at 17:40, Eric Blake <eblake@redhat.com> wrote:
>
> On 1/24/19 2:45 AM, Markus Armbruster wrote:
>
> >> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
> >> Revieved-by: Michael Tokarev <mjt@tls.msk.ru>
> >
> > Typo in Reviewed-by.
>
> Should we tighten checkpatch.pl to flag suspicious-looking 'xxx-by:'
> tags, to catch instances of typos?

Yes, I would vote for having it whitelist the half a dozen
expected ones and complain about the rest. I think we
kind of discussed this in the past...

thanks
-- PMM
Eric Blake Feb. 4, 2019, 10:11 p.m. UTC | #7
On 1/24/19 12:29 PM, Peter Maydell wrote:
> On Thu, 24 Jan 2019 at 17:40, Eric Blake <eblake@redhat.com> wrote:
>>
>> On 1/24/19 2:45 AM, Markus Armbruster wrote:
>>
>>>> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
>>>> Revieved-by: Michael Tokarev <mjt@tls.msk.ru>
>>>
>>> Typo in Reviewed-by.
>>
>> Should we tighten checkpatch.pl to flag suspicious-looking 'xxx-by:'
>> tags, to catch instances of typos?
> 
> Yes, I would vote for having it whitelist the half a dozen
> expected ones and complain about the rest. I think we
> kind of discussed this in the past...

I submitted a patch along those lines:
https://lists.gnu.org/archive/html/qemu-devel/2019-02/msg00910.html
diff mbox series

Patch

diff --git a/configure b/configure
index 12fd34f30b..98b270974d 100755
--- a/configure
+++ b/configure
@@ -2355,7 +2355,6 @@  if test "$xen" != "no" ; then
     fi
     QEMU_CFLAGS="$QEMU_CFLAGS $($pkg_config --cflags $xen_pc)"
     libs_softmmu="$($pkg_config --libs $xen_pc) $libs_softmmu"
-    LDFLAGS="$($pkg_config --libs $xen_pc) $LDFLAGS"
   else
 
     xen_libs="-lxenstore -lxenctrl -lxenguest"