HomePhabricator

[SECP256K1] CMake: Build the ARM ASM field implementation

Description

[SECP256K1] CMake: Build the ARM ASM field implementation

Summary:
This diff allow cmake to use the ARM optimized assembly (equivalent to autotools --with-asm=arm).

It attempts to guess the build target, and default with an error if assembly is enabled but unsupported by the target (or the target is not known).
This makes the build to succeed by default on x86_64, and on ARM when the toolchain file is used, so no user intervention is needed for the "normal" path.

Depends on D5501.

Test Plan:
Should ask to use -DSECP256K1_USE_ASM=OFF:

cmake -GNinja .. -DCMAKE_TOOLCHAIN_FILE=../cmake/platforms/Linux32.cmake

Should succeed:

cmake -GNinja .. -DCMAKE_TOOLCHAIN_FILE=../cmake/platforms/LinuxARM.cmake
ninja

Run the test binaries on an ARM target and check there is no error
(tested on a RPi).

Run the build on OSX.

Run the Gitian builds.

Run the Travis build (see https://travis-ci.org/github/Fabcien/secp256k1/builds/663863958).

Reviewers: #bitcoin_abc, deadalnix

Reviewed By: #bitcoin_abc, deadalnix

Subscribers: deadalnix

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

Details

Provenance
FabienAuthored on Mar 16 2020, 11:00
FabienPushed on Mar 19 2020, 13:49
Reviewer
Restricted Project
Differential Revision
D5480: [SECP256K1] CMake: Build the ARM ASM field implementation
Parents
rSTAGING49dab06701be: [CMAKE] Improve the toolchain files
Branches
Unknown
Tags
Unknown