Repository navigation
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
The export-map logic can hide redirected sendfile64/fcntl64 symbols, breaking interception, and overwrite the source map during in-source configuration.
2 open issues
What changed in this PR
This PR adjusts librspreload’s version script to avoid strict-linker failures when explicit LFS64 wrappers are disabled.
Changes:
- Generate a filtered version script without
fcntl64andsendfile64whenRDMA_PRELOAD_WRAP_LFS64is false. - Track the original script as a configure dependency and use the generated script for linking.
| File | Description |
|---|---|
buildlib/rdma_functions.cmake |
Conditionally filters LFS64 exports from librspreload’s version script. |
Review effort: Balanced
librspreload.map exports fcntl, fcntl64, sendfile and sendfile64, but which of them preload.c ends up defining depends on the libc. On musl there are no LFS64 symbols, so the fcntl64() and sendfile64() wrappers are not built, while on glibc with _FILE_OFFSET_BITS=64 the fcntl() and sendfile() wrappers are emitted as fcntl64 and sendfile64. Linkers that check the version script, like lld, then fail, e.g. on musl: error: version script assignment of 'global' to symbol 'fcntl64' failed: symbol not defined error: version script assignment of 'global' to symbol 'sendfile64' failed: symbol not defined Pass --undefined-version for the preload module when the linker supports it, so whichever of these names are defined get exported. Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
kraj
force-pushed
the
rspreload-lfs64-map
branch
from
November 10, 2026 14:49
f2ed6ae to
5cabbac
Compare
rleon
reviewed
Nov 17, 2026
| # emits the plain wrappers under the 64 names. Let linkers that check the | ||
| # version script (lld) skip the names that do not exist. | ||
| RDMA_CHECK_C_LINKER_FLAG("-Wl,--undefined-version" SUPPORTS_UNDEFINED_VERSION) | ||
| if (SUPPORTS_UNDEFINED_VERSION) |
Member
There was a problem hiding this comment.
I think that you need to use RDMA_AddOptLDFlag() macro and don't open-code it. Can you use it here?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

librspreload.map exports fcntl, fcntl64, sendfile and sendfile64, but which of them preload.c ends up defining depends on the libc. On musl there are no LFS64 symbols, so the fcntl64() and sendfile64() wrappers are not built, while on glibc with _FILE_OFFSET_BITS=64 the fcntl() and sendfile() wrappers are emitted as fcntl64 and sendfile64. Linkers that check the version script, like lld, then fail, e.g. on musl:
Pass --undefined-version for the preload module when the linker supports it, so whichever of these names are defined get exported.
Tested: