[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freebsd-ports
Subject:    Re: Using -as-needed in KDE
From:       Michael Nottebrock <michaelnottebrock () gmx ! net>
Date:       2005-04-10 22:43:25
Message-ID: 200504110043.30666.michaelnottebrock () gmx ! net
[Download RAW message or body]


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 
> 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 
made during the development of 5-CURRENT to globally go with -pthread and 
resolve pthread symbols not through libraries but through executables only.

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

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

[Attachment #3 (application/pgp-signature)]

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic