Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 6 Dec 2004 08:14:23 +0100
From:      Michael Nottebrock <michaelnottebrock@gmx.net>
To:        freebsd-ports@freebsd.org
Cc:        Joe Marcus Clarke <marcus@freebsd.org>
Subject:   Re: RFC: [Long] Change PTHREAD_LIBS to -pthread for -CURRENT
Message-ID:  <200412060814.27158.michaelnottebrock@gmx.net>
In-Reply-To: <1086673141.18374.35.camel@shumai.marcuscom.com>
References:  <1086673141.18374.35.camel@shumai.marcuscom.com>

next in thread | previous in thread | raw e-mail | index | archive | help
--nextPart2476318.N2zTyOBhqN
Content-Type: text/plain;
  charset="iso-8859-15"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

On Tuesday, 8. June 2004 07:39, Joe Marcus Clarke wrote:
> So, I propose changing PTHREAD_LIBS to -pthread for -CURRENT.  This will
> match what we have in 4.X, and will last for the life of 5.X going
> forward.  The threading people tell me this is doable now.  Thoughts?

I'm reviving this thread because KDE has recently started to make use of th=
e=20
=2D-as-needed flag of GNU ld in their build system. --as-needed removes=20
dependencies on unneeded shared libraries at link time (standard behaviour =
is=20
to just link to everything that's specified on the command line). Now,=20
=2D-as-needed doesn't seem to be smart enough to correctly identify 'needed=
'=20
dependencies in some tricky cases, in particular with the threads libraries=
=2E=20

KDE applications linked with --as-needed will typically not retain a link t=
o=20
libpthread, since hardly any KDE application actually needs the pthread=20
symbols. However, they all do link to libqt-mt, and libqt-mt does make use =
of=20
threading. Result: Applications randomly break at runtime when Qt wants to=
=20
make use of threading functions. The Linux people just shrug their shoulder=
s=20
and say we should link the library against the threads lib instead of the=20
applications and say -pthread is bullshit.
They have a point: The above scenario would work, and with --as-needed, a=20
whole lot of linkage could be saved on many application binaries and startu=
p=20
times would improve.

Is there any way I'm missing to make --as-needed play nicely with -pthread?=
 It=20
strikes me as odd that the gcc people favour -pthread and GNU ld sabotages=
=20
it...

=2D-=20
   ,_,   | Michael Nottebrock               | lofi@freebsd.org
 (/^ ^\) | FreeBSD - The Power to Serve     | http://www.freebsd.org
   \u/   | K Desktop Environment on FreeBSD | http://freebsd.kde.org

--nextPart2476318.N2zTyOBhqN
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (FreeBSD)

iD8DBQBBtAbTXhc68WspdLARAgp5AKCFHWZ0QRpOvP0u4HoLIFuTvaB6YwCgl6Lt
O4t03OmpOBeT/lGVU4Bd64A=
=PlC9
-----END PGP SIGNATURE-----

--nextPart2476318.N2zTyOBhqN--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200412060814.27158.michaelnottebrock>