You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by "Spinka, Kristofer" <ks...@style.net> on 2003/03/31 23:41:03 UTC

Re: anybody using Sun's compiler and getting libthread referenced by executables but not libpthread? (fwd)

1. It's an out of date, and Solaris-biased (as opposed to POISX), man
page.  Even on Solaris 9.

====
http://docs.sun.com/source/816-2454/cc_ops.app.html#pgfId-999925

A.3.42 -mt
Macro option that expands to -D_REENTRANT -lthread. If you are doing your
own multithread coding, you must use this option in the compile and link
steps. To obtain faster execution, this option requires a multiprocessor
system. On a single-processor system, the resulting executable usually
runs more slowly with this option.
====

2. _POSIX_C_SOURCE=199506L tells the compiler to use POSIX.1c interfaces
as opposed to Solaris (or other) interfaces for symbols that might have the
same name.  I suppose apr/httpd could get by with just
_POSIX_PTHREAD_SEMANTICS, to take care of the threads, but I think it
would be a benefit to be sure that the correct (POISX) sections of the
Solaris header files are being processed.

   /kristofer

On Mon, 31 Mar 2003, Jeff Trawick wrote:

> Spinka, Kristofer wrote:
> >   To be sure that the compiler is respecting the POSIX behavior, remove
> > the "-mt" and add "-D_POSIX_C_SOURCE=199506L" and link with -lpthread.
>
> "man pthread_create" says "cc -mt foo.c -lpthread"
>
> _POSIX_C_SOURCE=199506L sounds like something to force my program to use
> only those interfaces described in some particular document...  we want
> access to everything the platform offers
>
>



Re: anybody using Sun's compiler and getting libthread referenced by executables but not libpthread? (fwd)

Posted by Jeff Trawick <tr...@attglobal.net>.
Spinka, Kristofer wrote:
>   Can we take the -mt flag out of the works?

that makes sense to me based on the doc


Re: anybody using Sun's compiler and getting libthread referenced by executables but not libpthread? (fwd)

Posted by "Spinka, Kristofer" <ks...@style.net>.
  Can we take the -mt flag out of the works?

   /kristofer

On Mon, 31 Mar 2003, Jeff Trawick wrote:

> Spinka, Kristofer wrote:
> > 1. Clarification: -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT should be
> > specified explicitly.  During linking, -lpthread should be specified explictly.
>
> existing code does that via apr_hints.m4
>
> I'm testing some changes to apr_hints.m4 now that will make sure
> -lpthread is specified explicitly.
>
> Thanks,
>
> Jeff
>
>


Re: anybody using Sun's compiler and getting libthread referenced by executables but not libpthread? (fwd)

Posted by Jeff Trawick <tr...@attglobal.net>.
Spinka, Kristofer wrote:
> 1. Clarification: -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT should be
> specified explicitly.  During linking, -lpthread should be specified explictly.

existing code does that via apr_hints.m4

I'm testing some changes to apr_hints.m4 now that will make sure 
-lpthread is specified explicitly.

Thanks,

Jeff


Re: anybody using Sun's compiler and getting libthread referenced by executables but not libpthread? (fwd)

Posted by "Spinka, Kristofer" <ks...@style.net>.
1. Clarification: -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT should be
specified explicitly.  During linking, -lpthread should be specified explictly.

   /kristofer

On Mon, 31 Mar 2003, Spinka, Kristofer wrote:

> 1. It's an out of date, and Solaris-biased (as opposed to POISX), man
> page.  Even on Solaris 9.
>
> ====
> http://docs.sun.com/source/816-2454/cc_ops.app.html#pgfId-999925
>
> A.3.42 -mt
> Macro option that expands to -D_REENTRANT -lthread. If you are doing your
> own multithread coding, you must use this option in the compile and link
> steps. To obtain faster execution, this option requires a multiprocessor
> system. On a single-processor system, the resulting executable usually
> runs more slowly with this option.
> ====
>
> 2. _POSIX_C_SOURCE=199506L tells the compiler to use POSIX.1c interfaces
> as opposed to Solaris (or other) interfaces for symbols that might have the
> same name.  I suppose apr/httpd could get by with just
> _POSIX_PTHREAD_SEMANTICS, to take care of the threads, but I think it
> would be a benefit to be sure that the correct (POISX) sections of the
> Solaris header files are being processed.
>
>    /kristofer
>
> On Mon, 31 Mar 2003, Jeff Trawick wrote:
>
> > Spinka, Kristofer wrote:
> > >   To be sure that the compiler is respecting the POSIX behavior, remove
> > > the "-mt" and add "-D_POSIX_C_SOURCE=199506L" and link with -lpthread.
> >
> > "man pthread_create" says "cc -mt foo.c -lpthread"
> >
> > _POSIX_C_SOURCE=199506L sounds like something to force my program to use
> > only those interfaces described in some particular document...  we want
> > access to everything the platform offers
> >
> >
>
>
>


Re: anybody using Sun's compiler and getting libthread referenced by executables but not libpthread? (fwd)

Posted by "Spinka, Kristofer" <ks...@style.net>.
1. Clarification: -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT should be
specified explicitly.  During linking, -lpthread should be specified explictly.

   /kristofer

On Mon, 31 Mar 2003, Spinka, Kristofer wrote:

> 1. It's an out of date, and Solaris-biased (as opposed to POISX), man
> page.  Even on Solaris 9.
>
> ====
> http://docs.sun.com/source/816-2454/cc_ops.app.html#pgfId-999925
>
> A.3.42 -mt
> Macro option that expands to -D_REENTRANT -lthread. If you are doing your
> own multithread coding, you must use this option in the compile and link
> steps. To obtain faster execution, this option requires a multiprocessor
> system. On a single-processor system, the resulting executable usually
> runs more slowly with this option.
> ====
>
> 2. _POSIX_C_SOURCE=199506L tells the compiler to use POSIX.1c interfaces
> as opposed to Solaris (or other) interfaces for symbols that might have the
> same name.  I suppose apr/httpd could get by with just
> _POSIX_PTHREAD_SEMANTICS, to take care of the threads, but I think it
> would be a benefit to be sure that the correct (POISX) sections of the
> Solaris header files are being processed.
>
>    /kristofer
>
> On Mon, 31 Mar 2003, Jeff Trawick wrote:
>
> > Spinka, Kristofer wrote:
> > >   To be sure that the compiler is respecting the POSIX behavior, remove
> > > the "-mt" and add "-D_POSIX_C_SOURCE=199506L" and link with -lpthread.
> >
> > "man pthread_create" says "cc -mt foo.c -lpthread"
> >
> > _POSIX_C_SOURCE=199506L sounds like something to force my program to use
> > only those interfaces described in some particular document...  we want
> > access to everything the platform offers
> >
> >
>
>
>