From: Baruch Siach <baruch@tkos.co.il>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH] dbus: use -pthread instead of -lpthread
Date: Mon, 30 Jun 2014 21:46:24 +0300 [thread overview]
Message-ID: <20140630184624.GK4425@tarshish> (raw)
In-Reply-To: <20140630200616.35edc9da@free-electrons.com>
Hi Thomas,
On Mon, Jun 30, 2014 at 08:06:16PM +0200, Thomas Petazzoni wrote:
> On Mon, 30 Jun 2014 17:54:27 +0100, Vicente Olivert Riera wrote:
>
> > >> ifeq ($(BR2_PREFER_STATIC_LIB),y)
> > >> -DBUS_CONF_OPT += LIBS='-lpthread'
> > >> +DBUS_CONF_OPT += LIBS='-pthread'
> > >
> > > Can you explain how this change solves the build failure?
> >
> > Yes. When dnsmasq tries to link against dbus it checks the dbus
> > pkgconfig file to obtain the LIBS that it need to pass to the linker. In
> > the dbus .pc file you have "-ldbus-1 -lpthread" because you used
> > -lpthread when building dbus. If you use -pthread when you build dbus,
> > then you will have -pthread in the dbus .pc file as well.
>
> I think it'd be good to have an updated version of the patch that gives
> this explanation + an explanation of the difference between -pthread
> and -lpthread and how this difference solves the problem.
Getting a definite answer on this (-lpthread vs -pthread) is not easy, it
seems. According to
http://stackoverflow.com/questions/23250863/difference-between-pthread-and-lpthread-while-compiling
-pthread also defines _REENTRANT and __USE_REENTRANT. I guess that this is
related to initialization of thread local storage (TLS) at glibc.
baruch
--
http://baruch.siach.name/blog/ ~. .~ Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
- baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -
prev parent reply other threads:[~2014-06-30 18:46 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-30 16:28 [Buildroot] [PATCH] dbus: use -pthread instead of -lpthread Vicente Olivert Riera
2014-06-30 16:49 ` Baruch Siach
2014-06-30 16:54 ` Vicente Olivert Riera
2014-06-30 18:06 ` Thomas Petazzoni
2014-06-30 18:46 ` Baruch Siach [this message]
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=20140630184624.GK4425@tarshish \
--to=baruch@tkos.co.il \
--cc=buildroot@busybox.net \
/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 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.