HomePhabricator

[CMAKE] Fix linux cross compilation with the glibc compatibility

Description

[CMAKE] Fix linux cross compilation with the glibc compatibility

Summary:
Using the glibc compatibility requires librt.so, but it is not part of
the depends subsystem.
This diff adds the cross compiler installation dir to the search path:

  • By setting the search prefix explicitely for ARM;
  • By using the system path as a fallback to support the x86 platform.

Because of CMake search priority, the libraries from the depends subsystem will always be found first (if they exist).

Depends on D4038.

Test Plan:

cmake -GNinja .. -DENABLE_GLIBC_BACK_COMPAT=ON \
  -DBUILD_BITCOIN_QT=OFF \
  -DCMAKE_TOOLCHAIN_FILE=../cmake/platforms/Linux32.cmake
ninja

Repeat with Linux64, LinuxARM and LinuxAArch64

Reviewers: #bitcoin_abc, deadalnix

Reviewed By: #bitcoin_abc, deadalnix

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

Details

Provenance
FabienAuthored on Sep 11 2019, 15:03
deadalnixPushed on Sep 23 2019, 11:06
Reviewer
Restricted Project
Differential Revision
D4039: [CMAKE] Fix linux cross compilation with the glibc compatibility
Parents
rSTAGING093479065d92: [CMAKE] Remove useless dependency for the check-rpcauth target
Branches
Unknown
Tags
Unknown
References
tag: phabricator/base/13083