Open ellert opened 3 weeks ago
@ellert - while I'm happy to take the PR as-is, it seems like this is something we should inherit from xrootd itself (as opposed to discovering and hand-copying flags one-by-one).
@amadio - Is there something existing that we could leverage? I see XRootDConfig.cmake
shipped (at least on RHEL-derived systems) but it doesn't seem to set -D_FILE_OFFSET_BITS=64
.
I agree with @bbockelm, we set -D_FILE_OFFSET_BITS=64
in all builds for XRootD, so we need to make sure to propagate it to our reverse dependencies to ensure they compile with the same options.
Xrootd is compiled using -D_FILE_OFFSET_BITS=64. This means that the second parameter in pgRead/pgWrite, which is declared as off_t in xrootd's headers, is a long long on 32 bit architectures. Without -D_FILE_OFFSET_BITS=64 the off_t is a long and there is a mismatch which leads to a linking error.
Add -D_FILE_OFFSET_BITS=64 to the compiler definitions so that the compilation uses the same off_t definition as xrootd does during compilation.