, since _LARGEFILE64_SOURCE is automatically defined by the project. So this would explain why passing _FILE_OFFSET_BITS didn't work.
So I have two questions regarding this:
1) Does anyone know what is the reason behind undefining _FILE_OFFSET_BITS?
From my understanding, it should be able to coexist with _LARGEFILE64_SOURCE, since they have different purposes.
2) The open() call that leads to this is in gzlib.c: https://github.com/madler/zlib/blob/v1.3/gzlib.c#L235
The local function gz_open is called by both gzopen and gzopen64 (among others). Shouldn't gzopen64 use open64 instead?
I am using zlib version 1.3 and compiling for 32-bit Linux, nothing out of the ordinary.
When compiling zlib with default flags, I noticed it uses
open
instead ofopen64
, making it incompatible with LFS:I tried to pass it
-D_FILE_OFFSET_BITS=64
throughCMAKE_C_FLAGS
but this still had no effect.Looking through the code, I see that
_FILE_OFFSET_BITS
is explicitly undefined in gzguts.h:, since
_LARGEFILE64_SOURCE
is automatically defined by the project. So this would explain why passing_FILE_OFFSET_BITS
didn't work.So I have two questions regarding this: 1) Does anyone know what is the reason behind undefining
_FILE_OFFSET_BITS
? From my understanding, it should be able to coexist with_LARGEFILE64_SOURCE
, since they have different purposes.2) The
open()
call that leads to this is in gzlib.c: https://github.com/madler/zlib/blob/v1.3/gzlib.c#L235 The local functiongz_open
is called by bothgzopen
andgzopen64
(among others). Shouldn'tgzopen64
useopen64
instead?Thanks