This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: -pthread switch and binary compatibitity
- From: Ian Lance Taylor <iant at google dot com>
- To: "John Maddock" <john at johnmaddock dot co dot uk>
- Cc: <gcc at gcc dot gnu dot org>
- Date: Tue, 15 Apr 2008 14:30:01 -0700
- Subject: Re: -pthread switch and binary compatibitity
- References: <00f701c89f22$c9c56340$3cea0c52@fuji>
"John Maddock" <john@johnmaddock.co.uk> writes:
> The crux of the issue is this: if gcc/g++ 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?
Yes, modulo the #define of _REENTRANT.
> If the answer is yes, then is it commonplace to link object files compiled
> with and without -pthread?
Yes.
In general, all the -pthread option does is turn on -D_REENTRANT
during compilation and -lpthread during linking. There is some
cross-platform variation--different -D and -l options--but in no case
does -pthread lead to a different ABI.
Ian