Skip to content

Silence --icf=safe warnings for the stripped Rust libraries - #122904

Merged
Algunenano merged 1 commit into
ClickHouse:masterfrom
Algunenano:rust-strip-addrsig
Sep 30, 2026
Merged

Algunenano merged 1 commit into
ClickHouse:masterfrom
Algunenano:rust-strip-addrsig

Conversation

@Algunenano

@Algunenano Algunenano commented Sep 29, 2026 •

Copy link
Copy Markdown
Member

strip_rust_symbols.sh runs ld -r and llvm-objcopy on the PRQL and polyglot Rust libraries, which leave the .llvm_addrsig section with sh_link=0. Since the link switched to --icf=safe, every link of clickhouse prints:

ld.lld: warning: rust/workspace/lib_ch_rust_prql.a(stripped.o): --icf=safe conservatively ignores SHT_LLVM_ADDRSIG [index 6] with sh_link=0 (likely created using objcopy or ld -r)
ld.lld: warning: rust/workspace/lib_ch_rust_polyglot.a(stripped.o): --icf=safe conservatively ignores SHT_LLVM_ADDRSIG [index 6] with sh_link=0 (likely created using objcopy or ld -r)

Removing the section during stripping keeps the same conservative folding for these objects, without the warning.

Related: #122668

Changelog category (leave one):

  • Build/Testing/Packaging Improvement

Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):

Remove --icf=safe linker warnings about SHT_LLVM_ADDRSIG in the stripped Rust libraries.


Workflow [PR]
Sync PR [sync-upstream/pr/122904]

Version info

  • Merged into: 26.10.1.1061-master (included in 26.10 and later)
  • Backported to: 26.9.7.10, 26.8.15.17, 26.7.18.3

`strip_rust_symbols.sh` runs `ld -r` and `llvm-objcopy`, which leave the
address-significance table with `sh_link=0`. Since the link switched to
`--icf=safe`, lld ignores such tables and warns for every link:

ld.lld: warning: rust/workspace/lib_ch_rust_prql.a(stripped.o): --icf=safe
conservatively ignores SHT_LLVM_ADDRSIG [index 6] with sh_link=0

Removing the section keeps the same conservative folding without the warning.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@Algunenano Algunenano added the pr-must-backport Pull request should be backported intentionally. Use this label with great care! label Sep 29, 2026
@clickhouse-gh

clickhouse-gh Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [ab24765]

Summary: ❌

job_name test_name status info comment
Integration tests (amd_llvm_coverage, 1/8) FAIL
test_storage_iceberg_no_spark/test_iceberg_inverted_manifest_bounds.py::test_iceberg_narrow_manifest_bounds FAIL cidb IGNORED

AI Review

Summary

This PR updates cmake/strip_rust_symbols.sh to remove the stale .llvm_addrsig section from the stripped Rust archives, which matches the current --icf=safe linker behavior and suppresses the repeated linker warnings described in the PR. I did not find a correctness, compatibility, or maintainability issue in the change.

Final Verdict
  • Status: ✅ Approve

LLVM Coverage Report

Measured on commit ab24765.

Metric Baseline Current Δ
Lines 88.20% 88.20% +0.00%
Functions 91.80% 91.80% +0.00%
Branches 79.60% 79.60% +0.00%

Changed lines: Uncovered code analysis did not run: No coverable C/C++ source files changed (contrib/ is excluded from coverage).

Newly covered: +299 lines in 87 files (-171 lines lost coverage) · Details

Full report

@clickhouse-gh clickhouse-gh Bot added pr-build Pull request with build/testing/packaging improvement comp-rust Rust integration in build and runtime (Cargo, *.rs). labels Sep 29, 2026
@clickhouse-gh

clickhouse-gh Bot commented Sep 29, 2026

Copy link
Copy Markdown
Contributor

Build profile diff (arm_release)

Comparing ab24765c8 with master 92b13954a (stripped binary size, per-symbol sizes and ThinLTO time; compile times per translation unit against the most recent warmup build that recompiled it).

