Re: Initial list of ports that fail due to -pthread

From: Stijn Hoop <stijn_at_win.tue.nl>
Date: Wed, 24 Sep 2003 08:01:35 +0200
On Wed, Sep 24, 2003 at 01:49:50AM -0400, Daniel Eischen wrote:
> If FreeBSD wants to take the simple approach and only support
> one thread library in ports (-pthread == -lpthread) and not
> make it selectable via PTHREAD_LIBS, then its not a problem.
> It would be nice to be able to support all our thread
> libraries, but I grow weary.

Just an idea (I hope this hasn't been said before in the mega thread but at
least I didn't get it this way):

- fix all ports to respect PTHREAD_LIBS _ON THE LINKING STAGE_ (so no
  global search & replace, for it shouldn't be used in compile command lines)
- keep '-pthread' as a compiler option, which maps to a NOOP for compiling
  and '-lpthread' (aka libkse) for linking
- set PTHREAD_LIBS to the default value of -pthread
- allow PTHREAD_LIBS to be set to something other, e.g. '-lthr', in
  /etc/make.conf (or the make command line)

What is the problem with this approach? You get both a 'standard' -pthread
knob, _and_ the ability to select your threads library using ports.
Third party apps that use -pthread will work. The only case in which some
work has to be done by a FreeBSD user is when they want to link a non-ported
third-party app with a library other than libpthread (libkse).

--Stijn

-- 
"Linux has many different distributions, meaning that you can probably find
one that is exactly what you want (I even found one that looked like a Unix
system)."
		-- Mike Meyer, from a posting at questions_at_freebsd.org

Received on Tue Sep 23 2003 - 21:01:03 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:37:23 UTC