[Rpm-maint] [rpm-software-management/rpm] Enable large file support on 32-bit systems again (PR #2509)
Michal Domonkos
notifications at github.com
Wed May 17 12:01:13 UTC 2023
Replace 32-bit sizes in types like off_t with 64-bits when building on 32-bit architectures, to enable large file support there.
This fixes a nasty regression introduced in the cmake transition. As autotools would set this flag to 64 automatically for us, applications linking against librpm (such as libdnf, librepo, libsolv or drpm) are already adapted to that and are also building with the value of 64 (explicitly, we never exported this flag through pkg-config ourselves). However, us suddenly expecting 32-bits in those types on 32-bit systems can blow up badly e.g. in functions that take an off_t parameter, like Fseek().
There perhaps aren't that many low-level users of librpm but drpm is one such example where exactly this happens when built against our current master. It calls headerRead(), leading to Fseek() which receives a 64-bit offset parameter where it expects a 32-bit one, thus silently overwriting the following parameter from 1 to 0 (SEEK_CUR to SEEK_SET) which messes up the whole reading sequence in drpm's rpm_read(), producing a failure in drpm's test suite that doesn't make any sense at first sight.
While at it, also export the flag through pkg-config so that anyone linking against librpm is now guaranteed to work correctly even if they don't set the flag themselves (kudos to Petr Pisar for suggesting this).
You can view, comment on, or merge this pull request online at:
https://github.com/rpm-software-management/rpm/pull/2509
-- Commit Summary --
* Enable large file support on 32-bit systems again
-- File Changes --
M CMakeLists.txt (1)
M rpm.pc.in (2)
-- Patch Links --
https://github.com/rpm-software-management/rpm/pull/2509.patch
https://github.com/rpm-software-management/rpm/pull/2509.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/2509
You are receiving this because you are subscribed to this thread.
Message ID: <rpm-software-management/rpm/pull/2509 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20230517/cc97391a/attachment.html>
More information about the Rpm-maint
mailing list