If you look at the output from -# you'll see that you are actually 
passing -p -t -hread to the compiler.

$ cc -# -c t.c -pthread
### cc: Note: NLSPATH = 
/opt/SunStudioExpress/prod/bin/../lib/locale/%L/LC_MESSAGES/%N.cat:/opt/SunStudioExpress/prod/bin/../../lib/locale/%L/LC_MESSAGES/%N.cat
###     command line files and options (expanded):
### -# -c t.c -p -t -hread

You need to pass -mt, and that's all the pthread library from S10 
onwards is part of libc.

Regards,

Darryl.


Vincent Torri wrote:
> here is a test case:
> 
> #include <pthread.h>
> 
> int main()
> {
>   pthread_mutex_t mutex;
>   pthread_mutex_init(&mutex, NULL);
>   return 0;
> }
> 
> I compile with that command:
> 
> suncc -c -o test_pthread.o test_pthread.c -pthread
> 
> then: nm -C test_pthread.o |grep mcount
> 
> mcount appears as UNDEF
> 
> Vincent Torri
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> tools-compilers mailing list
> tools-compilers at opensolaris.org

Reply via email to