From owner-freebsd-ports@FreeBSD.ORG Mon Dec 6 07:14:41 2004 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 054AB16A4CF for ; Mon, 6 Dec 2004 07:14:41 +0000 (GMT) Received: from mail.gmx.net (mail.gmx.de [213.165.64.20]) by mx1.FreeBSD.org (Postfix) with SMTP id D928043D3F for ; Mon, 6 Dec 2004 07:14:37 +0000 (GMT) (envelope-from michaelnottebrock@gmx.net) Received: (qmail 14279 invoked by uid 65534); 6 Dec 2004 07:14:36 -0000 Received: from pD955FB4E.dip.t-dialin.net (EHLO lofi.dyndns.org) (217.85.251.78) by mail.gmx.net (mp002) with SMTP; 06 Dec 2004 08:14:36 +0100 X-Authenticated: #443188 Received: from kiste.my.domain (kiste.my.domain [192.168.8.4]) (authenticated bits=0) by lofi.dyndns.org (8.12.10/8.12.10) with ESMTP id iB67EUwd070845 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO); Mon, 6 Dec 2004 08:14:32 +0100 (CET) (envelope-from michaelnottebrock@gmx.net) From: Michael Nottebrock To: freebsd-ports@freebsd.org Date: Mon, 6 Dec 2004 08:14:23 +0100 User-Agent: KMail/1.7.1 References: <1086673141.18374.35.camel@shumai.marcuscom.com> In-Reply-To: <1086673141.18374.35.camel@shumai.marcuscom.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart2476318.N2zTyOBhqN"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200412060814.27158.michaelnottebrock@gmx.net> X-Virus-Scanned: by amavisd-new cc: Joe Marcus Clarke Subject: Re: RFC: [Long] Change PTHREAD_LIBS to -pthread for -CURRENT X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Dec 2004 07:14:41 -0000 --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--