Page MenuHomePhabricator

[CMAKE] Fix linux cross compilation with the glibc compatibility
ClosedPublic

Authored by Fabien on Sep 11 2019, 15:19.

Details

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

Diff Detail

Repository
rABC Bitcoin ABC
Branch
cmake_librt
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 7390
Build 12823: Bitcoin ABC Buildbot (legacy)
Build 12822: arc lint + arc unit

Event Timeline

Fabien planned changes to this revision.Sep 16 2019, 14:52

Set the fallback at the toochain file level rather than the library.

While this is clearly not the right solution, we can move on with that for the sake of progress. The longer term solution is to add all we depend on in the depends.

Agreed.
In this specific case we might just drop the RT library requirement which brings compatibility to an old glibc version.

This revision is now accepted and ready to land.Sep 20 2019, 16:16