This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: compilation for files > 2Gb
- To: "Zack Weinberg" <zackw at stanford dot edu>
- Subject: Re: compilation for files > 2Gb
- From: BLATS at fr dot ibm dot com
- Date: Thu, 25 Jan 2001 18:44:21 +0100
- cc: egcs at thewrittenword dot com, Jakub Jelinek <jakub at redhat dot com>, gcc at gcc dot gnu dot org
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
occur
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
request
regards
_______________________________________________________________________
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
MLV
Email : sblat@emea.att.com
France
"Zack Weinberg" <zackw@stanford.edu> on 25/01/2001 18:19:35
Please respond to "Zack Weinberg" <zackw@stanford.edu>
To: egcs@thewrittenword.com
cc: Jakub Jelinek <jakub@redhat.com>, Stephane Blat/France/IBM@IBMFR,
gcc@gcc.gnu.org
Subject: Re: compilation for files > 2Gb
On Thu, Jan 25, 2001 at 10:42:36AM -0600, egcs@thewrittenword.com wrote:
> On Thu, Jan 25, 2001 at 04:08:51PM +0100, Jakub Jelinek wrote:
> > On Thu, Jan 25, 2001 at 03:56:48PM +0100, BLATS@fr.ibm.com wrote:
> > > I would like to know if in gcc compilation option there is a option
(like
> > > -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
do
> > 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
support
> > transparently) resp. -D_LARGEFILE64_SOURCE (if you want to explicitely
use
> > 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.
zw