public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* PATCH RFA: Build system: Use AC_SYS_LARGEFILE
@ 2010-11-02 22:21 Ian Lance Taylor
  2010-11-03  1:01 ` Paolo Bonzini
  0 siblings, 1 reply; 19+ messages in thread
From: Ian Lance Taylor @ 2010-11-02 22:21 UTC (permalink / raw)
  To: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 1378 bytes --]

The include/simple-object.h file I added earlier today uses off_t in
function declarations.  That breaks some 32-bit hosts because the
libiberty configure script uses AC_SYS_LARGEFILE and the gcc configure
script does not.  The size of off_t changes depending on the value of
the preprocessor macro _FILE_OFFSET_BITS, and that is changed by the
configure script when AC_SYS_LARGEFILE is used.

There are various possibilities here, but the simplest would seem to be
to use AC_SYS_LARGEFILE in the configure script for gcc.  We should use
it in libcpp also, as libcpp does file I/O and should be able to handle
large files.

This patch does that.  It has passed stage 2 in my bootstrap on
x86_64-unknown-linux-gnu, so I don't think it is horribly broken.  I of
course do not expect any changes on that target, but I don't have a
32-bit hosted build readily available.  As far as I can see this patch
is completely safe.  We've been using AC_SYS_LARGEFILE in the libiberty
configure script for quite a while.

Is this patch OK to commit if it completes bootstrap and testing?

Thanks.

Ian


gcc/:

2010-11-02  Ian Lance Taylor  <iant@google.com>

	* configure.ac: Use AC_SYS_LARGEFILE.
	* configure: Rebuild.
	* config.in: Rebuild.

libcpp/:

2010-11-02  Ian Lance Taylor  <iant@google.com>

	* configure.ac: Use AC_SYS_LARGEFILE.
	* configure: Rebuild.
	* config.in: Rebuild.



[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: largefile --]
[-- Type: text/x-diff, Size: 736 bytes --]

Index: gcc/configure.ac
===================================================================
--- gcc/configure.ac	(revision 166189)
+++ gcc/configure.ac	(working copy)
@@ -304,6 +304,8 @@ AC_USE_SYSTEM_EXTENSIONS
 AC_PROG_CPP
 AC_C_INLINE
 
+AC_SYS_LARGEFILE
+
 # sizeof(char) is 1 by definition.
 AC_CHECK_SIZEOF(void *)
 AC_CHECK_SIZEOF(short)
Index: libcpp/configure.ac
===================================================================
--- libcpp/configure.ac	(revision 166218)
+++ libcpp/configure.ac	(working copy)
@@ -14,6 +14,8 @@ AC_PROG_CC
 AC_PROG_CXX
 AC_PROG_RANLIB
 
+AC_SYS_LARGEFILE
+
 # See if we are building gcc with C++.
 # Do this early so setting lang to C++ affects following tests
 AC_ARG_ENABLE(build-with-cxx,

^ permalink raw reply	[flat|nested] 19+ messages in thread
* PATCH RFA: Build system: Use AC_SYS_LARGEFILE
@ 2010-11-09 14:15 David Edelsohn
  2010-11-09 14:19 ` Paolo Bonzini
  2010-11-09 15:26 ` Ian Lance Taylor
  0 siblings, 2 replies; 19+ messages in thread
From: David Edelsohn @ 2010-11-09 14:15 UTC (permalink / raw)
  To: Ian Lance Taylor; +Cc: Richard Guenther, Paolo Bonzini, GCC Patches

> 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

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

end of thread, other threads:[~2010-11-11 19:52 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-02 22:21 PATCH RFA: Build system: Use AC_SYS_LARGEFILE Ian Lance Taylor
2010-11-03  1:01 ` Paolo Bonzini
2010-11-03  8:29   ` Jakub Jelinek
2010-11-03 10:49   ` Richard Guenther
2010-11-03 10:49     ` Paolo Bonzini
2010-11-03 14:41     ` Ian Lance Taylor
2010-11-03 14:51       ` Richard Guenther
2010-11-03 15:41         ` Ian Lance Taylor
2010-11-09 14:15 David Edelsohn
2010-11-09 14:19 ` Paolo Bonzini
2010-11-09 14:19   ` David Edelsohn
2010-11-09 15:26 ` Ian Lance Taylor
2010-11-09 15:35   ` David Edelsohn
2010-11-09 16:52     ` Ian Lance Taylor
2010-11-09 16:55       ` Paolo Bonzini
2010-11-09 18:19         ` David Edelsohn
2010-11-09 18:37           ` Ian Lance Taylor
2010-11-11 16:27         ` David Edelsohn
2010-11-11 19:58           ` Paolo Bonzini

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).