This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

PATCH RFA: Build system: Use AC_SYS_LARGEFILE


> Richard Guenther <richard.guenther@gmail.com> writes:
>
> > On Wed, Nov 3, 2010 at 3:30 PM, Ian Lance Taylor <iant@google.com> wrote:
> >> Richard Guenther <richard.guenther@gmail.com> writes:
> >>
> >>> I did this once and had to revert it again because it broke bootstrap
> >>> on AIX in some obscure way. ÂBut yes, we carry this patch in our
> >>> local GCC versions since a few major releases.
> >>
> >> Perhaps the problem then was that libiberty did not use
> >> AC_SYS_LARGEFILE? ÂThat was added to libiberty 2008-10-07.
> >>
> >> In any case I committed the patch.
> >
> > FYI, http://gcc.gnu.org/ml/gcc-patches/2009-02/msg00706.html
>
> Thanks. ?I checked a bunch of .c files in gcc and libcpp, and they all
> reliably #included "config.h" first. ?I didn't check every file, but I
> didn't find any exceptions to the rule. ?So I think this is fixable.
>
> David, can you let us know what fails when bootstrapping current
> mainline on AIX?

Sorry, I never received this email.  I do not know if gnu.org dropped
it or Gmail decided that email from google.com was SPAM again.  I also
did not see this thread because I was traveling.

Guess what?  AIX bootstrap is broken.  To enable LARGE FILES support
on AIX, the definition

#define _LARGE_FILES 1

must come first before any system header files are included, otherwise
the 64 bit IO symbols starts conflicting, e.g.,

In file included from /farm/dje/src/src/gcc/gengtype-parse.c:21:
/farm/dje/src/src/gcc/system.h:55:1: warning: "freopen" redefined
In file included from /farm/dje/src/src/gcc/system.h:42,
                 from /farm/dje/src/src/gcc/gengtype-parse.c:21:
/gsa/yktgsa-p4/06/gnu/aix/5.3/power/bin/../lib/gcc/powerpc-ibm-aix5.3.0.0/4.1.3/
include/stdio.h:111:1: warning: this is the location of the previous definition
In file included from /farm/dje/src/src/gcc/system.h:236,
                 from /farm/dje/src/src/gcc/gengtype-lex.l:26:
/usr/include/unistd.h:171: error: conflicting types for 'lseek64'
/usr/include/unistd.h:169: error: previous declaration of 'lseek64' was here
In file included from /usr/include/unistd.h:737,
                 from /farm/dje/src/src/gcc/system.h:236,
                 from /farm/dje/src/src/gcc/gengtype-lex.l:26:
/usr/include/sys/lockf.h:64: error: conflicting types for 'lockf64'
/usr/include/sys/lockf.h:62: error: previous declaration of 'lockf64' was here
In file included from /farm/dje/src/src/gcc/system.h:236,
                 from /farm/dje/src/src/gcc/gengtype-lex.l:26:
/usr/include/unistd.h:800: error: conflicting types for 'ftruncate64'
/usr/include/unistd.h:798: error: previous declaration of 'ftruncate64' was here
/usr/include/unistd.h:836: error: conflicting types for 'truncate64'
/usr/include/unistd.h:834: error: previous declaration of 'truncate64' was here
/usr/include/unistd.h:853: error: conflicting types for 'pread64'
/usr/include/unistd.h:850: error: previous declaration of 'pread64' was here
/usr/include/unistd.h:854: error: conflicting types for 'pwrite64'
/usr/include/unistd.h:851: error: previous declaration of 'pwrite64' was here
/usr/include/unistd.h:921: error: conflicting types for 'fclear64'
/usr/include/unistd.h:918: error: previous declaration of 'fclear64' was here
/usr/include/unistd.h:922: error: conflicting types for 'fsync_range64'
/usr/include/unistd.h:919: error: previous declaration of
'fsync_range64' was here

One can see the problem in gengtype-lex.c:

#line 2 "gengtype-lex.c"
#include <stdio.h>
...
#define YY_NO_INPUT 1
#line 25 "/farm/dje/src/src/gcc/gengtype-lex.l"
#include "bconfig.h"
#include "system.h"

bconfig.h includes auto-host.h, which defines _LARGE_FILES.

libcpp/directives.c also fails with similar errors, although it is not
obvious how headers are included in the wrong order

I have no objection to enabling LARGE FILES support in GCC, but the
headers must be included in the correct order to allow bootstrap on
AIX.

Also, given this problem, I want to try a meta-experiment: At the GCC
Summit, some Google developers proposed that any patch causing
breakage immediately be reverted, following the practice at Google.
Jakub mentioned on IRC that reverting the patch will break bootstrap
on i386-linux and other targets.  So Googlers, how do you want to
proceed and demonstrate your own proposed policy in action?

Thanks, David


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]