This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
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