✅ No significant changes.

Binary sizes

programs/clickhouse-stripped: smaller than the master baseline by the known offset between the two builds, so the difference is not shown. A delta that differs from the offset by more than 50% of it is shown, in either direction.

The official master build is compiled with -g and a pull request build is not, and XRay counts debug instructions towards its instrumentation threshold, so master instruments thousands of functions more and its binary is ~0.4% larger no matter what the pull request does.

Compile time of recompiled translation units

6 translation units recompiled, 4 s compile time in total, 6 of them have a recent master baseline.

Job report

@Algunenano
Algunenano added this pull request to the merge queue Sep 30, 2026
Merged via the queue into ClickHouse:master with commit a7d11c8 Sep 30, 2026
147 of 149 checks passed
@Algunenano
Algunenano deleted the rust-strip-addrsig branch September 30, 2026 10:08
@robot-ch-test-poll2 robot-ch-test-poll2 added pr-synced-to-cloud The PR is synced to the cloud repo pr-must-backport-synced The `*-must-backport` labels are synced into the cloud Sync PR labels Sep 30, 2026
@robot-ch-test-poll4 robot-ch-test-poll4 added the pr-backports-created Backport PRs are successfully created, it won't be processed by CI script anymore label Sep 30, 2026
clickhouse-gh Bot added a commit that referenced this pull request Sep 30, 2026
Backport #122904 to 26.9: Silence `--icf=safe` warnings for the stripped Rust libraries
clickhouse-gh Bot added a commit that referenced this pull request Sep 30, 2026
Backport #122904 to 26.8: Silence `--icf=safe` warnings for the stripped Rust libraries
clickhouse-gh Bot added a commit that referenced this pull request Sep 30, 2026
Backport #122904 to 26.7: Silence `--icf=safe` warnings for the stripped Rust libraries
kewin-robetti pushed a commit to viasoftkorp/ClickHouse that referenced this pull request Oct 2, 2026
kewin-robetti pushed a commit to viasoftkorp/ClickHouse that referenced this pull request Oct 2, 2026
kewin-robetti pushed a commit to viasoftkorp/ClickHouse that referenced this pull request Oct 2, 2026
opensource-fork-sync Bot pushed a commit to cla7aye15I4nd/opensource-ClickHouse__ClickHouse that referenced this pull request Nov 9, 2026
With clang/lld 21 (the minimum supported version), a default build fails
at the final link of clickhouse:

  ld.lld-21: error: rust/workspace/lib_ch_rust_skim_rust.a(c16f17691ff6f04b-cxx.o):
  --icf=safe conservatively ignores SHT_LLVM_ADDRSIG [index 1337] with sh_link=0
  (likely created using objcopy or ld -r)

and the same for 885040bead2806a0-lib.rs.o (the cxx bridge of skim).

clang-21 emits the C++ exception glue (DW.ref.__gxx_personality_v0,
__clang_call_terminate) into llvm-libc's memmem.cpp.o; clang-22 does not
with the same flags. These two weak symbols are then in the reference set
of localize_rust_c_symbols.sh, the cxx bridge objects define them too, so
llvm-objcopy-21 localizes them there. Rewriting the symbol table makes
the non-empty .llvm_addrsig table stale and objcopy sets its sh_link to 0,
which lld --icf=safe reports, and --fatal-warnings turns into an error.
GNU objcopy zeroes sh_link on every table it rewrites.

Remove the section in both objcopy calls of the script, as
strip_rust_symbols.sh already does (ClickHouse#122904). lld then treats these
objects conservatively, as it does when it ignores the table.

Patch by @ snelheidai in ClickHouse#130064.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp-rust Rust integration in build and runtime (Cargo, *.rs). pr-backports-created Backport PRs are successfully created, it won't be processed by CI script anymore pr-build Pull request with build/testing/packaging improvement pr-must-backport Pull request should be backported intentionally. Use this label with great care! pr-must-backport-synced The `*-must-backport` labels are synced into the cloud Sync PR pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants