HomePhabricator

[CMAKE] Propagate the LFS support flags to the libraries

Description

[CMAKE] Propagate the LFS support flags to the libraries

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

Reviewers: #bitcoin_abc, deadalnix

Reviewed By: #bitcoin_abc, deadalnix

Subscribers: deadalnix

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

Details

Provenance
FabienAuthored on Apr 29 2020, 12:05
FabienPushed on Apr 29 2020, 12:56
Reviewer
Restricted Project
Differential Revision
D5881: [CMAKE] Propagate the LFS support flags to the libraries
Parents
rABCf2d4686b9352: Pass wallet/rpcdump RPC results and examples to RPCHelpMan
Branches
Unknown
Tags
Unknown