HomePhabricator

[CMAKE] Add an option to enable the glibc compatibility features

Description

[CMAKE] Add an option to enable the glibc compatibility features

Summary:
The option ENABLE_GLIBC_BACK_COMPAT can be set to ON to configure
and include the functions from the compat/glibc_compat.cpp file. This
is a port of the configure option --enable-glibc-back-compat.

Test Plan:
On a recent Linux with a glibc version > 2.17:

cmake -DENABLE_GLIBC_BACK_COMPAT=ON -GNinja ..
ninja
../contrib/devtools/symbol-check.py src/bitcoind | grep log2f

Before the patch, should return:

src/bitcoind: symbol log2f from unsupported version <glibc_version>

After the patch, should return nothing.

Reviewers: #bitcoin_abc, deadalnix

Reviewed By: #bitcoin_abc, deadalnix

Differential Revision: https://reviews.bitcoinabc.org/D2892