ElementsProject / lightning

Core Lightning — Lightning Network implementation focusing on spec compliance and performance
Other
2.87k stars 907 forks source link

Error compiling in TERMUX #5253

Open weedcoder opened 2 years ago

weedcoder commented 2 years ago

I have an error i can't get rid of when compiling in TERMUX on my phone. a arm8.2A based architecture, aarch64. i tried many many things, playing with libwally and i have this error about undefined symbols. i checked, and of course, these symbol are referenced in lightning code AND in the libwally code. libwally compiles through the build system, tho.

cc bitcoin/block.c
cc bitcoin/chainparams.c
cc bitcoin/feerate.c
cc bitcoin/locktime.c
cc bitcoin/preimage.c
cc bitcoin/privkey.c
cc bitcoin/psbt.c
cc bitcoin/pubkey.c
cc bitcoin/script.c
cc bitcoin/shadouble.c
cc bitcoin/short_channel_id.c
cc bitcoin/signature.c
cc bitcoin/tx.c
cc bitcoin/tx_parts.c
cc bitcoin/varint.c
cc wire/wire_sync.c
cc wire/wire_io.c
cc wire/fromwire.c
cc wire/peer_wire.c
cc wire/tlvstream.c
cc wire/towire.c
wiregen wire/bolt12_wiregen.c
cc wire/bolt12_wiregen.c
wiregen wire/peer_wiregen.c
cc wire/peer_wiregen.c
wiregen wire/channel_type_wiregen.c
cc wire/channel_type_wiregen.c
wiregen wire/onion_wiregen.c
cc wire/onion_wiregen.c
ld lightningd/lightning_hsmd
CC: cc -DBINTOPKGLIBEXECDIR="../libexec/c-lightning" -Wall -Wundef -Wmissing-prototypes -Wmissing-declarations -Wstrict-prototypes -Wold-style-definition -Werror -std=gnu11 -g -fstack-protector-strong -Og -I ccan -I external/libwally-core/include/ -I external/libwally-core/src/secp256k1/include/ -I external/jsmn/ -I external/libbacktrace/ -I external/gheap/ -I external/aarch64-unknown-linux-android24/libbacktrace-build -I . -I/usr/local/include -I/data/data/com.termux/files/usr/include     -DSHACHAIN_BITS=48 -DJSMN_PARENT_LINKS  -DCOMPAT_V052=1 -DCOMPAT_V060=1 -DCOMPAT_V061=1 -DCOMPAT_V062=1 -DCOMPAT_V070=1 -DCOMPAT_V072=1 -DCOMPAT_V073=1 -DCOMPAT_V080=1 -DCOMPAT_V081=1 -DCOMPAT_V082=1 -DCOMPAT_V090=1 -DCOMPAT_V0100=1 -DBUILD_ELEMENTS=1  -c -o
LD: cc   -Og  config.vars  -Lexternal/aarch64-unknown-linux-android24 -lwallycore -lsecp256k1 -ljsmn -lbacktrace -L/usr/local/lib -lm -lgmp -L/data/data/com.termux/files/usr/lib -lsqlite3 -lz  -lsodium -o
ld lightningd/lightning_hsmd
ld.lld: error: undefined symbol: wally_psbt_elements_init_alloc
>>> referenced by psbt.c:27 (bitcoin/psbt.c:27)
>>>               bitcoin/psbt.o:(init_psbt)

ld.lld: error: undefined symbol: wally_psbt_input_set_value
>>> referenced by psbt.c:353 (bitcoin/psbt.c:353)
>>>               bitcoin/psbt.o:(psbt_elements_input_set_asset)

ld.lld: error: undefined symbol: wally_psbt_input_set_asset
>>> referenced by psbt.c:358 (bitcoin/psbt.c:358)
>>>               bitcoin/psbt.o:(psbt_elements_input_set_asset)
clang-14: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [Makefile:609: lightningd/lightning_hsmd] Error 1

i spent hours on this before posting here :)

weedcoder commented 2 years ago

this exact error reoccur when make -k

jgriffiths commented 2 years ago

Hi @weedcoder

This error is indicating that wally was not compiled with -DBUILD_ELEMENTS=1 on the command line. Makefile sets this in CFLAGS for you so please check your build environment to make sure CFLAGS is being passed along correctly.