Repository navigation
Silence --icf=safe warnings for the stripped Rust libraries - #122904
Conversation
`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]>
|
Workflow [PR], commit [ab24765] Summary: ❌
AI ReviewSummaryThis PR updates Final Verdict
LLVM Coverage ReportMeasured on commit ab24765.
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 |
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
The official master build is compiled with Compile time of recompiled translation units6 translation units recompiled, 4 s compile time in total, 6 of them have a recent master baseline. |
a7d11c8
Backport #122904 to 26.9: Silence `--icf=safe` warnings for the stripped Rust libraries
Backport #122904 to 26.8: Silence `--icf=safe` warnings for the stripped Rust libraries
Backport #122904 to 26.7: Silence `--icf=safe` warnings for the stripped Rust libraries
… the stripped Rust libraries
… the stripped Rust libraries
… the stripped Rust libraries
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]>
strip_rust_symbols.shrunsld -randllvm-objcopyon the PRQL and polyglot Rust libraries, which leave the.llvm_addrsigsection withsh_link=0. Since the link switched to--icf=safe, every link ofclickhouseprints:Removing the section during stripping keeps the same conservative folding for these objects, without the warning.
Related: #122668
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Remove
--icf=safelinker warnings aboutSHT_LLVM_ADDRSIGin the stripped Rust libraries.Workflow [PR]
Sync PR [sync-upstream/pr/122904]
Version info
26.10.1.1061-master(included in26.10and later)26.9.7.10,26.8.15.17,26.7.18.3