Commit Graph

26 Commits

Author SHA1 Message Date
Pieter Wuille bc08599e77 Remove OpenSSL testing support 2021-10-14 12:39:27 -04:00
Tim Ruffing 07256267ff build: Use own variable SECP_CFLAGS instead of touching user CFLAGS
Fixes one of the items in #923, namely the warnings of the form
    '_putenv' redeclared without dllimport attribute:
    previous dllimport ignored [-Wattributes]

This also cleans up the way we add CFLAGS, in particular flags enabling
warnings. Now we perform some more fine-grained checking for flag
support, which is not strictly necessary but the changes also help to
document autoconf.ac.
2021-07-01 19:58:44 +02:00
Pieter Wuille 1f233b3fa0 Remove num/gmp support
The whole "num" API and its libgmp-based implementation are now unused. Remove them.
2021-03-15 13:01:52 -07:00
Tim Ruffing 252c19dfc6 Ask brew for valgrind include path
Valgrind is typically installed using brew on macOS. This commit
makes ./configure detect this case set the appropriate include
directory (in the same way as we already do for openssl and gmp).
2021-01-08 14:24:34 +01:00
Dimitris Apostolou 07aa4c70ff
Fix insecure links 2020-12-18 00:24:22 +02:00
Elichai Turkel e6692778d3
Modify bitcoin_secp.m4's openssl check to call all the functions that we
use in the tests/benchmarks.
That way linking will fail if those symbols are missing
2020-10-25 13:42:25 +02:00
Pieter Wuille 79f1f7a4f1 Autodetect __int128 availability on the C side
Instead of supporting configuration of the field and scalar size independently,
both are now controlled by the availability of a 64x64->128 bit multiplication
(currently only through __int128). This is autodetected from the C code through
__SIZEOF_INT128__, but can be overridden using configure's
--with-test-override-wide-multiply, or by defining
USE_FORCE_WIDEMUL_{INT64,INT128} manually.
2020-08-10 14:56:39 -07:00
fanquake 84b5fc5bc3
build: fix OpenSSL EC detection on macOS 2020-04-09 17:14:06 +08:00
Jonas Nick 642cd062bd Remove Java Native Interface 2020-01-08 09:13:09 +00:00
Gregory Maxwell cd329dbc3e
Merge #460: [build] Update ax_jni_include_dir.m4 macro
e7daa9b [build] Tweak JNI macro to warn instead of error for JNI not found. (Karl-Johan Alm)
5b22977 [build] Update ax_jni_include_dir.m4 macro to deal with recent versions of macOS (Karl-Johan Alm)

