[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: GCC with '-threads' on SOLARIS not supported by ltmain.sh
From: |
Bob Friesenhahn |
Subject: |
Re: GCC with '-threads' on SOLARIS not supported by ltmain.sh |
Date: |
Thu, 8 Jun 2006 10:37:39 -0500 (CDT) |
On Thu, 8 Jun 2006, Eric PAIRE wrote:
The threads(3THR) manual page for Solaris specifies:
POSIX
cc -mt [ flag... ] file...- lpthread [ -lposix4 library... ]
Solaris
cc - mt [ flag... ] file...[ library... ]
But, if you read closely, you will see that the page refers to 'cc' and not
'gcc' :-(, and if you read the specs files of 'gcc', you will discover that
gcc refuses the '-mt' flag but accepts '-pthreads' flag when compiling for
POSIX threads, and '-threads' one when compiling for SOLARIS threads, without
having to add '-lpthread' (which is much simpler IMHO).
I see. A solution is to simply define -D_REENTRANT in CPPFLAGS and
then everything just works. The -mt, -threads, and -pthreads options
are just crutches.
There was a time when I was using Solaris UI threads with GCC but that
was a very long time ago. At that time I was not using any special
option except for -D_REENTRANT.
Bob
======================================
Bob Friesenhahn
address@hidden, http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer, http://www.GraphicsMagick.org/