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

Failure when compiling the HSM on Linux Mint #1069

Closed
Sosthene00 opened this issue Feb 22, 2018 · 10 comments
Closed

Failure when compiling the HSM on Linux Mint #1069

Sosthene00 opened this issue Feb 22, 2018 · 10 comments

Comments

@Sosthene00
Copy link

Sosthene00 commented Feb 22, 2018

Hi, I ran unto what seems to be a very similar issue while making :

if git submodule status external/libwally-core | grep -q '^[-+]'; then rm -rf external/libwally-core; git submodule update --init external/libwally-core; fi if git submodule status external/libsodium | grep -q '^[-+]'; then rm -rf external/libsodium; git submodule update --init external/libsodium; fi if git submodule status external/jsmn | grep -q '^[-+]'; then rm -rf external/jsmn; git submodule update --init external/jsmn; fi if git submodule status external/libbase58 | grep -q '^[-+]'; then rm -rf external/libbase58; git submodule update --init external/libbase58; fi if git submodule status external/libbacktrace | grep -q '^[-+]'; then rm -rf external/libbacktrace; git submodule update --init external/libbacktrace; fi
cc -L/usr/local/lib hsmd/hsm.o hsmd/gen_hsm_client_wire.o common/bip32.o common/daemon_conn.o common/derive_basepoints.o common/funding_tx.o common/hash_u5.o common/io_debug.o common/key_derive.o common/msg_queue.o common/permute_tx.o common/status.o common/subdaemon.o common/type_to_string.o common/utils.o common/utxo.o common/version.o common/withdraw_tx.o bitcoin/base58.o bitcoin/block.o bitcoin/chainparams.o bitcoin/locktime.o bitcoin/pubkey.o bitcoin/pullpush.o bitcoin/script.o bitcoin/shadouble.o bitcoin/short_channel_id.o bitcoin/signature.o bitcoin/tx.o bitcoin/varint.o wire/wire_sync.o wire/wire_io.o wire/fromwire.o wire/peer_wire.o wire/towire.o wire/gen_peer_wire.o ccan-asort.o ccan-autodata.o ccan-breakpoint.o ccan-crypto-hmac.o ccan-crypto-hkdf.o ccan-crypto-ripemd160.o ccan-crypto-sha256.o ccan-crypto-shachain.o ccan-crypto-siphash24.o ccan-err.o ccan-fdpass.o ccan-htable.o ccan-ilog.o ccan-io-io.o ccan-intmap.o ccan-io-poll.o ccan-io-fdpass.o ccan-isaac.o ccan-isaac64.o ccan-list.o ccan-mem.o ccan-noerr.o ccan-opt-helpers.o ccan-opt-parse.o ccan-opt-usage.o ccan-opt.o ccan-pipecmd.o ccan-ptr_valid.o ccan-read_write_all.o ccan-str-hex.o ccan-str.o ccan-take.o ccan-tal-grab_file.o ccan-tal-path.o ccan-tal-str.o ccan-tal.o ccan-time.o ccan-timer.o -Lexternal -lwallycore -lsecp256k1 -lsodium -ljsmn -lbase58 -lbacktrace -lm -lgmp -lsqlite3 -o lightningd/lightning_hsmd hsmd/hsm.o :
Dans la fonction « handle_ecdh » : /home/sosthene/lightning/hsmd/hsm.c:134 : référence indéfinie vers « secp256k1_ecdh » collect2:
error: ld returned 1 exit status Makefile:271 : la recette pour la cible « lightningd/lightning_hsmd » a échouée make: *** [lightningd/lightning_hsmd] Erreur 1

I use GCC version 5.4.0 :
gcc (Ubuntu 5.4.0-6ubuntu1~16.04.6) 5.4.0 20160609

cat proc/version :
Linux version 4.4.0-21-generic (buildd@lgw01-21) (gcc version 5.3.1 20160413 (Ubuntu 5.3.1-14ubuntu2) ) #37-Ubuntu SMP Mon Apr 18 18:33:37 UTC 2016

Can you help me make it out ? Thanks !

