[Mingw-w64-public] Large file support?

2018-03-06 Thread Christer Solskogen

Hi!

I've compiled a Atari ST emulator that can record video. The one I've 
compiled the emulator crashes when the recorded video reaches a certain 
size and from what I can gather it's because off_t is 32bit, even if the 
the compiler is x86_64.


Using built-in specs.
COLLECT_GCC=/opt/cross-mingw-w64/bin/x86_64-w64-mingw32-gcc
COLLECT_LTO_WRAPPER=/opt/cross-mingw-w64/bin/../lib/gcc/x86_64-w64-mingw32/7.3.1/lto-wrapper
Target: x86_64-w64-mingw32

Configured with: 
/home/solskogen/mingw-w64-builder/trunk/bin/gcc/configure 
--prefix=/home/solskogen/obj/cross-mingw-w64 
--libexecdir=/home/solskogen/obj/cross-mingw-w64/lib 
--target=x86_64-w64-mingw32 --disable-nls --enable-fully-dynamic-string 
--enable-libstdcxx-time=yes --enable-languages=c,c++ 
--disable-libstdcxx-pch --enable-checking=release --enable-lto 
--disable-dw2-exceptions --enable-libgomp --enable-threads=posix 
--disable-multilib --with-sysroot=/home/solskogen/obj/cross-mingw-w64



mingw-w64 is from the 5.x branch of mingw-w64.

With the compiler I used I get this with a small program:

sizeof off_t: 4 bytes

While on Linux
sizeof off_t: 8 bytes


solskogen@friend:~/temp$ cat test.c
#include 

int main(int argc, char *argv[])
{
printf("sizeof off_t: %lu bytes\n",sizeof(off_t));
return 0;
}


--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


Re: [Mingw-w64-public] Large file support?

2018-03-06 Thread JonY via Mingw-w64-public
On 03/06/2018 12:48 PM, Christer Solskogen wrote:
> Hi!
> 
> I've compiled a Atari ST emulator that can record video. The one I've
> compiled the emulator crashes when the recorded video reaches a certain
> size and from what I can gather it's because off_t is 32bit, even if the
> the compiler is x86_64.

We cannot change the definition of off_t without breaking compatibility,
so use off64_t explicitly instead.

Or try recompiling with -D_POSIX=1 -D_FILE_OFFSET_BITS=64.



signature.asc
Description: OpenPGP digital signature
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


Re: [Mingw-w64-public] Large file support?

2018-03-06 Thread Christer Solskogen

On 06.03.2018 14:13, JonY via Mingw-w64-public wrote:


Or try recompiling with -D_POSIX=1 -D_FILE_OFFSET_BITS=64.


Thanks, that worked!

--
chs


--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


Re: [Mingw-w64-public] Large file support?

2018-03-06 Thread Ozkan Sezer
On 3/6/18, Christer Solskogen  wrote:
> On 06.03.2018 14:13, JonY via Mingw-w64-public wrote:
>>
>> Or try recompiling with -D_POSIX=1 -D_FILE_OFFSET_BITS=64.
>
> Thanks, that worked!

Is _FILE_OFFSET_BITS is really tied to _POSIX?  IIRC, _POSIX had more
side effects which may or may not be wanted (or I may be wrong..)

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


Re: [Mingw-w64-public] Large file support?

2018-03-06 Thread JonY via Mingw-w64-public
On 03/06/2018 02:10 PM, Ozkan Sezer wrote:
> On 3/6/18, Christer Solskogen  wrote:
>> On 06.03.2018 14:13, JonY via Mingw-w64-public wrote:
>>>
>>> Or try recompiling with -D_POSIX=1 -D_FILE_OFFSET_BITS=64.
>>
>> Thanks, that worked!
> 
> Is _FILE_OFFSET_BITS is really tied to _POSIX?  IIRC, _POSIX had more
> side effects which may or may not be wanted (or I may be wrong..)
> 

Just looking into the headers gave that.


signature.asc
Description: OpenPGP digital signature
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public