Page MenuHomePhabricator

[CMAKE] Add an option to statically link libstdc++
ClosedPublic

Authored by Fabien on Tue, May 7, 12:19.

Details

Summary

The -static-libstdc++ linker flag is passed manually through the
environment variable LDFLAGS when running configure configure for
the Linux gitian build.

Test Plan
cmake -DENABLE_STATIC_LIBSTDCXX=ON -GNinja ..
ninja
readelf -d src/bitcoind | grep libstdc++

Grep should return nothing.

cmake -DENABLE_STATIC_LIBSTDCXX=OFF -GNinja ..
ninja
readelf -d src/bitcoind | grep libstdc++

Grep should return a line containing:

Shared library: [libstdc++.so.x]

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

Fabien created this revision.Tue, May 7, 12:19
Herald added a reviewer: Restricted Project. · View Herald TranscriptTue, May 7, 12:19
jasonbcox accepted this revision.Wed, May 8, 19:36
jasonbcox added a subscriber: jasonbcox.

Nit for the test plan: Include the build without static linking, which would produce results for readelf -d src/bitcoind | grep libstdc++

This revision is now accepted and ready to land.Wed, May 8, 19:36
Fabien edited the test plan for this revision. (Show Details)Thu, May 9, 06:00
This revision was automatically updated to reflect the committed changes.