Patchwork [libfortran] PR 47491 GETLOG thread-safety breaks Solaris bootstrap

login
register
mail settings
Submitter Janne Blomqvist
Date Jan. 27, 2011, 4:58 p.m.
Message ID <AANLkTikV__vw0a=HJteVdJKW8tanVN-VVnKFouNiX3Re@mail.gmail.com>
Download mbox | patch
Permalink /patch/80716/
State New
Headers show

Comments

Janne Blomqvist - Jan. 27, 2011, 4:58 p.m.
Hi,

Rainer Orth reported that my recent patch to make the GETLOG intrinsic
thread-safe by using getpwuid_r() broke bootstrap on Solaris. The
reason is that Solaris has both the POSIX version and an older
pre-standard version with a different signature. By default the old
pre-standard version is used unless

#if (_POSIX_C_SOURCE - 0 >= 199506L) || defined(_POSIX_PTHREAD_SEMANTICS)

The attached patch hopefully fixes this issue by calling the
AC_USE_SYSTEM_EXTENSIONS macro which should set
_POSIX_PTHREAD_SEMANTICS on Solaris.

Regtested on x86_64-unknown-linux-gnu, Ok for trunk?

2011-01-27  Janne Blomqvist  <jb@gcc.gnu.org>

	PR libfortran/47491
	* configure.ac: Call AC_USE_SYSTEM_EXTENSIONS to enable common
	extensions.
	* config.h.in: Regenerate.
	* configure: Regenerate.
Tobias Burnus - Jan. 27, 2011, 5:25 p.m.
On 01/27/2011 05:58 PM, Janne Blomqvist wrote:
> Regtested on x86_64-unknown-linux-gnu, Ok for trunk?

OK. Thanks for the patch - and thanks Rainer for the help!

Tobias

> 2011-01-27  Janne Blomqvist<jb@gcc.gnu.org>
>
> 	PR libfortran/47491
> 	* configure.ac: Call AC_USE_SYSTEM_EXTENSIONS to enable common
> 	extensions.
> 	* config.h.in: Regenerate.
> 	* configure: Regenerate.
>
>
Janne Blomqvist - Jan. 27, 2011, 5:34 p.m.
On Thu, Jan 27, 2011 at 19:25, Tobias Burnus <burnus@net-b.de> wrote:
> On 01/27/2011 05:58 PM, Janne Blomqvist wrote:
>>
>> Regtested on x86_64-unknown-linux-gnu, Ok for trunk?
>
> OK. Thanks for the patch - and thanks Rainer for the help!

Thanks,

Sending        libgfortran/ChangeLog
Sending        libgfortran/config.h.in
Sending        libgfortran/configure
Sending        libgfortran/configure.ac
Transmitting file data ....
Committed revision 169334.


>
> Tobias
>
>> 2011-01-27  Janne Blomqvist<jb@gcc.gnu.org>
>>
>>        PR libfortran/47491
>>        * configure.ac: Call AC_USE_SYSTEM_EXTENSIONS to enable common
>>        extensions.
>>        * config.h.in: Regenerate.
>>        * configure: Regenerate.
>>
>>
>
>

Patch

diff --git a/libgfortran/configure.ac b/libgfortran/configure.ac
index 9b91f9a..dfbb37a 100644
--- a/libgfortran/configure.ac
+++ b/libgfortran/configure.ac
@@ -82,6 +82,8 @@  else
   LIBGFOR_IS_NATIVE=true
 fi
 
+AC_USE_SYSTEM_EXTENSIONS
+
 # Calculate toolexeclibdir
 # Also toolexecdir, though it's only used in toolexeclibdir
 case ${version_specific_libs} in