This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: [PATCH] Thread-safe libgfortran (PRs fortran/14943 and fortran/21647)
On Tue, Nov 22, 2005 at 11:50:06AM -0500, David Edelsohn wrote:
> >>>>> Jakub Jelinek writes:
>
> Jakub> The only two changes that could cause this in the patch are in
> Jakub> libgfortran/Makefile.{am,in}:
>
> The problem was exposed by
>
> * io/io.h: Include gthr.h.
>
> AIX must multilib pthread support. gthr-aix.h includes gthr-single.h by
> default and gthr-posix.h when -pthread is enabled. gthr-single.h does not
> include unistd.h; gthr-posix.h does include that header.
>
> libgfortran uses AC_SYS_LARGEFILE, which defines _LARGE_FILES in
> config.h. _LARGE_FILES and _LARGE_FILE_API conflict. The latter macro is
> the preferred method on AIX and what libstdc++-v3 uses on AIX.
>
> The underlying problem is that libgfortran should define
> _LARGE_FILE_API on AIX instead of _LARGE_FILES. Any ideas on how to
> accomplish that?
>
Would the following in io.h work
#ifdef _AIX
#ifdef _LARGE_FILE
#undef _LARGE_FILE
#endif
#define _LARGE_FILE_API 1
#include <gthr-aix.h>
#else
#include <gthr.h>
#endif
--
Steve