Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 11 Apr 2005 00:43:25 +0200
From:      Michael Nottebrock <michaelnottebrock@gmx.net>
To:        freebsd-ports@freebsd.org
Cc:        "Alexander S. Usov" <A.S.Usov@kvi.nl>
Subject:   Re: Using -as-needed in KDE
Message-ID:  <200504110043.30666.michaelnottebrock@gmx.net>
In-Reply-To: <d3c7sp$q5r$1@sea.gmane.org>
References:  <d3c7sp$q5r$1@sea.gmane.org>

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

On Monday, 11. April 2005 00:06, Alexander S. Usov wrote:
> Hi!
>
> Recently I found somewhat strange patch to Mk/bsd.kde.mk :
>
> Revision 1.47
> Globally disable -Wl,-as-needed for all users of USE_KDELIBS_VER.
> Binaries linked with -pthread and -Wl,as-needed will have all
> references to libphthread stripped (reason/reasoning unknown),
> causing funny runtime errors when Qt decides to fire up a thread.
>
> Which I find somewhat strange, as I believe that there were reports
> of a quite measurable increase in start-up time for KDE applications
> due to the use of "-as-needed" linking flag.

Exaggerated.

> As far as I can see there are at least two ways to work around the
> issue described above.
>
> The brute-force and dirty solution is to add something like
> "-noas-needed -lptread -as-needed" to LDFLAGS.

No, that doesn't work.

> In a more cleaner way, as it is libqt-mt who needs threading in the
> first place, why not link it against libpthread?

Because we don't do that in FreeBSD, see below.

> Additionally this=20
> should solve the problems with qtk-qt-engine, which fails to load
> now for non-threaded applications.

And it would cause other problems elsewhere, which is why the decision was=
=20
made during the development of 5-CURRENT to globally go with -pthread and=20
resolve pthread symbols not through libraries but through executables only.

You can work around the problems with gtk-qt-engine by running the affected=
=20
programs with something like env LD_PRELOAD=3D/usr/lib/libpthread.so.1=20
<program>.

=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

--nextPart1149144.NDShI6nofN
Content-Type: application/pgp-signature

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

iD8DBQBCWawSXhc68WspdLARAmi5AJ47y0v/wd20pGqqHK4RCtnf3ZrqfQCgoabB
4g+5H8XYopwlE2sfdTdiFS4=
=JqcO
-----END PGP SIGNATURE-----

--nextPart1149144.NDShI6nofN--



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