[poppler] Can't open files bigger than 2 GB on linux with cmake-generated config.h

Albert Astals Cid aacid at kde.org
Tue May 21 15:23:02 PDT 2013


El Divendres, 26 d'abril de 2013, a les 01:24:41, Fabio D'Urso va escriure:
> Hi,

Hi

> 
> I compile poppler via CMake and, if I try to open a large file (>2 GB) on my
> 32-bit linux system, I get the following error:
>  Error: Couldn't open file 'big.pdf': Value too large for defined data type.
> 
> Turns out that open() refuses to open large files unless
>  #define _FILE_OFFSET_BITS 64
> is defined.
> 
> So I've checked how config.h is generated and I noticed that only autotool's
> config.h.in defines _FILE_OFFSET_BITS.
> CMake's config.h.cmake has this and a few similar macros commented out:
> 
>  /* Number of bits in a file offset, on hosts where this is settable. */
>  /* #undef _FILE_OFFSET_BITS */
> 
>  /* Define to 1 to make fseeko visible on some hosts (e.g. glibc 2.2). */
>  /* #undef _LARGEFILE_SOURCE */
> 
>  /* Define for large files, on AIX-style hosts. */
>  /* #undef _LARGE_FILES */
> 
> On my system, manually setting #define _FILE_OFFSET_BITS 64
> in the generated config.h file is enough to make LFS work.
> 
> Unfortunately, cmake stuff is out of my comfort zone, so I can't write a
> proper patch myself :(

Can you try the following patch and tell me if it helps?

Cheers,
  Albert

> 
> Fabio
> 
> _______________________________________________
> poppler mailing list
> poppler at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/poppler
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cmakeoffset
Type: text/x-patch
Size: 3116 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/poppler/attachments/20130521/f33306c1/attachment.bin>


More information about the poppler mailing list