All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] fix tests/migration/stress build
       [not found] <CGME20170929101124eucas1p25695c76db8f17ef8181ee2b3051bba98@eucas1p2.samsung.com>
@ 2017-09-29 10:11 ` Alexey Perevalov
       [not found]   ` <CGME20170929101125eucas1p1ed4a290bfc6fcbf6f492fc45d4e9cc10@eucas1p1.samsung.com>
  2017-09-29 10:46   ` [Qemu-devel] [PATCH] fix tests/migration/stress build Daniel P. Berrange
  0 siblings, 2 replies; 15+ messages in thread
From: Alexey Perevalov @ 2017-09-29 10:11 UTC (permalink / raw)
  To: qemu-devel
  Cc: i.maximets, heetae82.ahn, Alexey Perevalov, berrange, quintela,
	dgilbert, peterx

This small commit fixes build of tests/migration/stress on Ubuntu16.04
(on RHEL7.4 the same situation, after typical configure with following options
--target-list=x86_64-linux-user,i386-linux-user,x86_64-softmmu,i386-softmmu \
--enable-numa --enable-kvm --enable-vhost-net --enable-tpm --enable-debug \
 --disable-gtk )
PTHREAD_LIB is empty after successfully compiled pthread sample in configure.
tests/migration/stress relay on it, but -pthread is not there
and linker fails trying to resolve pthread symbols.

I still have a questions:
1. Is there a better way to obtain -thread option from QEMU_CFLAGS
2. Is linker options really necessary for stress application, because only -O3
is used, so w/o linker options in Makefile there is no need in PTHREAD_LIB
at all, I mean in whole project.
3. LINKPROG will be expanded into c++ firstly, and -static in
tests/Makefile.include will require static libstdc++, but configure doesn't
check it and in case of missing libstdc++-static.x86_64 (RHEL package name),
build will fail with the following message: "ld: cannot find -lstdc++",
I think here reasonably to use just $(CC) instead of LINKPROG, stress.c is on C.

Also ./tests/migration/guestperf.py can not be started w/o
super user privileges, and reports in this case something useless like this:
Error: [Errno 104] Connection reset by peer

This patch is based on commit 4a0d8b34e8ccf5ababdd11b29ce954aa9a5da365

Alexey Perevalov (1):
  configure: correctly define PTHREAD_LIB

 configure | 1 +
 1 file changed, 1 insertion(+)

-- 
2.7.4

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

* [Qemu-devel] [PATCH] configure: correctly define PTHREAD_LIB
       [not found]   ` <CGME20170929101125eucas1p1ed4a290bfc6fcbf6f492fc45d4e9cc10@eucas1p1.samsung.com>
@ 2017-09-29 10:11     ` Alexey Perevalov
  2017-09-29 10:40       ` Daniel P. Berrange
  0 siblings, 1 reply; 15+ messages in thread
From: Alexey Perevalov @ 2017-09-29 10:11 UTC (permalink / raw)
  To: qemu-devel
  Cc: i.maximets, heetae82.ahn, Alexey Perevalov, berrange, quintela,
	dgilbert, peterx

In case of -pthread already exists in QEMU_CFLAGS,
compilation of sample pthread program successed,
but -pthread is not putting into PTHREAD_LIBS in this case.
PTHREAD_LIB is using while compiling tests/migration/stress.

Signed-off-by: Alexey Perevalov <a.perevalov@samsung.com>
---
 configure | 1 +
 1 file changed, 1 insertion(+)

