public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/47491] New: [4.6 Regression] libgfortran: getpwuid_r (for GETLOG) breaks bootstrapping
@ 2011-01-27 15:02 burnus at gcc dot gnu.org
  2011-01-27 15:03 ` [Bug fortran/47491] " burnus at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: burnus at gcc dot gnu.org @ 2011-01-27 15:02 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47491

           Summary: [4.6 Regression] libgfortran: getpwuid_r (for GETLOG)
                    breaks bootstrapping
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Keywords: build
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: burnus@gcc.gnu.org
                CC: jb@gcc.gnu.org


Follow up to PR 47375 GETLOG thread safety:

As Rainer Orth reports, the patch breaks bootstrapping on Solaris
http://gcc.gnu.org/ml/fortran/2011-01/msg00245.html

Solaris has two versions of getpwuid_r - one matching a draft and one the final
POSIX version:

#if (_POSIX_C_SOURCE - 0 >= 199506L) || defined(_POSIX_PTHREAD_SEMANTICS)
extern int getpwuid_r(uid_t, struct passwd *, char *, int, struct passwd **);
#else
extern struct passwd *getpwuid_r(uid_t, struct passwd *, char *, int);
#endif


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug fortran/47491] [4.6 Regression] libgfortran: getpwuid_r (for GETLOG) breaks bootstrapping
  2011-01-27 15:02 [Bug fortran/47491] New: [4.6 Regression] libgfortran: getpwuid_r (for GETLOG) breaks bootstrapping burnus at gcc dot gnu.org
@ 2011-01-27 15:03 ` burnus at gcc dot gnu.org
  2011-01-27 16:11 ` ro at CeBiTec dot Uni-Bielefeld.DE
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: burnus at gcc dot gnu.org @ 2011-01-27 15:03 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47491

Tobias Burnus <burnus at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.6.0


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug fortran/47491] [4.6 Regression] libgfortran: getpwuid_r (for GETLOG) breaks bootstrapping
  2011-01-27 15:02 [Bug fortran/47491] New: [4.6 Regression] libgfortran: getpwuid_r (for GETLOG) breaks bootstrapping burnus at gcc dot gnu.org
  2011-01-27 15:03 ` [Bug fortran/47491] " burnus at gcc dot gnu.org
@ 2011-01-27 16:11 ` ro at CeBiTec dot Uni-Bielefeld.DE
  2011-01-27 16:19 ` jb at gcc dot gnu.org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: ro at CeBiTec dot Uni-Bielefeld.DE @ 2011-01-27 16:11 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47491

--- Comment #1 from ro at CeBiTec dot Uni-Bielefeld.DE <ro at CeBiTec dot Uni-Bielefeld.DE> 2011-01-27 15:57:09 UTC ---
Just FYI: as a quick hack, I've added -D_XOPEN_SOURCE=600 to AM_CPPFLAGS
in Makefile.in.  This allowed me to finish the build.  While this should
also work on Solaris 10 (the initial test was on Solaris 11), I've no
idea what will happen on Solaris 8 and 9: although they have the same
problem, they lack XPG6 support.

    Rainer


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug fortran/47491] [4.6 Regression] libgfortran: getpwuid_r (for GETLOG) breaks bootstrapping
  2011-01-27 15:02 [Bug fortran/47491] New: [4.6 Regression] libgfortran: getpwuid_r (for GETLOG) breaks bootstrapping burnus at gcc dot gnu.org
  2011-01-27 15:03 ` [Bug fortran/47491] " burnus at gcc dot gnu.org
  2011-01-27 16:11 ` ro at CeBiTec dot Uni-Bielefeld.DE
@ 2011-01-27 16:19 ` jb at gcc dot gnu.org
  2011-01-27 16:43 ` ro at CeBiTec dot Uni-Bielefeld.DE
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: jb at gcc dot gnu.org @ 2011-01-27 16:19 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47491

--- Comment #2 from Janne Blomqvist <jb at gcc dot gnu.org> 2011-01-27 16:10:41 UTC ---
Some git-grepping showed that at least libjava has in configure.ac

AC_DEFINE(_POSIX_PTHREAD_SEMANTICS, 1, [Required define if using POSIX
threads])

and in case Boehm GC is not used (which libgfortran never uses):

AC_DEFINE(_REENTRANT, 1, [Required define if using POSIX threads])

However, if I understand gcc/config/ correctly, _REENTRANT should be
automatically set for all targets that need it.

Also in gcc/config a few targets set 

-D_POSIX_C_SOURCE=199506L

(not Solaris, though). But apparently we shouldn't go and set this somewhere in
libgfortran? That is, at least no other library does this..

Moreover, in config/extensions.m4 there is the macro

AC_USE_SYSTEM_EXTENSIONS