Pull request description:

  Prior to this patch, this macro fails to find a working directory for the JNI headers, and results in compile failure when doing
  ```
  ./configure --enable-experimental --enable-module-ecdh --enable-jni
  ```
  on more recent macOS versions. The relevant commit upstream is [here](http://git.savannah.gnu.org/gitweb/?p=autoconf-archive.git;a=commit;h=ab23d25b1f1ae544fffdaa0a94a794798695c672) from the [GNU.org page for the macro](https://www.gnu.org/software/autoconf-archive/ax_jni_include_dir.html). The original (identical to the version in this commit) is [here](http://git.savannah.gnu.org/gitweb/?p=autoconf-archive.git;a=blob_plain;f=m4/ax_jni_include_dir.m4).

  The compile failure:
  ```Bash
  $ make
  gcc -I. -g -O2 -Wall -Wextra -Wno-unused-function -c src/gen_context.c -o gen_context.o
  gcc gen_context.o -o gen_context
  ./gen_context
    CC       src/libsecp256k1_la-secp256k1.lo
    CC       src/java/libsecp256k1_jni_la-org_bitcoin_NativeSecp256k1.lo
  In file included from src/java/org_bitcoin_NativeSecp256k1.c:4:
  In file included from src/java/org_bitcoin_NativeSecp256k1.h:2:
  /Library/Java/JavaVirtualMachines/jdk1.7.0_71.jdk/Contents/Headers/jni.h:45:10: fatal error:
        'jni_md.h' file not found
  #include "jni_md.h"
           ^
  1 error generated.
  make: *** [src/java/libsecp256k1_jni_la-org_bitcoin_NativeSecp256k1.lo] Error 1
  ```

Tree-SHA512: 9a8305b3ed67eba0de728f91cf435857a676ba10507ab8481a3c03b50e1ce0469a3d79e751d0a697018789f21e2aa48b7eccca4d225520a3863fcf23f1fd487a
2018-02-06 23:08:50 +00:00
Alexander Block 31abd3ab8d Support OpenSSL versions >= 1.1 for ENABLE_OPENSSL_TESTS
The only reason OpenSSL 1.1 was not supported was the removal of direct
access to r and s in ECDSA_SIG. This commit adds a simplified version of
ECDSA_SIG_get0 for < 1.1 that can be used like ECDSA_SIG_get0 in >= 1.1
2017-12-28 11:36:24 +01:00
Karl-Johan Alm e7daa9b3c2
[build] Tweak JNI macro to warn instead of error for JNI not found. 2017-07-06 18:06:51 +09:00
Karl-Johan Alm 5b22977922
[build] Update ax_jni_include_dir.m4 macro to deal with recent versions of macOS 2017-07-06 18:04:52 +09:00
Gregory Maxwell 12de86387f Make the libcrypto detection fail the newer API.
OpenSSL 1.1 makes ECDSA_SIG opaque and our tests need access
inside this object.

The comparison tests against OpenSSL aren't important for most
users, but the build failing is...
2016-12-12 07:56:01 +00:00
Pieter Wuille 7b549b1abc
Merge #373: build: fix x86_64 asm detection for some compilers
3f8fdfb build: fix x86_64 asm detection for some compilers (Cory Fields)
2016-02-16 20:44:41 +01:00
GreenAddress 3093576aa4 JNI library
Squashed and rebased. Thanks to @theuni and @faizkhan00 for doing
the majority of work here! Also thanks to @btchip for help with debugging
and review.
2016-02-01 14:07:18 +01:00
Cory Fields 3f8fdfbec1 build: fix x86_64 asm detection for some compilers
I Noticed this on OSX with clang, though it likely happens elsewhere as well.
The result is disabled x86_64 asm.

Due to missing escaping, this $0 was interpreted as the function name
SECP_64BIT_ASM_CHECK, causing the compile-check to be broken on some compilers.

The actual check looked like this:

int main()
{
  uint64_t a = 11, tmp;
  __asm__ __volatile__("movq SECP_64BIT_ASM_CHECKx100000000,%1; mulq %%rsi" : "+a"(a) : "S"(tmp) : "cc", "%rdx");
  return 0;
}

It seems even more odd that it compiled anywhere.
2016-01-04 11:40:00 -05:00
Pieter Wuille 85e3a2cc08
Merge pull request #112
2b4cf41 Use pkg-config always when possible, with failover to manual checks for libcrypto (Luke Dashjr)
2015-09-04 20:24:42 +02:00
Thomas Daede fbecc38a89 Add ability to use a statically generated ecmult context.
This vastly shrinks the size of the context required for signing on devices with
memory-mapped Flash.

Tables are generated by the new gen_context tool into a header.
2015-07-13 18:00:03 -07:00
Luke Dashjr 2b4cf416e7 Use pkg-config always when possible, with failover to manual checks for libcrypto 2015-02-13 23:44:07 +00:00
Pieter Wuille 1ba4a60a51 Configure options reorganization 2014-12-13 15:04:28 +01:00
Cory Fields 28ade27da1 build: nuke bashisms 2014-12-11 21:24:35 -05:00
Cory Fields 971fe8151b build: fix openssl detection for cross builds
Make sure that the detected openssl successfully links before enabling support.
2014-12-10 13:21:50 -05:00
Pieter Wuille 67935050e1 Convert YASM code into inline assembly 2014-12-04 13:54:01 +01:00
Cory Fields e2274c58e6 build: osx: attempt to work with homebrew keg-only packages 2014-11-24 11:49:22 -05:00
kiwigb 6fac238f03 Use same build template as bitcoin. Add bitcoin_secp.m4. 2014-11-07 01:55:27 +13:00