Skip to content

tools/ceph-dencoder: link librados - #71814

Closed
Doracly wants to merge 1 commit into
ceph:mainfrom
Doracly:wip-cmake-missing-link-deps
Closed

Doracly wants to merge 1 commit into
ceph:mainfrom
Doracly:wip-cmake-missing-link-deps

Conversation

@Doracly

@Doracly Doracly commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

ceph-dencoder is missing librados

ceph-dencoder links cls_log_client and friends, which are declared with a bare
add_library(... STATIC ...) and no target_link_libraries, so they rely on consumers
to supply librados. This stays latent: nothing in ceph_dencoder.cc references them,
so their archive members are normally never extracted. Once one is pulled in, its
librados::ObjectOperation references are undefined.

How this was found

ninja tests fails to link ceph-dencoder with mold, with both clang and GCC. The same
command lines link with GNU ld 2.46 and lld 21.1.8, which do not extract these members.
With this commit, it links under mold as well.

mold's behaviour was reported as rui314/mold#1657 and is fixed
upstream (not yet released); the dependency is still worth declaring, as older mold versions
will be around for a while.

Testing

Debug build with clang 21.1.8 and mold 2.40.4: without this commit, ninja tests
fails to link ceph-dencoder with undefined librados::ObjectOperation references;
with it, it links and ceph-dencoder list_types lists 666 types. A GCC 15 build with
mold fails the same way without the fix.

Contribution Guidelines

  • To sign and title your commits, please refer to Submitting Patches to Ceph.

  • If you are submitting a fix for a stable branch (e.g. "quincy"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.

  • When filling out the below checklist, you may click boxes directly in the GitHub web UI. When entering or editing the entire PR message in the GitHub web UI editor, you may also select a checklist item by adding an x between the brackets: [x]. Spaces and capitalization matter when checking off items this way.

Checklist

  • Tracker (select at least one)
    • References tracker ticket
    • Very recent bug; references commit where it was introduced
    • New feature (ticket optional)
    • Doc update (no ticket needed)
    • Code cleanup (no ticket needed)
  • Component impact
    • Affects Dashboard, opened tracker ticket
    • Affects Orchestrator, opened tracker ticket
    • No impact that needs to be tracked
  • Documentation (select at least one)
    • Updates relevant documentation
    • No doc update is appropriate
  • Tests (select at least one)
Show available Jenkins commands

You must only issue one Jenkins command per-comment. Jenkins does not understand
comments with more than one command.

@Doracly
Doracly requested a review from a team as a code owner September 16, 2026 07:23
@github-actions

Copy link
Copy Markdown

Thank you for your contribution. Since you are not yet a member of the Ceph organization with write permissions on ceph/ceph.git, our CI will not automatically run. Any member of the Ceph organization may label this PR ci-approved to allow Jenkins CI jobs to run.

ceph-dencoder links cls_log_client, cls_version_client, cls_user_client and
cls_cas_client, but not librados. Those client libraries are declared with a
plain add_library(... STATIC ...) and no target_link_libraries, so they rely
on consumers to supply librados themselves.

Nothing in ceph_dencoder.cc references cls_log_client, so the archive member
is normally never extracted and the missing dependency stays invisible. When
it is extracted for any other reason, its librados::ObjectOperation
references become undefined at link time.

Signed-off-by: Dominik Raddatz <[email protected]>
@Doracly
Doracly force-pushed the wip-cmake-missing-link-deps branch from 4ca6d3e to af86b9e Compare October 8, 2026 06:48
@Doracly Doracly changed the title cmake: fix missing link dependencies for rgw_a and ceph-dencoder cmake: fix missing link dependency for ceph-dencoder Oct 12, 2026
@Doracly Doracly changed the title cmake: fix missing link dependency for ceph-dencoder tools/ceph-dencoder: link librados Oct 12, 2026
@Doracly

Doracly commented Nov 9, 2026

Copy link
Copy Markdown
Contributor Author

@cbodley could you take a look? It's one line: ceph-dencoder links the cls_*_client archives but not librados, which they need.

@Doracly
Doracly requested a review from cbodley November 9, 2026 12:56
@anrao19

anrao19 commented Nov 13, 2026

Copy link
Copy Markdown
Contributor

This PR has been added to wip-anrao8-testing-2026-11-13-0837-main.

@tchaikov tchaikov left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Doracly thanks for picking this up. this PR addresses the symptom. but the root cause is fixed by #73958 . could you help review that PR instead?

@Doracly

Doracly commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor Author

This PR has been added to wip-anrao8-testing-2026-11-13-0837-main.

@anrao19 you can drop this PR; it's replaced by #73958.

@anrao19

anrao19 commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

This PR has been removed from wip-anrao8-testing-2026-11-13-0838-main.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants