Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 22 Sep 2003 11:18:08 -0700
From:      "David Schwartz" <davids@webmaster.com>
To:        <deischen@freebsd.org>, "Scott Long" <scottl@freebsd.org>
Cc:        Freebsd Current <current@freebsd.org>
Subject:   RE: Fixing -pthreads (Re: ports and -current)
Message-ID:  <MDEHLPKNGKAHNMBLJOLKIEPKGMAA.davids@webmaster.com>
In-Reply-To: <Pine.GSO.4.10.10309220734510.2251-100000@pcnet5.pcnet.com>

next in thread | previous in thread | raw e-mail | index | archive | help

> On Sun, 21 Sep 2003, Scott Long wrote:

> Most everyone that writes threaded applications and runs on
> multiple platforms knows that most thread libraries are
> called libpthread and are linked to with -lpthread.  Once
> we rename libkse to libpthread, the problem largely goes
> away.  The porter, or configure script, will find libpthread
> and all should be fine.

	No, most people only fall back on trying to figure out what threading
library to link to if '-pthread' causes an error.

> There will be a libpthread and -pthread will be NOOP'd.  It
> should be a very familiar environment.

	You know another environment that has '-pthread' (that is, it does not
produce an error) but fails to compile and link pthreads code when that flag
is supplied?

> As I've said in a previous email, Solaris doesn't have -pthread
> and it hasn't seemed to cause any problems.  If you are going
> to have -pthread (libpthread), -thread (libpthread1:1),
> -thr (libthr), -uthread (libc_r), this is no different than
> making them the appropriate link arguments.

	Yes, but it returns an error when '-pthread' is supplied.

> There should be very little problem for 3rd party applications.
> -pthread won't cause an error.

	That's the problem. This will dupe configuration scripts into believing
that the option is supported.

> If there is any problem, it
> will be on the link command and it should be very obvious
> that a threading library wasn't pulled in.  Since a libpthread
> will be present on the system, it's pretty much a no-brainer
> how to fix the problem.

	Yes, by either removing the '-pthread' flag or making it work.

> This is not like we're changing kernel or library interfaces.
> I think folks are making a bigger deal out of it than it
> really is.

	The whole point of '-pthread' is to provide one standardized way to easily
figure out what magic compiler/linker flags you need so you don't have to
special case every platform. However, you are suggesting behavior for this
flag that is unlike any other platform, turning the stardization attempt on
its head.

	DS




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