Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building secp256k1-php with secp256k1 master fails to compile #124

Open
mataxetos opened this issue Nov 3, 2018 · 9 comments
Open

Building secp256k1-php with secp256k1 master fails to compile #124

mataxetos opened this issue Nov 3, 2018 · 9 comments

Comments

@mataxetos
Copy link

Hey guys!

PHPize

root@nmind:~/secp256k1-php-0.1/secp256k1# phpize
Configuring for:
PHP Api Version: 20170718
Zend Module Api No: 20170718
Zend Extension Api No: 320170718

PHPversion

root@nmind:/secp256k1-php-0.1/secp256k1# php -v
PHP 7.2.11-2+0-20181015120801.9+stretch-1.gbp8105e0 (cli) (built: Oct 15 2018 12:08:03) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.2.11-2+0-20181015120801.9+stretch-1.gbp8105e0, Copyright (c) 1999-2018, by Zend Technologies
root@nmind:-/secp256k1-php-0.1/secp256k1#

I'm using branch v0.1
When i try make i get this error:

`

root@nmind:~/secp256k1-php-0.1/secp256k1# make
/bin/bash /root/secp256k1-php-0.1/secp256k1/libtool --mode=compile cc -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -I. -I/root/secp256k1-php-0.1/secp256k1 -DPHP_ATOM_INC -I/root/secp256k1-php-0.1/secp256k1/include -I/root/secp256k1-php-0.1/secp256k1/main -I/root/secp256k1-php-0.1/secp256k1 -I/usr/include/php/20170718 -I/usr/include/php/20170718/main -I/usr/include/php/20170718/TSRM -I/usr/include/php/20170718/Zend -I/usr/include/php/20170718/ext -I/usr/include/php/20170718/ext/date/lib -I/usr/local/include -DHAVE_CONFIG_H -g -O2 -c /root/secp256k1-php-0.1/secp256k1/secp256k1.c -o secp256k1.lo
libtool: compile: cc -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -I. -I/root/secp256k1-php-0.1/secp256k1 -DPHP_ATOM_INC -I/root/secp256k1-php-0.1/secp256k1/include -I/root/secp256k1-php-0.1/secp256k1/main -I/root/secp256k1-php-0.1/secp256k1 -I/usr/include/php/20170718 -I/usr/include/php/20170718/main -I/usr/include/php/20170718/TSRM -I/usr/include/php/20170718/Zend -I/usr/include/php/20170718/ext -I/usr/include/php/20170718/ext/date/lib -I/usr/local/include -DHAVE_CONFIG_H -g -O2 -c /root/secp256k1-php-0.1/secp256k1/secp256k1.c -fPIC -DPIC -o .libs/secp256k1.o
/root/secp256k1-php-0.1/secp256k1/secp256k1.c: In function ‘zif_secp256k1_context_randomize’:
/root/secp256k1-php-0.1/secp256k1/secp256k1.c:435:17: warning: implicit declaration of function ‘zend_throw_exception_ex’ [-Wimplicit-function-declaration]
zend_throw_exception_ex(spl_ce_InvalidArgumentException, 0 TSRMLS_CC,
^~~~~~~~~~~~~~~~~~~~~~~
/root/secp256k1-php-0.1/secp256k1/secp256k1.c: In function ‘zif_secp256k1_ecdh’:
/root/secp256k1-php-0.1/secp256k1/secp256k1.c:1329:14: error: too few arguments to function ‘secp256k1_ecdh’
result = secp256k1_ecdh(ctx, resultChars, pubkey, privKey->val);
^~~~~~~~~~~~~~
In file included from /root/secp256k1-php-0.1/secp256k1/php_secp256k1.h:3:0,
from /root/secp256k1-php-0.1/secp256k1/secp256k1.c:10:
/usr/local/include/secp256k1_ecdh.h:42:48: note: declared here
SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_ecdh(
^~~~~~~~~~~~~~

Makefile:194: fallo en las instrucciones para el objetivo 'secp256k1.lo'
make: *** [secp256k1.lo] Error 1
root@nmind:~/secp256k1-php-0.1/secp256k1#

@afk11
Copy link
Member

afk11 commented Nov 3, 2018

Hey! Yea upstream recently broke the ECDH api. When installing libsecp256k1, check out commit 95e99f196fd08a8b2c236ab99d7e7fec8f6dc78f for the last working version, or cd329dbc3eaf096ae007e807b86b6f5947621ee3 which we test against

@AdamSEY
Copy link

AdamSEY commented Nov 26, 2018

Thanks, it did work! @afk11

@afk11 afk11 changed the title Error on make Building secp256k1-php with secp256k1 master fails to compile Dec 3, 2018
@ghost
Copy link

ghost commented Jan 13, 2019

I also have this issue, what should i do?

@ghost
Copy link

ghost commented Jan 13, 2019

How to check out commmit 95e99f196fd08a8b2c236ab99d7e7fec8f6dc78f ?

@afk11
Copy link
Member

afk11 commented Jan 14, 2019

git checkout 95e99f196fd08a8b2c236ab99d7e7fec8f6dc78f

@willystadnick
Copy link

willystadnick commented Jan 22, 2019

Sorry, but I am getting a fatal: reference is not a tree for both commits.

Also, 95e99f1 and cd329db show a 404 page.

I've landed here because I am getting same error as OP.

Perhaps these commits were lost in any merge?

I've tested with all branches and none escaped the error.

@afk11
Copy link
Member

afk11 commented Jan 23, 2019

@willystadnick the checkout should be done in the github.com/bitcoin-core/secp256k1 directory, not secp256k1-php.

@afk11
Copy link
Member

afk11 commented May 8, 2019

Working on a fix for this, should be possible to run against secp256k1 master soon.

@willystadnick
Copy link

willystadnick commented May 8, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants