cvs commit: doc/en_US.ISO8859-1/books/porters-handbook book.sgml

chinsan chinsan.tw at gmail.com
Sat Jul 21 11:37:07 UTC 2007


On 7/20/07, Pav Lucistnik <pav at freebsd.org> wrote:
> chinsan píše v pá 20. 07. 2007 v 21:06 +0800:

> > Since "PTHREAD_LIBS?= -pthread", so why we should replace it again?
> > Therefore, it was guessed as a typo of "-lpthread" instead of "-pthread".
> > Because PTHREAD_LIBS = -pthread. :)
> >
>
> People are supposed to patch s|-pthread|${PTHREAD_LIBS}| too, because
> PTHREAD_LIBS are not guaranteed to be equal to -pthread forever.
>


So...according to what you means,
we should update the "12.12 Threading libraries" section....?

"12.12 Threading libraries

The threading library must be linked to the binaries using a special
linker flag -pthread on FreeBSD. If a port insists on linking
-lpthread or -lc_r directly, patch it to use PTHREAD_LIBS variable
provided by the ports framework. This variable usually has the value
of -pthread, but on certain architectures and FreeBSD versions it can
have different values, so do not just hardcode -pthread into patches
and always use PTHREAD_LIBS.

    Note: If building the port errors out with unrecognized option
'-pthread' when setting PTHREAD_LIBS, it may be desirable to use gcc
as linker by setting CONFIGURE_ENV to LD=${CC}. The -pthread option is
not supported by ld directly.
"


More information about the cvs-doc mailing list