build(jemalloc): patch jemalloc 5.3.1 source for libstdc++ 16+ ABI removal#9740
Open
matthewmcneely wants to merge 1 commit into
Open
build(jemalloc): patch jemalloc 5.3.1 source for libstdc++ 16+ ABI removal#9740matthewmcneely wants to merge 1 commit into
matthewmcneely wants to merge 1 commit into
Conversation
…moval
libstdc++ 16 removed `std::__throw_bad_alloc` from the public ABI. jemalloc 5.3.1's src/jemalloc_cpp.cpp still calls that legacy private symbol and fails to compile under GCC 16 / libstdc++ 16:
src/jemalloc_cpp.cpp:103:22: error: '__throw_bad_alloc' is not a member of 'std'
dgraph/Makefile builds jemalloc 5.3.1 from source (the distro package lacks the je_ symbol prefix ristretto's cgo binding needs), so any toolchain on GCC 16+ hits this during `make dgraph`. Add a sed substitution in the jemalloc: target that rewrites the legacy call to the standard `throw std::bad_alloc()` after extraction and before ./configure. The substitution is exact-match, so it is a no-op on older libstdc++ where the legacy symbol still exists.
Can be dropped once jemalloc cuts a release with the fix and JEMALLOC_URL bumps past it.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
libstdc++ 16 removed
std::__throw_bad_allocfrom the public ABI. jemalloc 5.3.1'ssrc/jemalloc_cpp.cppstill calls that legacy private symbol and fails to compile under GCC 16 / libstdc++ 16:dgraph/Makefilebuilds jemalloc 5.3.1 from source (the distro package lacks theje_symbol prefix ristretto's cgo binding needs), so any toolchain on GCC 16+ hits this duringmake dgraph.Fix
Add a
sedsubstitution in thejemalloc:target that rewrites the legacy call to the standardthrow std::bad_alloc()after the tarball is extracted and before./configureruns. The substitution is exact-match, so it's a no-op on older libstdc++ where the legacy symbol still exists.Can be dropped once jemalloc cuts a release with the fix baked in and
JEMALLOC_URLbumps past it.