[PATCH] Thread-safe libgfortran (PRs fortran/14943 and fortran/21647)
Jakub Jelinek
jakub@redhat.com
Tue Nov 22 16:11:00 GMT 2005
On Tue, Nov 22, 2005 at 10:53:13AM -0500, David Edelsohn wrote:
> >>>>> Steve Kargl writes:
>
> Steve> Sorry about the problem. Is bootstrap broken for AIX
> Steve> on mainline as well?
>
> Yes, bootstrap is broken on mainline as well.
>
> Something about the patch is causing internal prototype conflicts
> in the AIX header files for size_from_kind.c.
>
> In file included from
> /farm/dje/src/src/libgfortran/../gcc/gthr-posix.h:44,
> from /farm/dje/src/src/libgfortran/../gcc/gthr-aix.h:33,
> from ../../../gcc/gthr-default.h:1,
> from /farm/dje/src/src/libgfortran/../gcc/gthr.h:114,
> from /farm/dje/src/src/libgfortran/io/io.h:39,
> from
> /farm/dje/src/src/libgfortran/io/size_from_kind.c:34:
> /usr/include/unistd.h:171: error: conflicting types for 'lseek64'
> /usr/include/unistd.h:169: error: previous declaration of 'lseek64' was
> here
>
> The header file includes:
>
> #ifdef _LARGE_FILES
> #define lseek lseek64
> #endif
> ...
> #ifdef _LARGE_FILE_API
> extern off64_t lseek64(int, off64_t, int);
> #endif
>
> libgfortran/config.h defines _LARGE_FILES for both the default and
> the pthread multilib. _LARGE_FILE_API is being defined somewhere for the
> pthread multilib after Jakub's patch.
The only two changes that could cause this in the patch are in
libgfortran/Makefile.{am,in}:
--- libgfortran/Makefile.am (revision 107252)
+++ libgfortran/Makefile.am (working copy)
@@ -16,7 +16,9 @@ libgfortranbegin_la_LDFLAGS = -static
## io.h conflicts with some a system header on some platforms, so
## use -iquote
-AM_CPPFLAGS = -iquote$(srcdir)/io
+AM_CPPFLAGS = -iquote$(srcdir)/io -I$(srcdir)/$(MULTISRCTOP)../gcc \
+ -I$(srcdir)/$(MULTISRCTOP)../gcc/config \
+ -I$(MULTIBUILDTOP)../../gcc -D_GNU_SOURCE
gfor_io_src= \
io/close.c \
1) the addition of gcc's include dirs
2) addition of -D_GNU_SOURCE
Does AIX use _GNU_SOURCE for anything? If so, we'd need to autoconfize
addition of -D_GNU_SOURCE for Linux only.
Perhaps output of -E -dD on size_from_kind.c could shed light into this...
Jakub
More information about the Fortran
mailing list