On 1/18/26 14:53, Rainer Orth wrote:
Rainer Orth <[email protected]> writes:
gcc supports -pthread/-pthreads on Solaris to provide a way to
transparently handle the platform-specific needs of multitheaded
programs. In the past, this used to link with -lpthread. However, this
has been removed in
config: -pthread shouldn't link with -lpthread on Solaris
https://gcc.gnu.org/pipermail/gcc-patches/2023-April/615080.html
since libpthread had been folded into libc.
The only thing these options do now is to define _REENTRANT and
_PTHREADS. In Solaris 11.4, the system headers no longer reference the
former. Checking gnulib as an important source of portability
information, I find that _REENTRANT is used for two purposes:
* Ensure that strerror_r, localtime_r and gmtime_r are declared.
However, these declarations are no longer guarded by _REENTRANT, so
this is moot.
* Besides, _REENTRANT is defined on Solaris in general, but this has no
longer any effect.
There's no reference _PTHREADS at all, so this seems to be an ancient
relic no longer needed at all.
This patch silently ignores both options, keeping them for portability's
sake.
Bootstrapped without regressions on i386-pc-solaris2.11 and
sparc-sun-solaris2.11.
Unless someone comes up, I mean to commit this after a couple of days.
there have been no comments, but I've merged the documentation with
Sandra's updated version from here recent Solaris docs patch, which
actually inspired this one.
Unless she's suggestions for the wording, I'm going to commit it soon.
Whoops, I totally missed that you'd posted the previous version of this
patch before I got around to pushing the revised docs patch I'd already
had in my pile. :-(
If GCC is going to ignore this option, it would be consistent with what
I've done elsewhere for options with the "Ignore" property to remove the
documentation entirely. We have so many options and the manual is so
long that I don't see much point in giving long-winded explanations of
what options used to do, if they no longer do anything useful any more
in the present version of GCC. If you think this is a compatibility
issue that might trip up users, a release note seems like a better place
to document the changed behavior; text in the manual is just going to
get more and more bit-rotten and irrelevant over time. (E.g., in my
last batch of patches I removed some long-obsolete text about what used
to happen for some x86 option pre GCC 4.4.)
-Sandra