This is the mail archive of the
mailing list for the GCC project.
Re: -pthreads on linux
>> I take the opportunity to ask why such a discrepency (on solaris, you do
>> want the 's')?
I am just the situation reporter. It all happened before I was
involved with gcc (or at least this area).
>> Is there any reason why we don't want a uniform naming for this
It would be great if all ports configured with --enable-threads=posix
supported the same switch in addition to any classic flag (be it
-pthreads, -pthread, -threads or -thread). If --enable-threads!=posix
then use of that switch should report an error instead.
I added the logic to correctly throw the error (via a spec file check)
for the one port I maintain (see for FBSD_NO_THREADS macro-guarded
path in gcc/config/freebsd.h). This required a bit of extra
configuration code. One reason it was never well-standardized is that
every port configuration does it subtly differently. Now that the
world is going to POSIX threads (however, there will always be RTOS
and Windows that support other models), perhaps we can create more
common configuration paths for the average port which supports POSIX
threads so that they all get this feature under a common name.
> I guess it was me who put -pthread there long time ago. I don't
> remember the detail. It may be because I didn't have access to
> Solaris and/or -pthreads doesn't make much senses on Linux since
> we have libpthread.so, not libpthreads.so.
gcc/ChangeLog.0 seems to support this view. Teemu Torma added a lot
of work to support threads on 12/11/1997 (and then again on
12/25/1997). You updated Linux support on 12/16/1997. But even the
original work used multiple user-visible switches depending upon local
conventions (mainly keying off whether POSIX/pthreads were available,
non-POSIX threads used -threads or -thread instead). Over the years
people have copies an existing port to update their port for threads.