[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: GCC and -pthread



On Sun, Feb 03, 2002 at 01:33:42AM -0500, Matt Zimmerman wrote:
> It is odd that gcc supports this on some platforms and not on others.  On
> i386, it appears to merely add -lpthread to the command line.  It doesn't
> even produce a warning.

This has been a thorn in our (our == gcc maintainers) side for a long time.
The idea at the time (as far as we can figure out) was to support whatever
command-line options would make the most sense for a programmer used to
a particular platform.  Uniformity was a word lacking from the vocabulary
of the early GCC developers...

So for systems supporting POSIX threads, it's -pthread (which Does The
Right Thing for whatever that platform needs).  On systems supporting only
one style of thread, some native package, it's just "-threads".  You get
the idea.  I think this is documented somewhere, but don't recall where.


> The versions of gcc are also different in this case, so it is possible that
> this could be fixed with a newer version of gcc-3.0.  If not, then either
> gcc should be fixed to report an error (if appropriate) or the configure
> test in libmikmod should be changed to detect this some other way.

Nope, the 3.1 sources suffer from this same misfeature.  And we're about
to freeze those.

Many of us would welcome some saner scheme, but you've got to fight the
"once supported, always supported" folks (RMS is one of them; we're still
supporting horrible crap in the preprocessor just for older versions of
emacs).  Most of us don't have that much time or energy.  (Or in my case,
that much patience.)

Personally, I think the best that can be accomplished is to introduce
some saner scheme (-threads=foo, maybe, similar to the --enable-threads
configure options), and then make -threads/-mthreads/-pthreads synonyms for
the sane versions.  The latter would have to be done on a per-platform basis.


Phil

-- 
If ye love wealth greater than liberty, the tranquility of servitude greater
than the animating contest for freedom, go home and leave us in peace.  We seek
not your counsel, nor your arms.  Crouch down and lick the hand that feeds you;
and may posterity forget that ye were our countrymen.            - Samuel Adams



Reply to: