Page MenuHomePhabricator

[CMAKE] Propagate the LFS support flags to the libraries
ClosedPublic

Authored by Fabien on Apr 29 2020, 12:17.

Details

Summary

The add_<compiler|linker>_flags() and add_compile_*() functions set
directory level properties and apply to all the targets created after
the call. The LFS (Large File Support) flags are set after the libraries
are included, and as such are not applied. This causes an issue with
leveldb when running with qemu for ARM (cannot reproduce on a real ARM
target).
While at it, replace the add_compile_flags() with a more appropriated
add_compile_definitions() to set -D_FILE_OFFSET_BITS=64.

Test Plan
ninja check

cmake -GNinja .. \
  -DCMAKE_TOOLCHAIN_FILE=../cmake/platforms/LinuxARM.cmake \
ninja test_bitcoin
qemu-arm-static -L /usr/arm-linux-gnueabihf src/test/test_bitcoin -t

dbwrapper_tests

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

deadalnix requested changes to this revision.Apr 29 2020, 12:34
deadalnix added a subscriber: deadalnix.
deadalnix added inline comments.
src/CMakeLists.txt
210 ↗(On Diff #19222)

Maybe you want to add a comment, unless you expect that nobody would ever put it somewhere else.

This revision now requires changes to proceed.Apr 29 2020, 12:34

Add a comment explaining why the definition should be set before including the libs.

This revision is now accepted and ready to land.Apr 29 2020, 12:43