This is the mail archive of the 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]

Re: compilation for files > 2Gb

in fact,  I would like to use the fopen and fclose function for files > 2Gb
(it's not a C source > 2 Gb)

I use squid and I don't know if  a problem when my logs file reach 2Gb can
Before I used cc on AIX with -D_LARGE_FILES option to compile squid
now I would like to use gcc

perhaps  -D_FILE_OFFSET_BITS=64  or -D_LARGEFILE64_SOURCE answer to my


Stephane Blat   -   Internet Team Leader       AT&T Global Network Services
Phone : +33 1 49 31 43 45  --  Int 71 43 45 -- Fax : +33 1 43 03 69 43
Email :

"Zack Weinberg" <> on 25/01/2001 18:19:35

Please respond to "Zack Weinberg" <>

cc:   Jakub Jelinek <>, Stephane Blat/France/IBM@IBMFR,
Subject:  Re: compilation for files > 2Gb

On Thu, Jan 25, 2001 at 10:42:36AM -0600, wrote:
> On Thu, Jan 25, 2001 at 04:08:51PM +0100, Jakub Jelinek wrote:
> > On Thu, Jan 25, 2001 at 03:56:48PM +0100, wrote:
> > > I would like to know if in gcc compilation option there is a option
> > > -D_LARGE_FILES in AIX wiht cc) in order to open file > 2Gb or
> > > gcc by default authorize the use of files > 2Gb
> >
> > Unless you are trying to compile 5Gb sources files, this has nothing to
> > with gcc, it is a matter of your C library.
> > E.g. with GNU libc you can use -D_FILE_OFFSET_BITS=64 (to get LFS
> > transparently) resp. -D_LARGEFILE64_SOURCE (if you want to explicitely
> > open64/stat64 etc. for LFS).
> This can be determined automatically with the attached autoconf macro
> from Paul Eggert (m4/largefile.m4 from tar 1.13.19). How about
> including this in the gcc build process so gcc can process source
> files >2GB?

This isn't sufficient to support source >2GB in the C and C++
compilers (I don't know about the others).  Their lexer maps the
entire file into memory.  On 32-bit architectures there won't be room
for a file that large.  (On sensible 64-bit architectures off_t is
already 64 bits and there is no distinction between open and open64.)

Honestly, I cannot think of a legitimate reason why anyone would need
a C(++) source file that large.  I could be persuaded otherwise with
an example, but until one arises, I don't see any need to support them
in GCC.


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