Hi, can anyone please suggest how do I generate libsec256k1 for armv7,armv7s and arm64 for iOS.The existing project builds it for x86_64 arch only. Thanks.
-
sandeepmalode commented at 3:58 AM on March 25, 2016: none
-
jonasschnelli commented at 7:51 AM on March 25, 2016: contributor
This is relatively simple. The libsecp256k1 codebase can be cross compiled easily (thanks to the hight portability of C89 and no dependencies).
A good starting point is this: https://gist.github.com/j0sh/895945 (it needs some path adaptions to newer Xcode versions).
Or you could adapt the
curlis build script: https://github.com/biasedbit/curl-ios-build-scripts (which is more up to date).Basically you cross compile for
armv7sarmv7andi386and uselipo -createto create a universal library that include all three platforms (older iOS devices, current one and simulator).Would be great if you could post a working script here once you have it.
-
laanwj commented at 8:33 AM on March 25, 2016: member
The existing project builds it for x86_84 arch only
It builds for the build system's arch by default. If that happens to be x86_64, like for most people, it will build for that.
A typical cross-build setup would be (make sure that you have the toolchain, on Ubuntu it's available as
gcc-arm-linux-gnueabihf):./configure --enable-benchmark --host=arm-linux-gnueabihfI also wrote an ARM assembly implementation of some of the inner functions at some point see https://github.com/bitcoin/secp256k1/pull/366 and https://github.com/bitcoin/secp256k1/pull/173. It resulted in some quite good speedups on some chips.
-
laanwj commented at 6:01 AM on December 2, 2016: member
Closing this, I don't think there's anything to add?
Edit: the ARM32 assembly was merged, it can be enabled with experimental features.
- laanwj closed this on Dec 2, 2016