that seems to define _POSIX_PTHREAD_SEMANTICS on Solaris.

This seems to me the most sensible solution. Would that work?


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug fortran/47491] [4.6 Regression] libgfortran: getpwuid_r (for GETLOG) breaks bootstrapping
  2011-01-27 15:02 [Bug fortran/47491] New: [4.6 Regression] libgfortran: getpwuid_r (for GETLOG) breaks bootstrapping burnus at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2011-01-27 16:19 ` jb at gcc dot gnu.org
@ 2011-01-27 16:43 ` ro at CeBiTec dot Uni-Bielefeld.DE
  2011-01-27 17:22 ` jb at gcc dot gnu.org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: ro at CeBiTec dot Uni-Bielefeld.DE @ 2011-01-27 16:43 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47491

--- Comment #3 from ro at CeBiTec dot Uni-Bielefeld.DE <ro at CeBiTec dot Uni-Bielefeld.DE> 2011-01-27 16:28:39 UTC ---
> --- Comment #2 from Janne Blomqvist <jb at gcc dot gnu.org> 2011-01-27 16:10:41 UTC ---
> Some git-grepping showed that at least libjava has in configure.ac
>
> AC_DEFINE(_POSIX_PTHREAD_SEMANTICS, 1, [Required define if using POSIX
> threads])
>
> and in case Boehm GC is not used (which libgfortran never uses):
>
> AC_DEFINE(_REENTRANT, 1, [Required define if using POSIX threads])
>
> However, if I understand gcc/config/ correctly, _REENTRANT should be
> automatically set for all targets that need it.

At least on Solaris (and I think on other targets as well), only with
-pthread.

> Also in gcc/config a few targets set 
>
> -D_POSIX_C_SOURCE=199506L
>
> (not Solaris, though). But apparently we shouldn't go and set this somewhere in
> libgfortran? That is, at least no other library does this..

That may not provide the best guidance.  I'd rather look for autoconf
and/or gnulib here.  On Solaris, this may not be enough: starting with
Solaris 10, there's POSIX.1-2001 support via -D_POSIX_C_SOURCE=200112L.

> Moreover, in config/extensions.m4 there is the macro
>
> AC_USE_SYSTEM_EXTENSIONS
>
> that seems to define _POSIX_PTHREAD_SEMANTICS on Solaris.
>
> This seems to me the most sensible solution. Would that work?

Seems so.  At least I've just found that I need -D__EXTENSIONS__ in
addition to -D_XOPEN_SOURCE=600 to get EIP defined in <sys/regset.h>
(needed by fpu-target.h).

    Rainer


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug fortran/47491] [4.6 Regression] libgfortran: getpwuid_r (for GETLOG) breaks bootstrapping
  2011-01-27 15:02 [Bug fortran/47491] New: [4.6 Regression] libgfortran: getpwuid_r (for GETLOG) breaks bootstrapping burnus at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2011-01-27 16:43 ` ro at CeBiTec dot Uni-Bielefeld.DE
@ 2011-01-27 17:22 ` jb at gcc dot gnu.org
  2011-01-27 17:57 ` jb at gcc dot gnu.org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: jb at gcc dot gnu.org @ 2011-01-27 17:22 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47491

Janne Blomqvist <jb at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                URL|                            |http://gcc.gnu.org/ml/gcc-p
                   |                            |atches/2011-01/msg02026.htm
                   |                            |l

--- Comment #4 from Janne Blomqvist <jb at gcc dot gnu.org> 2011-01-27 17:10:42 UTC ---
Patch: http://gcc.gnu.org/ml/gcc-patches/2011-01/msg02026.html

