This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

GCC commandline option names for thread support


	In December 1998, someone broached the topic of the lack of
uniformity in GCC commandline options to request re-entrant, thread-safe
libraries and headers when the target supports that option.  In the
intervening years, things have not improved.  Currently we have:

Alpha:
	OSF: -pthread/-threads
	Linux: -pthread

ARM:
	Linux: -pthread

IA-64:
	nothing yet

i386:
	Linux: -pthread
	Solaris: -pthreads/-threads
	Mingw32: -mthreads

Mips:
	Linux: -pthread

PA-RISC:
	HP/UX: -threads

PowerPC:
	AIX: -mthreads
	Lynx: -mthreads
	Linux: -pthread

Sparc:
	Solaris: -pthreads/-threads
	Linux: -pthread
	Lynx: -mthreads

GENERIC:
	FreeBSD: -pthread
	Linux: -pthread
	Lynx: -mthreads


Also, notice that Solaris uses "-pthreads" (plural), while the rest of the
systems use "-pthread".

	Only the PowerPC AIX and i386 Mingw32 Submodel Options document
the flags in Texinfo, specifically the -mthreads variants.

	The only purpose I see for Lynx's use of -mthreads is so that it
can issue warnings of conflicting options.  This could be accomplished
with the %eSTR spec instead of SUBTARGET_SWITCHES and
SUBTARGET_OVERRIDE_OPTIONS. 

	Should there be any consistency?  Is there any renewed interest in
consitency? 

	Are there any guidelines about what should be considered a
target-dependent / submodel option?  I do not see any documentation that
-pthread* and -thread* are reserved areas of the GCC commandline namespace
while -m* was reserved for the target.  Note: using -m* names requires
that dummy options appear in the SUBTARGET_SWITCHES table.

	It seems that -pthread is the GNU and open source operating system
definition.  Should we bite the bullet and convert to that as part of
gcc-3.0?  In other words, define -pthread (maybe -pthread* or -pthreads
synonym) as the commandline option for thread support, document that
option, and convert AIX, HP/UX, Lynx, Mingw32, and Solaris to use that
option name?

Thanks, David

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]