@cdecker
Copy link
Member

cdecker commented Feb 22, 2018

Could be related to #1060, could you try to compile with branch https://github.com/cdecker/lightning/tree/issue-1060?

@cdecker
Copy link
Member

cdecker commented Feb 23, 2018

Can you try #1073 please? That should make sure that the in-tree libsecp256k1 is used over another one installed in /usr/local/lib

@Sosthene00
Copy link
Author

Hi, I just tried to compile from the branch in #1060, interestingly it somehow manages to run for much longer only to fail again with what seems to me a very similar error, here are only the last lines :

-Lexternal -lwallycore -lsecp256k1 -lsodium -ljsmn -lbase58 -lbacktrace -lm -lgmp -lsqlite3  -o lightningd/lightning_hsmd
hsmd/hsm.o : Dans la fonction « handle_ecdh » :
/home/sosthene/lightning/hsmd/hsm.c:135 : référence indéfinie vers « secp256k1_ecdh »
collect2: error: ld returned 1 exit status
Makefile:280 : la recette pour la cible « lightningd/lightning_hsmd » a échouée
make: *** [lightningd/lightning_hsmd] Erreur 1
rm external/libwally-core/src/secp256k1/libsecp256k1.la

@Sosthene00
Copy link
Author

And now I tried with the #1073 commit, it ran for much longer and failed in identical way :

-Lexternal -lwallycore -lsecp256k1 -lsodium -ljsmn -lbase58 -lbacktrace -lm -lgmp -lsqlite3  -o lightningd/lightning_hsmd
hsmd/hsm.o : Dans la fonction « handle_ecdh » :
/home/sosthene/lightning/hsmd/hsm.c:135 : référence indéfinie vers « secp256k1_ecdh »
collect2: error: ld returned 1 exit status
Makefile:280 : la recette pour la cible « lightningd/lightning_hsmd » a échouée
make: *** [lightningd/lightning_hsmd] Erreur 1
rm external/libwally-core/src/secp256k1/libsecp256k1.la

(watch out though I'm not a developper and learning to use github, might be some mistake on my side)

@cdecker
Copy link
Member

cdecker commented Feb 23, 2018

Aren't those both the exact same error as the first one (with more linebreaks)? Very strange, do you have another libsecp256k1.so.0 in /usr/local/lib/, if no then this sounds like a distinct problem.

@arowser
Copy link
Contributor

arowser commented Feb 24, 2018

@BobleChinois wired, you should find '-L/usr/local/lib' string like follow after #1073:

-Lexternal -lwallycore -lsecp256k1 -lsodium -ljsmn -lbase58 -lbacktrace -L/usr/local/lib -lm -lgmp -lsqlite3

Could you please try this command?

git clean -xdf && git checkout master && git pull && make

@Sosthene00
Copy link
Author

@arowser sorry for the low reactivity, I've been very busy last month and I didn't have time to pick up the matter again.
I tried the command you gave me, and it ends up with the same mistake, am I missing something ?

-Lexternal -lwallycore -lsecp256k1 -lsodium -ljsmn -lbase58 -lbacktrace -lm -lgmp -lsqlite3  -o lightningd/lightning_hsmd
hsmd/hsm.o : Dans la fonction « handle_ecdh » :
/home/sosthene/lightning/hsmd/hsm.c:135 : référence indéfinie vers « secp256k1_ecdh »
collect2: error: ld returned 1 exit status
Makefile:280 : la recette pour la cible « lightningd/lightning_hsmd » a échouée
make: *** [lightningd/lightning_hsmd] Erreur 1
rm external/libwally-core/src/secp256k1/libsecp256k1.la

@Sosthene00
Copy link
Author

Ok I worked it out, don't know how but it worked, I think you can close the issue now. Thanks !

@jsarenik
Copy link
Collaborator

jsarenik commented Jun 4, 2018

@cdecker When it is fixed, this issue can be closed as well.

@cdecker
Copy link
Member

cdecker commented Jun 9, 2018

Thanks for the heads up @jsarenik 👍

@cdecker cdecker closed this as completed Jun 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants