Skip to content

[stable2512] Backport #11114#11118

Merged
sigurpol merged 4 commits intostable2512from
backport-11114-to-stable2512
Feb 20, 2026
Merged

[stable2512] Backport #11114#11118
sigurpol merged 4 commits intostable2512from
backport-11114-to-stable2512

Conversation

@paritytech-release-backport-bot
Copy link
Copy Markdown

Backport #11114 into stable2512 from sigurpol.

See the documentation on how to use this bot.

Force the linker to keep the `polkadot_jemalloc_shim` crate and its
`#[global_allocator]` in all binaries that depend on it. Without it, the
linker might drop it since it is seen as a dependency with no referenced
symbols. The issue happens only on a subset of combination of rust
version and linker (e.g. on CI with Ubunti 24.04, rust 1.88.0 + gcc/ld
strips the jemalloc crate from the binary but not rust 1.92.0 and also
rust 1.88.0 + clang/mold works fine.

One way to reproduce the issue on my local Ubuntu machine using
`frame-omni-bencher` as reference (current latest version v0.17.2 has
the shim with jemalloc-allocator feature as dependency, as coming from
PR #11069 ):
1. building with rust 1.92.0 / gcc +ld => the linker doesn't strip
jemalloc allocator from the binary:
```bash
nm frame-omni-bencher | grep -i jemalloc
000000000149bf60 t _GLOBAL__sub_I_jemalloc_nodump_allocator.cc
0000000000eacae0 t jemalloc_constructor
0000000000eacd50 t _rjem_je_jemalloc_postfork_child
0000000000eacc70 t _rjem_je_jemalloc_postfork_parent
0000000000eacaf0 t _rjem_je_jemalloc_prefork
000000000262bb08 b _ZN7rocksdbL18jemalloc_type_infoB5cxx11E
```
2. building with rust 1.88.0 / gcc + ld => the linker strips aways it
```bash
000000000027f8c0 t _GLOBAL__sub_I_jemalloc_nodump_allocator.cc
00000000023a3598 b _ZN7rocksdbL18jemalloc_type_infoB5cxx11E
```

3. building with rust 1.88.0 / clang + mold => the linker keeps it (same
as 1.)

Since currently CI relies on Ubuntu 24.04 gcc /ld + rust 1.88.0, we go
here for the conservative approach to force the linker not to drop with
the `extern crate` change in all impacted binaries.

Next step - outside this PR - is to bump rust version.

---------

Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Bastian Köcher <git@kchr.de>
(cherry picked from commit d774715)
@github-actions github-actions Bot added the A3-backport Pull request is already reviewed well in another branch. label Feb 19, 2026
@github-actions github-actions Bot requested a review from sigurpol February 19, 2026 15:48
@sigurpol sigurpol enabled auto-merge (squash) February 19, 2026 15:52
@github-actions
Copy link
Copy Markdown
Contributor

This pull request is amending an existing release. Please proceed with extreme caution,
as to not impact downstream teams that rely on the stability of it. Some things to consider:

  • Backports are only for 'patch' or 'minor' changes. No 'major' or other breaking change.
  • Should be a legit fix for some bug, not adding tons of new features.
  • Must either be already audited or not need an audit.
Emergency Bypass

If you really need to bypass this check: add validate: false to each crate
in the Prdoc where a breaking change is introduced. This will release a new major
version of that crate and all its reverse dependencies and basically break the release.

@sigurpol
Copy link
Copy Markdown
Contributor

Unrelated to this PR but needed to make CI happy - I had to backport @EgorPopelyaev 's fix in master ad72e48 to cleanup umbrella

@sigurpol sigurpol merged commit deb5a22 into stable2512 Feb 20, 2026
249 of 257 checks passed
@sigurpol sigurpol deleted the backport-11114-to-stable2512 branch February 20, 2026 07:38
arturgontijo pushed a commit to moonbeam-foundation/polkadot-sdk that referenced this pull request Apr 1, 2026
Backport paritytech#11114 into `stable2512` from sigurpol.

See the
[documentation](https://github.com/paritytech/polkadot-sdk/blob/master/docs/BACKPORT.md)
on how to use this bot.

<!--
  # To be used by other automation, do not modify:
  original-pr-number: #${pull_number}
-->

Co-authored-by: Paolo La Camera <paolo@parity.io>
Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Bastian Köcher <git@kchr.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A3-backport Pull request is already reviewed well in another branch.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants