fix: statically link libstdc++/libgcc so releases run on Ubuntu 20.04#283
Open
blondfrogs wants to merge 1 commit into
Open
fix: statically link libstdc++/libgcc so releases run on Ubuntu 20.04#283blondfrogs wants to merge 1 commit into
blondfrogs wants to merge 1 commit into
Conversation
CI builds inside ubuntu:20.04 but installs gcc-11 from the ubuntu-toolchain-r/test PPA for C++20 support, which brings a newer libstdc++.so.6 into the build environment. The resulting fluxd dynamic-links against it and fails at runtime on stock Ubuntu 20.04 with "GLIBCXX_3.4.29 not found" / "CXXABI_1.3.13 not found". - zcutil/build.sh: pass -static-libstdc++ -static-libgcc via LDFLAGS so the C++ runtime is baked into the binary, decoupling it from the build host's libstdc++ version. - depends/packages/zeromq.mk: strip -lstdc++ from libzmq.pc Libs.private. pkg-config injects this into the link line, and an explicit -lstdc++ overrides -static-libstdc++ (which only affects gcc's implicit libstdc++ link). Removing it lets static-libstdc++ take effect. Verified end-to-end by rebuilding the same source in a fresh ubuntu:20.04 container with these patches: ldd shows no libstdc++.so.6 dependency, max GLIBC required is 2.30, and the binary runs cleanly on stock ubuntu:20.04. No CI workflow changes needed. Co-Authored-By: Claude Opus 4.7 (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.
CI builds inside ubuntu:20.04 but installs gcc-11 from the ubuntu-toolchain-r/test PPA for C++20 support, which brings a newer libstdc++.so.6 into the build environment. The resulting fluxd dynamic-links against it and fails at runtime on stock Ubuntu 20.04 with "GLIBCXX_3.4.29 not found" / "CXXABI_1.3.13 not found".
zcutil/build.sh: pass -static-libstdc++ -static-libgcc via LDFLAGS so the C++ runtime is baked into the binary, decoupling it from the build host's libstdc++ version.
depends/packages/zeromq.mk: strip -lstdc++ from libzmq.pc Libs.private. pkg-config injects this into the link line, and an explicit -lstdc++ overrides -static-libstdc++ (which only affects gcc's implicit libstdc++ link). Removing it lets static-libstdc++ take effect.
Verified end-to-end by rebuilding the same source in a fresh ubuntu:20.04 container with these patches: ldd shows no libstdc++.so.6 dependency, max GLIBC required is 2.30, and the binary runs cleanly on stock ubuntu:20.04. No CI workflow changes needed.