(In reply to comment #3)
> > --- Comment #2 from Janne Blomqvist <jb at gcc dot gnu.org> 2011-01-27 16:10:41 UTC ---
> > Some git-grepping showed that at least libjava has in configure.ac
> >
> > AC_DEFINE(_POSIX_PTHREAD_SEMANTICS, 1, [Required define if using POSIX
> > threads])
> >
> > and in case Boehm GC is not used (which libgfortran never uses):
> >
> > AC_DEFINE(_REENTRANT, 1, [Required define if using POSIX threads])
> >
> > However, if I understand gcc/config/ correctly, _REENTRANT should be
> > automatically set for all targets that need it.
> 
> At least on Solaris (and I think on other targets as well), only with
> -pthread.

I think that's Ok. If we're not building with threads, and lack of _REENTRANT
causes the _r() functions not to be seen, gfortran falls back to the non-_r()
functions, which is no problem on a non-threaded build.

> > Also in gcc/config a few targets set 
> >
> > -D_POSIX_C_SOURCE=199506L
> >
> > (not Solaris, though). But apparently we shouldn't go and set this somewhere in
> > libgfortran? That is, at least no other library does this..
> 
> That may not provide the best guidance.  I'd rather look for autoconf
> and/or gnulib here.  On Solaris, this may not be enough: starting with
> Solaris 10, there's POSIX.1-2001 support via -D_POSIX_C_SOURCE=200112L.

The comments at

http://blogs.gnome.org/tthurman/2008/11/23/_posix_c_source/

suggests defining POSIX_C_SOURCE might not be such a good idea, so I think it's
best to avoid this.

Also, for GNU platforms

http://www.gnu.org/s/libc/manual/html_node/Feature-Test-Macros.html

seems _GNU_SOURCE is sort of a superset of POSIX_C_SOURCE and the kitchen sink.
Which is what we're using today, hopefully the AC_USE_SYSTEM_EXTENSIONS thing
is enough to make things work on other targets.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug fortran/47491] [4.6 Regression] libgfortran: getpwuid_r (for GETLOG) breaks bootstrapping
  2011-01-27 15:02 [Bug fortran/47491] New: [4.6 Regression] libgfortran: getpwuid_r (for GETLOG) breaks bootstrapping burnus at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2011-01-27 17:22 ` jb at gcc dot gnu.org
@ 2011-01-27 17:57 ` jb at gcc dot gnu.org
  2011-01-27 20:08 ` jb at gcc dot gnu.org
  2011-02-02 18:08 ` dnovillo at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: jb at gcc dot gnu.org @ 2011-01-27 17:57 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47491

--- Comment #5 from Janne Blomqvist <jb at gcc dot gnu.org> 2011-01-27 17:34:18 UTC ---
Author: jb
Date: Thu Jan 27 17:34:14 2011
New Revision: 169334

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=169334
Log:
PR 47491 getpwuid_r() bootstrap regression on Solaris

Modified:
    trunk/libgfortran/ChangeLog
    trunk/libgfortran/config.h.in
    trunk/libgfortran/configure
    trunk/libgfortran/configure.ac


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug fortran/47491] [4.6 Regression] libgfortran: getpwuid_r (for GETLOG) breaks bootstrapping
  2011-01-27 15:02 [Bug fortran/47491] New: [4.6 Regression] libgfortran: getpwuid_r (for GETLOG) breaks bootstrapping burnus at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2011-01-27 17:57 ` jb at gcc dot gnu.org
@ 2011-01-27 20:08 ` jb at gcc dot gnu.org
  2011-02-02 18:08 ` dnovillo at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: jb at gcc dot gnu.org @ 2011-01-27 20:08 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47491

Janne Blomqvist <jb at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |FIXED
         AssignedTo|unassigned at gcc dot       |jb at gcc dot gnu.org
                   |gnu.org                     |

--- Comment #6 from Janne Blomqvist <jb at gcc dot gnu.org> 2011-01-27 19:42:58 UTC ---
Fixed, closing. Please reopen if it still doesn't work on Solaris.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug fortran/47491] [4.6 Regression] libgfortran: getpwuid_r (for GETLOG) breaks bootstrapping
  2011-01-27 15:02 [Bug fortran/47491] New: [4.6 Regression] libgfortran: getpwuid_r (for GETLOG) breaks bootstrapping burnus at gcc dot gnu.org
                   ` (6 preceding siblings ...)
  2011-01-27 20:08 ` jb at gcc dot gnu.org
@ 2011-02-02 18:08 ` dnovillo at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: dnovillo at gcc dot gnu.org @ 2011-02-02 18:08 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47491

--- Comment #7 from Diego Novillo <dnovillo at gcc dot gnu.org> 2011-02-02 17:57:34 UTC ---
Author: dnovillo
Date: Wed Feb  2 17:57:29 2011
New Revision: 169651

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=169651
Log:
PR 47491 getpwuid_r() bootstrap regression on Solaris

Modified:
    branches/google/integration/libgfortran/ChangeLog
    branches/google/integration/libgfortran/config.h.in
    branches/google/integration/libgfortran/configure
    branches/google/integration/libgfortran/configure.ac


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2011-02-02 18:08 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-27 15:02 [Bug fortran/47491] New: [4.6 Regression] libgfortran: getpwuid_r (for GETLOG) breaks bootstrapping burnus at gcc dot gnu.org
2011-01-27 15:03 ` [Bug fortran/47491] " burnus at gcc dot gnu.org
2011-01-27 16:11 ` ro at CeBiTec dot Uni-Bielefeld.DE
2011-01-27 16:19 ` jb at gcc dot gnu.org
2011-01-27 16:43 ` ro at CeBiTec dot Uni-Bielefeld.DE
2011-01-27 17:22 ` jb at gcc dot gnu.org
2011-01-27 17:57 ` jb at gcc dot gnu.org
2011-01-27 20:08 ` jb at gcc dot gnu.org
2011-02-02 18:08 ` dnovillo at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).