PelicanPlatform / xrootd-s3-http

An XRootD plugin that allows Pelican to interface with s3/http server backends
Apache License 2.0
2 stars 6 forks source link

Fix linking error on 32 bit architectures #53

Open ellert opened 3 weeks ago

ellert commented 3 weeks ago
undefined reference to `XrdOssDF::pgRead(void*, long, unsigned int, unsigned int*, unsigned long long)'
undefined reference to `XrdOssDF::pgWrite(void*, long, unsigned int, unsigned int*, unsigned long long)'

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.

bbockelm commented 2 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.

amadio commented 2 weeks ago

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.