qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Daniel P. Berrange" <berrange@redhat.com>
To: Alexey Perevalov <a.perevalov@samsung.com>
Cc: qemu-devel@nongnu.org, i.maximets@samsung.com,
	heetae82.ahn@samsung.com, quintela@redhat.com,
	dgilbert@redhat.com, peterx@redhat.com
Subject: Re: [Qemu-devel] [PATCH] configure: correctly define PTHREAD_LIB
Date: Fri, 29 Sep 2017 15:38:12 +0100	[thread overview]
Message-ID: <20170929143812.GG11930@redhat.com> (raw)
In-Reply-To: <9195f261-08fb-c71d-0d95-3c8ae0080142@samsung.com>

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 :|

  reply	other threads:[~2017-09-29 14:38 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [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 [this message]
     [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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170929143812.GG11930@redhat.com \
    --to=berrange@redhat.com \
    --cc=a.perevalov@samsung.com \
    --cc=dgilbert@redhat.com \
    --cc=heetae82.ahn@samsung.com \
    --cc=i.maximets@samsung.com \
    --cc=peterx@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).