This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: binutils on mingw/mingw64 large files (>2GB) support
- From: Vladimir Simonov <sv at sw dot ru>
- To: Nick Clifton <nickc at redhat dot com>
- Cc: Ian Lance Taylor <iant at google dot com>, binutils at sourceware dot org
- Date: Thu, 06 Jan 2011 15:49:22 +0300
- Subject: Re: binutils on mingw/mingw64 large files (>2GB) support
- References: <4D1CBDFE.9060404@sw.ru> <4D25A918.50405@redhat.com>
On 01/06/2011 02:35 PM, Nick Clifton wrote:
Hi Vladimir,
objcopy built for mingw64 silently refuses to handle
files larger 2GB. The reason - mingw/mingw64 headers
(sys/stat.h) don't have _FILE_OFFSET_BITS magic.
The patch adding negative file size check is attached.
Thanks very much for submitting this patch. I have checked it in along
with this changelog entry.
Cheers
binutils/ChangeLog
2011-01-06 Vladimir Siminov <sv@sw.ru>
* bucomm.c (get_file_size): Check for negative sizes and issue a
warning message if encountered.
Hi Nick,
Thank you.
This patch just reports about the problem.
The problem fix is still actual.
What to do if build system doesn't support
_FILE_OFFSET_BITS/_LARGEFILE_SOURCE and requires
explicit stat64/fstat64/etc usage?
I see the following solutions:
1. add re-definitions for off_t, stat, fstat, etc. in
all places right after <sys/stat.h>, may be special "include"
file;
2. replace off_t, stat, fstat with bn_off_t, bn_stat,
bn_fstat (bn - means binutils) in all sources and "define"
them as stat64, fstat64 in config.h (or some another include file)
if we are on mingw, else stay with (stat, fstat);
3. wait for _FILE_OFFSET_BITS support.
My question doesn't mean that I start to implement
such massive changes immediately. I just like to know
binutils developers opinion.
Best regards
Vladimir