gcc -pthread

Mark Andrews Mark_Andrews at isc.org
Thu Jun 15 05:05:17 UTC 2006


	Is there any good reason why "gcc -pthread" links in
	-lpthead except when -shared is specified?

	Also the gcc man page does not match reality.

       -pthread
              Link a user-threaded process against libc_r instead of libc.

	man pthread mentions these libraries but provided no discussion
	on if or when you should include them on the command line.  Nor
	does it mention "-pthread".

LIBRARY
     POSIX Threads Library (libpthread, -lpthread)
     1:1 Threading Library (libthr, -lthr)
     Reentrant C Library (libc_r, -lc_r)

	The hacker handbook seems to indicate that you shouldn't need
	to use -lpthread or -lc_r.

	http://www.freebsd.org/doc/en_US.ISO8859-1/books/porters-handbook/dads-pthread.html

	Mark
-- 
Mark Andrews, ISC
1 Seymour St., Dundas Valley, NSW 2117, Australia
PHONE:	+61 2 9871 4742		         INTERNET: Mark_Andrews at isc.org


More information about the freebsd-stable mailing list