build: multiprocess link issues on fedora aarch64 #26943

issue fanquake openend this issue on January 22, 2023
  1. fanquake commented at 3:41 pm on January 22, 2023: member

    master @ ad09b762757a293ff970113c15bd9dee3057e556

     0make -C depends/ -j5 NO_QT=1 NO_WALLET=1 NO_ZMQ=1 NO_NATPMP=1 NO_UPNP=1 MULTIPROCESS=1
     1./autogen.sh
     2CONFIG_SITE=/home/fedora/bitcoin/depends/aarch64-unknown-linux-gnu/share/config.site ./configure
     3make
     4...
     5  CXXLD    bitcoin-node
     6  CXXLD    test/test_bitcoin
     7/usr/bin/ld: /home/fedora/bitcoin/depends/aarch64-unknown-linux-gnu/lib/libmultiprocess.a(proxy.cpp.o): relocation R_AARCH64_ADR_PREL_PG_HI21 against symbol `_ZN2kj1_5Debug11minSeverityE' which may bind externally can not be used when making a shared object; recompile with -fPIC
     8/usr/bin/ld: /home/fedora/bitcoin/depends/aarch64-unknown-linux-gnu/lib/libmultiprocess.a(proxy.cpp.o)(.text+0xa34): unresolvable R_AARCH64_ADR_PREL_PG_HI21 relocation against symbol `_ZN2kj1_5Debug11minSeverityE'
     9/usr/bin/ld: final link failed: bad value
    10collect2: error: ld returned 1 exit status
    
  2. fanquake added the label Build system on Jan 22, 2023
  3. hebasto commented at 9:37 am on January 25, 2023: member

    FWIW, there are no issues on Ubuntu 22.04:

    0# cat /etc/os-release | grep VERSION
    1VERSION_ID="22.04"
    2VERSION="22.04.1 LTS (Jammy Jellyfish)"
    3VERSION_CODENAME=jammy
    4# uname -m    
    5aarch64
    
  4. hebasto commented at 10:28 am on January 25, 2023: member
    Confirming the bug on Fedora 37.
  5. maflcko commented at 10:33 am on January 25, 2023: member
    Does it also happen on Kinetic or Lunar? Or with clang?
  6. hebasto commented at 10:56 am on January 25, 2023: member

    Does it also happen on Kinetic or Lunar? Or with clang?

    It happens with clang-15 which is the default on Fedora 37.

  7. hebasto commented at 11:23 am on January 25, 2023: member
    And it compiles with #25797 :)
  8. maflcko commented at 8:56 pm on January 25, 2023: member

    It happens with clang-15 which is the default on Fedora 37.

    No? clang is not default for Fedora. g++ is picked, at least on my system.

    The bug doesn’t happen on Lunar. On Fedora it happens with both g++ and clang++:

     0# make V=1
     1Making all in src
     2make[1]: Entering directory '/bitcoin-core/src'
     3make[2]: Entering directory '/bitcoin-core/src'
     4make[3]: Entering directory '/bitcoin-core'
     5make[3]: Leaving directory '/bitcoin-core'
     6/bin/sh ../libtool  --tag=CXX --preserve-dup-deps  --mode=link /usr/bin/ccache g++ -std=c++17 -fdebug-prefix-map=/bitcoin-core=. -fstack-reuse=none -Wstack-protector -fstack-protector-all -fstack-clash-protection       -fno-extended-identifiers -fPIE -pipe -std=c++17 -O2    -Wl,-z,relro -Wl,-z,now -Wl,-z,separate-code -pie      -pthread -lpthread -L/bitcoin-core/depends/aarch64-unknown-linux-gnu/lib  -o bitcoin-node bitcoin_node-bitcoind.o  init/bitcoin_node-bitcoin-node.o libbitcoin_node.a  libbitcoin_common.a libbitcoin_util.a libunivalue.la  libbitcoin_consensus.a crypto/libbitcoin_crypto_base.la    crypto/libbitcoin_crypto_arm_shani.la leveldb/libleveldb.la crc32c/libcrc32c.la   leveldb/libmemenv.la secp256k1/libsecp256k1.la    -L/bitcoin-core/depends/aarch64-unknown-linux-gnu/lib -levent_pthreads -levent  -L/bitcoin-core/depends/aarch64-unknown-linux-gnu/lib -levent    libbitcoin_ipc.a -L/bitcoin-core/depends/aarch64-unknown-linux-gnu/lib -lmultiprocess -lcapnp-rpc -lcapnp -lkj-async -lkj -pthread -lpthread  
     7libtool: link: /usr/bin/ccache g++ -std=c++17 -fdebug-prefix-map=/bitcoin-core=. -fstack-reuse=none -Wstack-protector -fstack-protector-all -fstack-clash-protection -fno-extended-identifiers -fPIE -pipe -std=c++17 -O2 -Wl,-z -Wl,relro -Wl,-z -Wl,now -Wl,-z -Wl,separate-code -pie -o bitcoin-node bitcoin_node-bitcoind.o init/bitcoin_node-bitcoin-node.o  -lpthread -L/bitcoin-core/depends/aarch64-unknown-linux-gnu/lib libbitcoin_node.a libbitcoin_common.a libbitcoin_util.a ./.libs/libunivalue.a libbitcoin_consensus.a crypto/.libs/libbitcoin_crypto_base.a crypto/.libs/libbitcoin_crypto_arm_shani.a leveldb/.libs/libleveldb.a crc32c/.libs/libcrc32c.a leveldb/.libs/libmemenv.a secp256k1/.libs/libsecp256k1.a -levent_pthreads -levent -levent libbitcoin_ipc.a -lmultiprocess /bitcoin-core/depends/aarch64-unknown-linux-gnu/lib/libcapnp-rpc.so /bitcoin-core/depends/aarch64-unknown-linux-gnu/lib/libcapnp.so /bitcoin-core/depends/aarch64-unknown-linux-gnu/lib/libkj-async.so /bitcoin-core/depends/aarch64-unknown-linux-gnu/lib/libkj.so -lpthread -pthread -Wl,-rpath -Wl,/bitcoin-core/depends/aarch64-unknown-linux-gnu/lib -Wl,-rpath -Wl,/bitcoin-core/depends/aarch64-unknown-linux-gnu/lib
     8/usr/bin/ld: /bitcoin-core/depends/aarch64-unknown-linux-gnu/lib/libmultiprocess.a(proxy.cpp.o): relocation R_AARCH64_ADR_PREL_PG_HI21 against symbol `_ZN2kj1_5Debug11minSeverityE' which may bind externally can not be used when making a shared object; recompile with -fPIC
     9/usr/bin/ld: /bitcoin-core/depends/aarch64-unknown-linux-gnu/lib/libmultiprocess.a(proxy.cpp.o)(.text+0xa34): unresolvable R_AARCH64_ADR_PREL_PG_HI21 relocation against symbol `_ZN2kj1_5Debug11minSeverityE'
    10/usr/bin/ld: final link failed: bad value
    11collect2: error: ld returned 1 exit status
    12make[2]: *** [Makefile:7114: bitcoin-node] Error 1
    13make[2]: Leaving directory '/bitcoin-core/src'
    14make[1]: *** [Makefile:19201: all-recursive] Error 1
    15make[1]: Leaving directory '/bitcoin-core/src'
    16make: *** [Makefile:817: all-recursive] Error 1
    
     0# make V=1
     1Making all in src
     2make[1]: Entering directory '/bitcoin-core/src'
     3make[2]: Entering directory '/bitcoin-core/src'
     4make[3]: Entering directory '/bitcoin-core'
     5make[3]: Leaving directory '/bitcoin-core'
     6/bin/sh ../libtool  --tag=CXX --preserve-dup-deps  --mode=link /usr/bin/ccache clang++ -std=c++17 -fdebug-prefix-map=/bitcoin-core=. -Wstack-protector -fstack-protector-all        -fPIE -pipe -std=c++17 -O2    -Wl,-z,relro -Wl,-z,now -Wl,-z,separate-code -pie      -pthread -lpthread -L/bitcoin-core/depends/aarch64-unknown-linux-gnu/lib  -o bitcoin-node bitcoin_node-bitcoind.o  init/bitcoin_node-bitcoin-node.o libbitcoin_node.a  libbitcoin_common.a libbitcoin_util.a libunivalue.la  libbitcoin_consensus.a crypto/libbitcoin_crypto_base.la    crypto/libbitcoin_crypto_arm_shani.la leveldb/libleveldb.la crc32c/libcrc32c.la  crc32c/libcrc32c_arm_crc.la leveldb/libmemenv.la secp256k1/libsecp256k1.la    -L/bitcoin-core/depends/aarch64-unknown-linux-gnu/lib -levent_pthreads -levent  -L/bitcoin-core/depends/aarch64-unknown-linux-gnu/lib -levent    libbitcoin_ipc.a -L/bitcoin-core/depends/aarch64-unknown-linux-gnu/lib -lmultiprocess -lcapnp-rpc -lcapnp -lkj-async -lkj -pthread -lpthread  
     7libtool: link: /usr/bin/ccache clang++ -std=c++17 -fdebug-prefix-map=/bitcoin-core=. -Wstack-protector -fstack-protector-all -fPIE -pipe -std=c++17 -O2 -Wl,-z -Wl,relro -Wl,-z -Wl,now -Wl,-z -Wl,separate-code -pie -o bitcoin-node bitcoin_node-bitcoind.o init/bitcoin_node-bitcoin-node.o  -lpthread -L/bitcoin-core/depends/aarch64-unknown-linux-gnu/lib libbitcoin_node.a libbitcoin_common.a libbitcoin_util.a ./.libs/libunivalue.a libbitcoin_consensus.a crypto/.libs/libbitcoin_crypto_base.a crypto/.libs/libbitcoin_crypto_arm_shani.a leveldb/.libs/libleveldb.a crc32c/.libs/libcrc32c.a crc32c/.libs/libcrc32c_arm_crc.a leveldb/.libs/libmemenv.a secp256k1/.libs/libsecp256k1.a -levent_pthreads -levent -levent libbitcoin_ipc.a -lmultiprocess /bitcoin-core/depends/aarch64-unknown-linux-gnu/lib/libcapnp-rpc.so /bitcoin-core/depends/aarch64-unknown-linux-gnu/lib/libcapnp.so /bitcoin-core/depends/aarch64-unknown-linux-gnu/lib/libkj-async.so /bitcoin-core/depends/aarch64-unknown-linux-gnu/lib/libkj.so -lpthread -pthread -Wl,-rpath -Wl,/bitcoin-core/depends/aarch64-unknown-linux-gnu/lib -Wl,-rpath -Wl,/bitcoin-core/depends/aarch64-unknown-linux-gnu/lib
     8/usr/bin/ld: /bitcoin-core/depends/aarch64-unknown-linux-gnu/lib/libmultiprocess.a(proxy.cpp.o): relocation R_AARCH64_ADR_PREL_PG_HI21 against symbol `_ZN2kj1_5Debug11minSeverityE' which may bind externally can not be used when making a shared object; recompile with -fPIC
     9/usr/bin/ld: /bitcoin-core/depends/aarch64-unknown-linux-gnu/lib/libmultiprocess.a(proxy.cpp.o)(.text+0x10): unresolvable R_AARCH64_ADR_PREL_PG_HI21 relocation against symbol `_ZN2kj1_5Debug11minSeverityE'
    10/usr/bin/ld: final link failed: bad value
    11clang-15: error: linker command failed with exit code 1 (use -v to see invocation)
    12make[2]: *** [Makefile:7114: bitcoin-node] Error 1
    13make[2]: Leaving directory '/bitcoin-core/src'
    14make[1]: *** [Makefile:19201: all-recursive] Error 1
    15make[1]: Leaving directory '/bitcoin-core/src'
    16make: *** [Makefile:817: all-recursive] Error 1
    
  9. hebasto commented at 9:56 pm on January 25, 2023: member

    It happens with clang-15 which is the default on Fedora 37.

    No? clang is not default for Fedora. g++ is picked, at least on my system.

    I meant version “15” is default for package “clang” :)

    Sorry for messing things up…

  10. maflcko commented at 9:15 am on January 26, 2023: member

    No worries.

    Checked that Fedora 38 rawhide is also affected. Fedora 36 works (tested g++).

  11. jonatack commented at 8:43 pm on January 30, 2023: contributor
  12. maflcko renamed this:
    build: multiprocess link issues on aarch64
    build: multiprocess link issues on fedora aarch64
    on Jan 31, 2023
  13. ryanofsky commented at 8:00 pm on February 15, 2023: contributor

    I don’t understand why this would happen only for one platform, but based on the error message maybe the following change would fix it:

    0--- a/depends/packages/capnp.mk
    1+++ b/depends/packages/capnp.mk
    2@@ -11,6 +11,7 @@ $(package)_config_opts := --with-external-capnp
    3 $(package)_config_opts += CAPNP="$$(native_capnp_prefixbin)/capnp"
    4 $(package)_config_opts += CAPNP_CXX="$$(native_capnp_prefixbin)/capnp-c++"
    5 $(package)_config_opts_android := --disable-shared
    6+$(package)_cxxflags += -fPIC
    7 endef
    8 
    9 define $(package)_config_cmds
    

    The error is link error linking the bitcoin-node executable:

    /usr/bin/ld: /bitcoin-core/depends/aarch64-unknown-linux-gnu/lib/libmultiprocess.a(proxy.cpp.o): relocation R_AARCH64_ADR_PREL_PG_HI21 against symbol `_ZN2kj1_5Debug11minSeverityE’ which may bind externally can not be used when making a shared object; recompile with -fPIC

    The decoded symbol name is kj::_::Debug::minSeverity which is a symbol in the libkj.a library


    re: #26943 (comment)

    Unsure if related: https://cirrus-ci.com/task/5963593934438400?logs=ci#L1092

    This looks like a different issue. Maybe caused by the change a few weeks ago https://github.com/community/community/discussions/46034 affecting github download checksums

  14. hebasto commented at 10:38 am on February 26, 2023: member

    The decoded symbol name is kj::_::Debug::minSeverity which is a symbol in the libkj.a library

    If we expect that the static libkj.a library is used rather than the shared libkj.so one, maybe it makes sense to configure with --disable-shared for all platforms, not just for Android?

  15. fanquake referenced this in commit c3a962be10 on Nov 10, 2023
  16. fanquake commented at 1:47 pm on December 5, 2023: member
    Going to close, as this issue specifically should be fixed, but building on aarch64 is still broken until atleast #28846.
  17. fanquake closed this on Dec 5, 2023


github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-07-05 19:13 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me