Skip to content

tools/ceph-dencoder: drop unused link dependencies - #73958

Merged
tchaikov merged 1 commit into
ceph:mainfrom
tchaikov:wip-cmake-dencoder
Nov 24, 2026
Merged

tchaikov merged 1 commit into
ceph:mainfrom
tchaikov:wip-cmake-dencoder

Conversation

@tchaikov

@tchaikov tchaikov commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Building ceph-dencoder with mold fails:

  mold: error: undefined symbol:
    librados::v14_2_0::ObjectOperation::ObjectOperation()
  >>> referenced by cls_log_client.cc

8da660f ("tools/ceph-dencoder: build dencoders as plugins") moved the type handlers into denc-mod-*.so, but left four cls client libraries on the executable's link line. The executable no longer uses them. Mold pulls in their client code anyway, and that code needs librados.

Drop the four libraries from the executable's link line. The plugins link their own dependencies. ceph-dencoder then links with mold, and check-generated.sh passes.

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 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.

Thanks, this is the better fix; I've closed #71814 in favour of it.

Tested on top of #72620 with GCC 15.2 and Clang 21.1 × ld.bfd 2.46, lld 21.1.8 and mold 2.40.4: ceph-dencoder links in all six combinations and check-generated.sh passes. With ld.bfd and lld, the executable is byte-identical with and without this PR.

Two nits on the commit message:

  • 8da660fe8ae is the pre-merge copy of the plugin split; on main it is 2d3c656.
  • "Mold pulls in their client code anyway" is rui314/mold#1657, fixed in mold 3.0.0. Naming it would make clear that bfd and lld never pulled in these members.

Optional: ${DENCODER_EXTRALIBS} (set nowhere) and $<TARGET_OBJECTS:common_texttable_obj> (TextTable is in libceph-common) are also dead since the plugin split and could go in the same hunk; both removals pass the same six builds.

The "Verify Checklist" check needs a ticked box.

Building ceph-dencoder with older mold versions fails:

  mold: error: undefined symbol:
    librados::v14_2_0::ObjectOperation::ObjectOperation()
  >>> referenced by cls_log_client.cc

2d3c656 ("tools/ceph-dencoder: build dencoders as plugins")
moved the type handlers into denc-mod-*.so, but left four cls client
libraries on the executable's link line. The executable no longer
uses them.

Older mold versions can extract unused archive members to satisfy
versioned references from shared libraries. The extracted client code
then needs librados. This is rui314/mold#1657, fixed in mold 3.0.0:
rui314/mold#1657
GNU ld and lld do not extract those members.

Drop the four libraries from the executable's link line. The plugins
link their own dependencies. Also drop DENCODER_EXTRALIBS, which has
not been set since the plugin split, and the unused TextTable object.
ceph-dencoder then links with mold, and check-generated.sh passes.

Signed-off-by: Kefu Chai <[email protected]>
@tchaikov

tchaikov commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor Author

@Doracly thanks for your review. all addressed. PTAL.

@tchaikov
tchaikov requested a review from Doracly November 23, 2026 08:01

@Doracly Doracly 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.

LGTM.

Just one minor nitpick, which I don't really know whether it does any harm:
The PR title ("drop unused cls client libraries") doesn't match the commit subject ("drop unused link dependencies"), and the title is what goes into the merge commit.

@tchaikov tchaikov changed the title tools/ceph-dencoder: drop unused cls client libraries tools/ceph-dencoder: drop unused link dependencies Nov 24, 2026
@tchaikov

Copy link
Copy Markdown
Contributor Author

changed. i don't feel strong either way.

@Doracly Doracly 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.

Good work. Thanks!

@tchaikov
tchaikov merged commit 83830b7 into ceph:main Nov 24, 2026
19 checks passed
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.

2 participants