diff --git a/configure b/configure
index 6587e80..a2dd044 100755
--- a/configure
+++ b/configure
@@ -3359,6 +3359,7 @@ int main(void) {
 EOF
 if compile_prog "" "" ; then
   pthread=yes
+  PTHREAD_LIB="-pthread"
 else
   for pthread_lib in $PTHREADLIBS_LIST; do
     if compile_prog "" "$pthread_lib" ; then
-- 
2.7.4

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

* Re: [Qemu-devel] [PATCH] configure: correctly define PTHREAD_LIB
  2017-09-29 10:11     ` [Qemu-devel] [PATCH] configure: correctly define PTHREAD_LIB Alexey Perevalov
@ 2017-09-29 10:40       ` Daniel P. Berrange
  2017-09-29 12:52         ` Alexey Perevalov
  0 siblings, 1 reply; 15+ messages in thread
From: Daniel P. Berrange @ 2017-09-29 10:40 UTC (permalink / raw)
  To: Alexey Perevalov
  Cc: qemu-devel, i.maximets, heetae82.ahn, quintela, dgilbert, peterx

On Fri, Sep 29, 2017 at 01:11:14PM +0300, Alexey Perevalov wrote:
> In case of -pthread already exists in QEMU_CFLAGS,
> compilation of sample pthread program successed,
> but -pthread is not putting into PTHREAD_LIBS in this case.
> PTHREAD_LIB is using while compiling tests/migration/stress.
> 
> Signed-off-by: Alexey Perevalov <a.perevalov@samsung.com>
> ---
>  configure | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/configure b/configure
> index 6587e80..a2dd044 100755
> --- a/configure
> +++ b/configure
> @@ -3359,6 +3359,7 @@ int main(void) {
>  EOF
>  if compile_prog "" "" ; then
>    pthread=yes
> +  PTHREAD_LIB="-pthread"
>  else
>    for pthread_lib in $PTHREADLIBS_LIST; do
>      if compile_prog "" "$pthread_lib" ; then

We shouldn't do this because it affects whole of QEMU. The stress program
needs -lpthread because it is linking statically, so just add it to the
Makefile rule for building stress.

Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|

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

* Re: [Qemu-devel] [PATCH] fix tests/migration/stress build
  2017-09-29 10:11 ` [Qemu-devel] [PATCH] fix tests/migration/stress build Alexey Perevalov
       [not found]   ` <CGME20170929101125eucas1p1ed4a290bfc6fcbf6f492fc45d4e9cc10@eucas1p1.samsung.com>
@ 2017-09-29 10:46   ` Daniel P. Berrange
  2017-09-29 15:05     ` Alexey Perevalov
  1 sibling, 1 reply; 15+ messages in thread
From: Daniel P. Berrange @ 2017-09-29 10:46 UTC (permalink / raw)
  To: Alexey Perevalov
  Cc: qemu-devel, i.maximets, heetae82.ahn, quintela, dgilbert, peterx

On Fri, Sep 29, 2017 at 01:11:13PM +0300, Alexey Perevalov wrote:
> This small commit fixes build of tests/migration/stress on Ubuntu16.04
> (on RHEL7.4 the same situation, after typical configure with following options
> --target-list=x86_64-linux-user,i386-linux-user,x86_64-softmmu,i386-softmmu \
> --enable-numa --enable-kvm --enable-vhost-net --enable-tpm --enable-debug \
>  --disable-gtk )
> PTHREAD_LIB is empty after successfully compiled pthread sample in configure.
> tests/migration/stress relay on it, but -pthread is not there
> and linker fails trying to resolve pthread symbols.
> 
> I still have a questions:
> 1. Is there a better way to obtain -thread option from QEMU_CFLAGS
> 2. Is linker options really necessary for stress application, because only -O3
> is used, so w/o linker options in Makefile there is no need in PTHREAD_LIB
> at all, I mean in whole project.
> 3. LINKPROG will be expanded into c++ firstly, and -static in
> tests/Makefile.include will require static libstdc++, but configure doesn't
> check it and in case of missing libstdc++-static.x86_64 (RHEL package name),
> build will fail with the following message: "ld: cannot find -lstdc++",
> I think here reasonably to use just $(CC) instead of LINKPROG, stress.c is on C.

Yeah, changing to $(CC) is fine - and adding -lpthread to the end of the
args instead of $PTHREAD_LIB

> 
> Also ./tests/migration/guestperf.py can not be started w/o
> super user privileges, and reports in this case something useless like this:
> Error: [Errno 104] Connection reset by peer

IIRC, that's an Ubuntu problem - they pointlessly restrict their
/boot/vmlinuz files so you can't read them as non-root. Use the
--kernel arg to point to a readable image. There's no need for
the test to run privileged

Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|

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

* Re: [Qemu-devel] [PATCH] configure: correctly define PTHREAD_LIB
  2017-09-29 10:40       ` Daniel P. Berrange
@ 2017-09-29 12:52         ` Alexey Perevalov
  2017-09-29 13:05           ` Daniel P. Berrange
  0 siblings, 1 reply; 15+ messages in thread
From: Alexey Perevalov @ 2017-09-29 12:52 UTC (permalink / raw)
  To: Daniel P. Berrange
  Cc: qemu-devel, i.maximets, heetae82.ahn, quintela, dgilbert, peterx

On 09/29/2017 01:40 PM, Daniel P. Berrange wrote:
> On Fri, Sep 29, 2017 at 01:11:14PM +0300, Alexey Perevalov wrote:
>> In case of -pthread already exists in QEMU_CFLAGS,
>> compilation of sample pthread program successed,
>> but -pthread is not putting into PTHREAD_LIBS in this case.
>> PTHREAD_LIB is using while compiling tests/migration/stress.
>>
>> Signed-off-by: Alexey Perevalov <a.perevalov@samsung.com>
>> ---
>>   configure | 1 +
>>   1 file changed, 1 insertion(+)
>>
>> diff --git a/configure b/configure
>> index 6587e80..a2dd044 100755
>> --- a/configure
>> +++ b/configure
>> @@ -3359,6 +3359,7 @@ int main(void) {
>>   EOF
>>   if compile_prog "" "" ; then
>>     pthread=yes
>> +  PTHREAD_LIB="-pthread"
>>   else
>>     for pthread_lib in $PTHREADLIBS_LIST; do
>>       if compile_prog "" "$pthread_lib" ; then
> We shouldn't do this because it affects whole of QEMU. The stress program
> needs -lpthread because it is linking statically, so just add it to the
> Makefile rule for building stress.
ok, but I didn't find any explicit usage of PTHREAD_LIB,
and avoiding it in Makefile I think will make PTHREAD_LIB
redundant.

>
> Regards,
> Daniel


-- 
Best regards,
Alexey Perevalov

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

* Re: [Qemu-devel] [PATCH] configure: correctly define PTHREAD_LIB
  2017-09-29 12:52         ` Alexey Perevalov
@ 2017-09-29 13:05           ` Daniel P. Berrange
  2017-09-29 13:47             ` Alexey Perevalov
  0 siblings, 1 reply; 15+ messages in thread
From: Daniel P. Berrange @ 2017-09-29 13:05 UTC (permalink / raw)
  To: Alexey Perevalov
  Cc: qemu-devel, i.maximets, heetae82.ahn, quintela, dgilbert, peterx

On Fri, Sep 29, 2017 at 03:52:34PM +0300, Alexey Perevalov wrote:
> On 09/29/2017 01:40 PM, Daniel P. Berrange wrote:
> > On Fri, Sep 29, 2017 at 01:11:14PM +0300, Alexey Perevalov wrote:
> > > In case of -pthread already exists in QEMU_CFLAGS,
> > > compilation of sample pthread program successed,
> > > but -pthread is not putting into PTHREAD_LIBS in this case.
> > > PTHREAD_LIB is using while compiling tests/migration/stress.
> > > 
> > > Signed-off-by: Alexey Perevalov <a.perevalov@samsung.com>
> > > ---
> > >   configure | 1 +
> > >   1 file changed, 1 insertion(+)
> > > 
> > > diff --git a/configure b/configure
> > > index 6587e80..a2dd044 100755
> > > --- a/configure
> > > +++ b/configure
> > > @@ -3359,6 +3359,7 @@ int main(void) {
> > >   EOF
> > >   if compile_prog "" "" ; then
> > >     pthread=yes
> > > +  PTHREAD_LIB="-pthread"
> > >   else
> > >     for pthread_lib in $PTHREADLIBS_LIST; do
> > >       if compile_prog "" "$pthread_lib" ; then
> > We shouldn't do this because it affects whole of QEMU. The stress program
> > needs -lpthread because it is linking statically, so just add it to the
> > Makefile rule for building stress.
> ok, but I didn't find any explicit usage of PTHREAD_LIB,
> and avoiding it in Makefile I think will make PTHREAD_LIB
> redundant.

Oh yeah, actually PTHREAD_LIB is a variable i introduced specifically
for the stress program, so my comment above is wrong and I think your
patch is ok.


Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|

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

* Re: [Qemu-devel] [PATCH] configure: correctly define PTHREAD_LIB
  2017-09-29 13:05           ` Daniel P. Berrange
@ 2017-09-29 13:47             ` Alexey Perevalov
  2017-09-29 14:38               ` Daniel P. Berrange
  0 siblings, 1 reply; 15+ messages in thread
From: Alexey Perevalov @ 2017-09-29 13:47 UTC (permalink / raw)
  To: Daniel P. Berrange
  Cc: qemu-devel, i.maximets, heetae82.ahn, quintela, dgilbert, peterx

On 09/29/2017 04:05 PM, Daniel P. Berrange wrote:
> On Fri, Sep 29, 2017 at 03:52:34PM +0300, Alexey Perevalov wrote:
>> On 09/29/2017 01:40 PM, Daniel P. Berrange wrote:
>>> On Fri, Sep 29, 2017 at 01:11:14PM +0300, Alexey Perevalov wrote:
>>>> In case of -pthread already exists in QEMU_CFLAGS,
>>>> compilation of sample pthread program successed,
>>>> but -pthread is not putting into PTHREAD_LIBS in this case.
>>>> PTHREAD_LIB is using while compiling tests/migration/stress.
>>>>
>>>> Signed-off-by: Alexey Perevalov <a.perevalov@samsung.com>
>>>> ---
>>>>    configure | 1 +
>>>>    1 file changed, 1 insertion(+)
>>>>
>>>> diff --git a/configure b/configure
>>>> index 6587e80..a2dd044 100755
>>>> --- a/configure
>>>> +++ b/configure
>>>> @@ -3359,6 +3359,7 @@ int main(void) {
>>>>    EOF
>>>>    if compile_prog "" "" ; then
>>>>      pthread=yes
>>>> +  PTHREAD_LIB="-pthread"
>>>>    else
>>>>      for pthread_lib in $PTHREADLIBS_LIST; do
>>>>        if compile_prog "" "$pthread_lib" ; then
>>> We shouldn't do this because it affects whole of QEMU. The stress program
>>> needs -lpthread because it is linking statically, so just add it to the
>>> Makefile rule for building stress.
>> ok, but I didn't find any explicit usage of PTHREAD_LIB,
>> and avoiding it in Makefile I think will make PTHREAD_LIB
>> redundant.
> Oh yeah, actually PTHREAD_LIB is a variable i introduced specifically
> for the stress program, so my comment above is wrong and I think your
> patch is ok.
in that hardcoded form or trying to generalize it somehow?

-pthread comes to QEMU_CFLAGS from pkg-config --cflags for glib library
so it's hard to say which one from list -pthread -lpthread -lpthreadGC2
really lead to success build of the sample.
So it's better to cut pthread from QEMU_CFLAGS, or you thing it's overkill?

>
>
> Regards,
> Daniel


-- 
Best regards,
Alexey Perevalov

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

* Re: [Qemu-devel] [PATCH] configure: correctly define PTHREAD_LIB
  2017-09-29 13:47             ` Alexey Perevalov
@ 2017-09-29 14:38               ` Daniel P. Berrange
       [not found]                 ` <CGME20171002083119eucas1p191b8bdf0c990b86a7290c28b65312b86@eucas1p1.samsung.com>
  2017-10-02  8:30                 ` [Qemu-devel] [PATCH] Makefile: don't use LINKPROG for tests/migration/stress Alexey Perevalov
  0 siblings, 2 replies; 15+ messages in thread
From: Daniel P. Berrange @ 2017-09-29 14:38 UTC (permalink / raw)
  To: Alexey Perevalov
  Cc: qemu-devel, i.maximets, heetae82.ahn, quintela, dgilbert, peterx

On Fri, Sep 29, 2017 at 04:47:01PM +0300, Alexey Perevalov wrote:
> On 09/29/2017 04:05 PM, Daniel P. Berrange wrote:
> > On Fri, Sep 29, 2017 at 03:52:34PM +0300, Alexey Perevalov wrote:
> > > On 09/29/2017 01:40 PM, Daniel P. Berrange wrote:
> > > > On Fri, Sep 29, 2017 at 01:11:14PM +0300, Alexey Perevalov wrote:
> > > > > In case of -pthread already exists in QEMU_CFLAGS,
> > > > > compilation of sample pthread program successed,
> > > > > but -pthread is not putting into PTHREAD_LIBS in this case.
> > > > > PTHREAD_LIB is using while compiling tests/migration/stress.
> > > > > 
> > > > > Signed-off-by: Alexey Perevalov <a.perevalov@samsung.com>
> > > > > ---
> > > > >    configure | 1 +
> > > > >    1 file changed, 1 insertion(+)
> > > > > 
> > > > > diff --git a/configure b/configure
> > > > > index 6587e80..a2dd044 100755
> > > > > --- a/configure
> > > > > +++ b/configure
> > > > > @@ -3359,6 +3359,7 @@ int main(void) {
> > > > >    EOF
> > > > >    if compile_prog "" "" ; then
> > > > >      pthread=yes
> > > > > +  PTHREAD_LIB="-pthread"
> > > > >    else
> > > > >      for pthread_lib in $PTHREADLIBS_LIST; do
> > > > >        if compile_prog "" "$pthread_lib" ; then
> > > > We shouldn't do this because it affects whole of QEMU. The stress program
> > > > needs -lpthread because it is linking statically, so just add it to the
> > > > Makefile rule for building stress.
> > > ok, but I didn't find any explicit usage of PTHREAD_LIB,
> > > and avoiding it in Makefile I think will make PTHREAD_LIB
> > > redundant.
> > Oh yeah, actually PTHREAD_LIB is a variable i introduced specifically
> > for the stress program, so my comment above is wrong and I think your
> > patch is ok.
> in that hardcoded form or trying to generalize it somehow?
> 
> -pthread comes to QEMU_CFLAGS from pkg-config --cflags for glib library
> so it's hard to say which one from list -pthread -lpthread -lpthreadGC2
> really lead to success build of the sample.
> So it's better to cut pthread from QEMU_CFLAGS, or you thing it's overkill?

The stress program uses pthreads so we can't just cut it. We just need to
set -pthread IMHO.

Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|

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

* Re: [Qemu-devel] [PATCH] fix tests/migration/stress build
  2017-09-29 10:46   ` [Qemu-devel] [PATCH] fix tests/migration/stress build Daniel P. Berrange
@ 2017-09-29 15:05     ` Alexey Perevalov
  0 siblings, 0 replies; 15+ messages in thread
From: Alexey Perevalov @ 2017-09-29 15:05 UTC (permalink / raw)
  To: Daniel P. Berrange
  Cc: qemu-devel, i.maximets, heetae82.ahn, quintela, dgilbert, peterx

On 09/29/2017 01:46 PM, Daniel P. Berrange wrote:
> On Fri, Sep 29, 2017 at 01:11:13PM +0300, Alexey Perevalov wrote:
>> This small commit fixes build of tests/migration/stress on Ubuntu16.04
>> (on RHEL7.4 the same situation, after typical configure with following options
>> --target-list=x86_64-linux-user,i386-linux-user,x86_64-softmmu,i386-softmmu \
>> --enable-numa --enable-kvm --enable-vhost-net --enable-tpm --enable-debug \
>>   --disable-gtk )
>> PTHREAD_LIB is empty after successfully compiled pthread sample in configure.
>> tests/migration/stress relay on it, but -pthread is not there
>> and linker fails trying to resolve pthread symbols.
>>
>> I still have a questions:
>> 1. Is there a better way to obtain -thread option from QEMU_CFLAGS
>> 2. Is linker options really necessary for stress application, because only -O3
>> is used, so w/o linker options in Makefile there is no need in PTHREAD_LIB
>> at all, I mean in whole project.
>> 3. LINKPROG will be expanded into c++ firstly, and -static in
>> tests/Makefile.include will require static libstdc++, but configure doesn't
>> check it and in case of missing libstdc++-static.x86_64 (RHEL package name),
>> build will fail with the following message: "ld: cannot find -lstdc++",
>> I think here reasonably to use just $(CC) instead of LINKPROG, stress.c is on C.
> Yeah, changing to $(CC) is fine - and adding -lpthread to the end of the
> args instead of $PTHREAD_LIB
ok, but I think it's possible to swap CXX and CC in LINKPROG,
like that
-LINKPROG = $(or $(CXX),$(CC))
+LINKPROG = $(or $(CC), $(CXX))
in this case CC will be invoked early,
I think that issue with static library is general for all LINKPROG
usage, lie EXESUF and DSOSUF, isn't it?
>
>> Also ./tests/migration/guestperf.py can not be started w/o
>> super user privileges, and reports in this case something useless like this:
>> Error: [Errno 104] Connection reset by peer
> IIRC, that's an Ubuntu problem - they pointlessly restrict their
> /boot/vmlinuz files so you can't read them as non-root. Use the
> --kernel arg to point to a readable image. There's no need for
> the test to run privileged
>
> Regards,
> Daniel


-- 
Best regards,
Alexey Perevalov

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

* [Qemu-devel] [PATCH] fix tests/migration/stress build in case of absend static libc++
       [not found]                 ` <CGME20171002083119eucas1p191b8bdf0c990b86a7290c28b65312b86@eucas1p1.samsung.com>
@ 2017-10-02  8:30                   ` Alexey Perevalov
  0 siblings, 0 replies; 15+ messages in thread
From: Alexey Perevalov @ 2017-10-02  8:30 UTC (permalink / raw)
  To: qemu-devel
  Cc: Alexey Perevalov, i.maximets, berrange, heetae82.ahn, quintela,
	dgilbert, peterx

Hello Daniel,
I decided just to use CC instead of swapping CXX and CC in LINKPROG,
and keep PTHREAD_LIB untouched, once your decided previous patch is ok.



Alexey Perevalov (1):
  Makefile: don't use LINKPROG for tests/migration/stress

 tests/Makefile.include | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-- 
2.7.4

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

* [Qemu-devel] [PATCH] Makefile: don't use LINKPROG for tests/migration/stress
  2017-09-29 14:38               ` Daniel P. Berrange
       [not found]                 ` <CGME20171002083119eucas1p191b8bdf0c990b86a7290c28b65312b86@eucas1p1.samsung.com>
@ 2017-10-02  8:30                 ` Alexey Perevalov
  2017-10-02 11:14                   ` Peter Maydell
  1 sibling, 1 reply; 15+ messages in thread
From: Alexey Perevalov @ 2017-10-02  8:30 UTC (permalink / raw)
  To: qemu-devel
  Cc: Alexey Perevalov, i.maximets, berrange, heetae82.ahn, quintela,
	dgilbert, peterx

This patch just replaces  LINKPROG for CC.
LINKPROG invokes both CXX and CC.
So in case of static linking of C source, static libstdc++
is required by build, but it could be missing in system.
And static libstdc++ may not be needed for whole QEMU.

Signed-off-by: Alexey Perevalov <a.perevalov@samsung.com>
---
 tests/Makefile.include | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/Makefile.include b/tests/Makefile.include
index abc6707..bf94516 100644
--- a/tests/Makefile.include
+++ b/tests/Makefile.include
@@ -803,7 +803,7 @@ tests/numa-test$(EXESUF): tests/numa-test.o
 tests/vmgenid-test$(EXESUF): tests/vmgenid-test.o tests/boot-sector.o tests/acpi-utils.o
 
 tests/migration/stress$(EXESUF): tests/migration/stress.o
-	$(call quiet-command, $(LINKPROG) -static -O3 $(PTHREAD_LIB) -o $@ $< ,"LINK","$(TARGET_DIR)$@")
+	$(call quiet-command, $(CC) -static -O3 $(PTHREAD_LIB) -o $@ $< ,"LINK","$(TARGET_DIR)$@")
 
 INITRD_WORK_DIR=tests/migration/initrd
 
-- 
2.7.4

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

* Re: [Qemu-devel] [PATCH] Makefile: don't use LINKPROG for tests/migration/stress
  2017-10-02  8:30                 ` [Qemu-devel] [PATCH] Makefile: don't use LINKPROG for tests/migration/stress Alexey Perevalov
@ 2017-10-02 11:14                   ` Peter Maydell
  2017-10-02 11:17                     ` Daniel P. Berrange
  0 siblings, 1 reply; 15+ messages in thread
From: Peter Maydell @ 2017-10-02 11:14 UTC (permalink / raw)
  To: Alexey Perevalov
  Cc: QEMU Developers, heetae82.ahn, Juan Quintela,
	Dr. David Alan Gilbert, Peter Xu, i.maximets

On 2 October 2017 at 09:30, Alexey Perevalov <a.perevalov@samsung.com> wrote:
> This patch just replaces  LINKPROG for CC.
> LINKPROG invokes both CXX and CC.
> So in case of static linking of C source, static libstdc++
> is required by build, but it could be missing in system.
> And static libstdc++ may not be needed for whole QEMU.
>
> Signed-off-by: Alexey Perevalov <a.perevalov@samsung.com>
> ---
>  tests/Makefile.include | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tests/Makefile.include b/tests/Makefile.include
> index abc6707..bf94516 100644
> --- a/tests/Makefile.include
> +++ b/tests/Makefile.include
> @@ -803,7 +803,7 @@ tests/numa-test$(EXESUF): tests/numa-test.o
>  tests/vmgenid-test$(EXESUF): tests/vmgenid-test.o tests/boot-sector.o tests/acpi-utils.o
>
>  tests/migration/stress$(EXESUF): tests/migration/stress.o
> -       $(call quiet-command, $(LINKPROG) -static -O3 $(PTHREAD_LIB) -o $@ $< ,"LINK","$(TARGET_DIR)$@")
> +       $(call quiet-command, $(CC) -static -O3 $(PTHREAD_LIB) -o $@ $< ,"LINK","$(TARGET_DIR)$@")
>
>  INITRD_WORK_DIR=tests/migration/initrd

Why does this executable need to define its own link rule anyway?
Ideally it should just use the standard rules.mak LINK function
like everything else. If it does need to do something weird
it should have a comment saying why it's weird...

thanks
-- PMM

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

* Re: [Qemu-devel] [PATCH] Makefile: don't use LINKPROG for tests/migration/stress
  2017-10-02 11:14                   ` Peter Maydell
@ 2017-10-02 11:17                     ` Daniel P. Berrange
  2017-10-02 11:19                       ` Peter Maydell
  0 siblings, 1 reply; 15+ messages in thread
From: Daniel P. Berrange @ 2017-10-02 11:17 UTC (permalink / raw)
  To: Peter Maydell
  Cc: Alexey Perevalov, heetae82.ahn, Juan Quintela,
	Dr. David Alan Gilbert, Peter Xu, QEMU Developers, i.maximets

On Mon, Oct 02, 2017 at 12:14:39PM +0100, Peter Maydell wrote:
> On 2 October 2017 at 09:30, Alexey Perevalov <a.perevalov@samsung.com> wrote:
> > This patch just replaces  LINKPROG for CC.
> > LINKPROG invokes both CXX and CC.
> > So in case of static linking of C source, static libstdc++
> > is required by build, but it could be missing in system.
> > And static libstdc++ may not be needed for whole QEMU.
> >
> > Signed-off-by: Alexey Perevalov <a.perevalov@samsung.com>
> > ---
> >  tests/Makefile.include | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/tests/Makefile.include b/tests/Makefile.include
> > index abc6707..bf94516 100644
> > --- a/tests/Makefile.include
> > +++ b/tests/Makefile.include
> > @@ -803,7 +803,7 @@ tests/numa-test$(EXESUF): tests/numa-test.o
> >  tests/vmgenid-test$(EXESUF): tests/vmgenid-test.o tests/boot-sector.o tests/acpi-utils.o
> >
> >  tests/migration/stress$(EXESUF): tests/migration/stress.o
> > -       $(call quiet-command, $(LINKPROG) -static -O3 $(PTHREAD_LIB) -o $@ $< ,"LINK","$(TARGET_DIR)$@")
> > +       $(call quiet-command, $(CC) -static -O3 $(PTHREAD_LIB) -o $@ $< ,"LINK","$(TARGET_DIR)$@")
> >
> >  INITRD_WORK_DIR=tests/migration/initrd
> 
> Why does this executable need to define its own link rule anyway?
> Ideally it should just use the standard rules.mak LINK function
> like everything else. If it does need to do something weird
> it should have a comment saying why it's weird...

Primarily because we're static linking this binary so that it can be put
into an initrd without needing any extra files added. It doesn't use any
of the 3rd party libraries the rest of QEMU uses - ie no glib2 in particular.

Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|

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

* Re: [Qemu-devel] [PATCH] Makefile: don't use LINKPROG for tests/migration/stress
  2017-10-02 11:17                     ` Daniel P. Berrange
@ 2017-10-02 11:19                       ` Peter Maydell
  2017-10-02 11:21                         ` Daniel P. Berrange
  0 siblings, 1 reply; 15+ messages in thread
From: Peter Maydell @ 2017-10-02 11:19 UTC (permalink / raw)
  To: Daniel P. Berrange
  Cc: Alexey Perevalov, heetae82.ahn, Juan Quintela,
	Dr. David Alan Gilbert, Peter Xu, QEMU Developers, i.maximets

On 2 October 2017 at 12:17, Daniel P. Berrange <berrange@redhat.com> wrote:
> On Mon, Oct 02, 2017 at 12:14:39PM +0100, Peter Maydell wrote:
>> Why does this executable need to define its own link rule anyway?
>> Ideally it should just use the standard rules.mak LINK function
>> like everything else. If it does need to do something weird
>> it should have a comment saying why it's weird...
>
> Primarily because we're static linking this binary so that it can be put
> into an initrd without needing any extra files added. It doesn't use any
> of the 3rd party libraries the rest of QEMU uses - ie no glib2 in particular.

Oh, are we committing our usual error of trying to build guest
binaries with the host toolchain?

thanks
-- PMM

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

* Re: [Qemu-devel] [PATCH] Makefile: don't use LINKPROG for tests/migration/stress
  2017-10-02 11:19                       ` Peter Maydell
@ 2017-10-02 11:21                         ` Daniel P. Berrange
  0 siblings, 0 replies; 15+ messages in thread
From: Daniel P. Berrange @ 2017-10-02 11:21 UTC (permalink / raw)
  To: Peter Maydell
  Cc: Alexey Perevalov, heetae82.ahn, Juan Quintela,
	Dr. David Alan Gilbert, Peter Xu, QEMU Developers, i.maximets

On Mon, Oct 02, 2017 at 12:19:54PM +0100, Peter Maydell wrote:
> On 2 October 2017 at 12:17, Daniel P. Berrange <berrange@redhat.com> wrote:
> > On Mon, Oct 02, 2017 at 12:14:39PM +0100, Peter Maydell wrote:
> >> Why does this executable need to define its own link rule anyway?
> >> Ideally it should just use the standard rules.mak LINK function
> >> like everything else. If it does need to do something weird
> >> it should have a comment saying why it's weird...
> >
> > Primarily because we're static linking this binary so that it can be put
> > into an initrd without needing any extra files added. It doesn't use any
> > of the 3rd party libraries the rest of QEMU uses - ie no glib2 in particular.
> 
> Oh, are we committing our usual error of trying to build guest
> binaries with the host toolchain?

That's not an error here - this test suite is only intended to run with
matching host/guest arch, and boots with the host kernel + custom initrd
containing only this binary.

Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|

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

end of thread, other threads:[~2017-10-02 11:21 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CGME20170929101124eucas1p25695c76db8f17ef8181ee2b3051bba98@eucas1p2.samsung.com>
2017-09-29 10:11 ` [Qemu-devel] [PATCH] fix tests/migration/stress build Alexey Perevalov
     [not found]   ` <CGME20170929101125eucas1p1ed4a290bfc6fcbf6f492fc45d4e9cc10@eucas1p1.samsung.com>
2017-09-29 10:11     ` [Qemu-devel] [PATCH] configure: correctly define PTHREAD_LIB Alexey Perevalov
2017-09-29 10:40       ` Daniel P. Berrange
2017-09-29 12:52         ` Alexey Perevalov
2017-09-29 13:05           ` Daniel P. Berrange
2017-09-29 13:47             ` Alexey Perevalov
2017-09-29 14:38               ` Daniel P. Berrange
     [not found]                 ` <CGME20171002083119eucas1p191b8bdf0c990b86a7290c28b65312b86@eucas1p1.samsung.com>
2017-10-02  8:30                   ` [Qemu-devel] [PATCH] fix tests/migration/stress build in case of absend static libc++ Alexey Perevalov
2017-10-02  8:30                 ` [Qemu-devel] [PATCH] Makefile: don't use LINKPROG for tests/migration/stress Alexey Perevalov
2017-10-02 11:14                   ` Peter Maydell
2017-10-02 11:17                     ` Daniel P. Berrange
2017-10-02 11:19                       ` Peter Maydell
2017-10-02 11:21                         ` Daniel P. Berrange
2017-09-29 10:46   ` [Qemu-devel] [PATCH] fix tests/migration/stress build Daniel P. Berrange
2017-09-29 15:05     ` Alexey Perevalov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.