This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: -pthread switch and binary compatibility.
- From: Loren James Rittle <rittle at latour dot labs dot mot dot com>
- To: libstdc++ at gcc dot gnu dot org
- Cc: john at johnmaddock dot co dot uk
- Date: Thu, 24 Apr 2008 14:35:30 -0500 (CDT)
- Subject: Re: -pthread switch and binary compatibility.
- Reply-to: rittle at labs dot mot dot com
Hello John,
> The crux of the issue is this: if libstdc++ is configured with the pthread
> threading model, then are object files always binary compatible irrespective
> of whether they are compiled with the -pthread command line option or not?
Sorry for the delay in answering this simple question. The short
answer is that the library (libstdc++-v3) itself is designed and
implemented to allow compilation/linking with or without -pthread
(when the target platform itself supports weak symbols) even when it
was configured to use e.g. the posix thread model. This might be
broken on any particular target for reasons outside the control of the
library (i.e. system headers or libraries). The FAQ for libstdc++-v3
has more details.
(This area of the library implementation has been revised extensively
since I worked on it in 2001-2002 and we collectively defined the
related design rules on this mailing list however the rule remains.)
Regards,
Loren