Error Building from source on MacOS BigSur; linker issues #20825

issue jadijadi opened this issue on January 1, 2021
  1. jadijadi commented at 8:14 PM on January 1, 2021: contributor

    Trying to build the bitcoin core from source on Mac Big Sur based on the doc:

    xcode-select --install
    brew install automake libtool boost miniupnpc pkg-config python qt libevent qrencode sqlite
    git clone https://github.com/bitcoin/bitcoin
    cd bitcoin
    ./autogen.sh
    ./configure
    make
    

    but it breaks with:

    Making all in src
      CXXLD    bitcoind
    ld: warning: ignoring file libbitcoin_wallet.a, building for macOS-x86_64 but attempting to link with file built for unknown-unsupported file format ( 0x21 0x3C 0x61 0x72 0x63 0x68 0x3E 0x0A 0x2F 0x20 0x20 0x20 0x20 0x20 0x20 0x20 )
    ld: warning: ignoring file libbitcoin_common.a, building for macOS-x86_64 but attempting to link with file built for unknown-unsupported file format ( 0x21 0x3C 0x61 0x72 0x63 0x68 0x3E 0x0A 0x2F 0x20 0x20 0x20 0x20 0x20 0x20 0x20 )
    ld: warning: ignoring file libbitcoin_server.a, building for macOS-x86_64 but attempting to link with file built for unknown-unsupported file format ( 0x21 0x3C 0x61 0x72 0x63 0x68 0x3E 0x0A 0x2F 0x20 0x20 0x20 0x20 0x20 0x20 0x20 )
    ld: warning: ignoring file univalue/.libs/libunivalue.a, building for macOS-x86_64 but attempting to link with file built for unknown-unsupported file format ( 0x21 0x3C 0x61 0x72 0x63 0x68 0x3E 0x0A 0x2F 0x20 0x20 0x20 0x20 0x20 0x20 0x20 )
    ld: warning: ignoring file libbitcoin_zmq.a, building for macOS-x86_64 but attempting to link with file built for unknown-unsupported file format ( 0x21 0x3C 0x61 0x72 0x63 0x68 0x3E 0x0A 0x2F 0x20 0x20 0x20 0x20 0x20 0x20 0x20 )
    ld: warning: ignoring file libbitcoin_util.a, building for macOS-x86_64 but attempting to link with file built for unknown-unsupported file format ( 0x21 0x3C 0x61 0x72 0x63 0x68 0x3E 0x0A 0x2F 0x20 0x20 0x20 0x20 0x20 0x20 0x20 )
    ld: warning: ignoring file crypto/libbitcoin_crypto_base.a, building for macOS-x86_64 but attempting to link with file built for macOS-x86_64
    ld: warning: ignoring file crypto/libbitcoin_crypto_avx2.a, building for macOS-x86_64 but attempting to link with file built for macOS-x86_64
    ld: warning: ignoring file crypto/libbitcoin_crypto_shani.a, building for macOS-x86_64 but attempting to link with file built for unknown-unsupported file format ( 0x21 0x3C 0x61 0x72 0x63 0x68 0x3E 0x0A 0x2F 0x20 0x20 0x20 0x20 0x20 0x20 0x20 )
    ld: warning: ignoring file crypto/libbitcoin_crypto_sse41.a, building for macOS-x86_64 but attempting to link with file built for unknown-unsupported file format ( 0x21 0x3C 0x61 0x72 0x63 0x68 0x3E 0x0A 0x2F 0x20 0x20 0x20 0x20 0x20 0x20 0x20 )
    ld: warning: ignoring file crc32c/libcrc32c.a, building for macOS-x86_64 but attempting to link with file built for unknown-unsupported file format ( 0x21 0x3C 0x61 0x72 0x63 0x68 0x3E 0x0A 0x2F 0x20 0x20 0x20 0x20 0x20 0x20 0x20 )
    ld: warning: ignoring file crc32c/libcrc32c_sse42.a, building for macOS-x86_64 but attempting to link with file built for unknown-unsupported file format ( 0x21 0x3C 0x61 0x72 0x63 0x68 0x3E 0x0A 0x2F 0x20 0x20 0x20 0x20 0x20 0x20 0x20 )
    ld: warning: ignoring file leveldb/libmemenv.a, building for macOS-x86_64 but attempting to link with file built for unknown-unsupported file format ( 0x21 0x3C 0x61 0x72 0x63 0x68 0x3E 0x0A 0x2F 0x20 0x20 0x20 0x20 0x20 0x20 0x20 )
    ld: warning: ignoring file secp256k1/.libs/libsecp256k1.a, building for macOS-x86_64 but attempting to link with file built for unknown-unsupported file format ( 0x21 0x3C 0x61 0x72 0x63 0x68 0x3E 0x0A 0x2F 0x20 0x20 0x20 0x20 0x20 0x20 0x20 )
    ld: warning: ignoring file libbitcoin_consensus.a, building for macOS-x86_64 but attempting to link with file built for unknown-unsupported file format ( 0x21 0x3C 0x61 0x72 0x63 0x68 0x3E 0x0A 0x2F 0x20 0x20 0x20 0x20 0x20 0x20 0x20 )
    ld: warning: ignoring file leveldb/libleveldb.a, building for macOS-x86_64 but attempting to link with file built for unknown-unsupported file format ( 0x21 0x3C 0x61 0x72 0x63 0x68 0x3E 0x0A 0x2F 0x20 0x20 0x20 0x20 0x20 0x20 0x20 )
    Undefined symbols for architecture x86_64:
      "SetupEnvironment()", referenced from:
          _main in bitcoind-bitcoind.o
      "noui_connect()", referenced from:
    

    some info:

    ➜  bitcoin git:(master) uname -a
    Darwin jadis-MacBook-Pro.local 20.2.0 Darwin Kernel Version 20.2.0: Wed Dec  2 20:39:59 PST 2020; root:xnu-7195.60.75~1/RELEASE_X86_64 x86_64
    ➜  bitcoin git:(master) make -v
    GNU Make 3.81
    Copyright (C) 2006  Free Software Foundation, Inc.
    This is free software; see the source for copying conditions.
    There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
    PARTICULAR PURPOSE.
    
    This program built for i386-apple-darwin11.3.0
    ➜  bitcoin git:(master) brew -v
    Homebrew 2.7.1-108-g1af8203
    Homebrew/homebrew-core (git revision c926d5; last commit 2021-01-01)
    Homebrew/homebrew-cask (git revision a43760; last commit 2021-01-01)
    

    paste of the ./autogen.sh output: https://pastebin.com/nGctaJGB paste of the ./configure --without-gui output: https://pastebin.com/HCDyNGGb paste of the make: https://pastebin.com/0UTVcAUs

    config.log

    I'm working on this for 2 days with no results and will appreciate any help or more info needed.

    EDIT: OS and XCode is updated to the latest version. brew upgrade is done.

  2. jadijadi added the label Bug on Jan 1, 2021
  3. hebasto commented at 11:16 PM on January 1, 2021: member

    Did you try make clean?

  4. hebasto commented at 11:30 PM on January 1, 2021: member

    Also could you provide the brew list output?

  5. jadijadi commented at 5:06 AM on January 2, 2021: contributor

    Did you try make clean?

    yes. Even cloned in another directory, same issue.

  6. jadijadi commented at 5:08 AM on January 2, 2021: contributor

    Also could you provide the brew list output?

    Sure and thanks for the help.

    ➜  bitcoin git:(master) brew list
    adns				ghc				icu4c				libsodium			openssl@1.1			sip
    adwaita-icon-theme		ghostscript			ilmbase				libsoup				opus				snappy
    amtk				giflib				imagemagick			libsoxr				p11-kit				speex
    aom				git				intltool			libssh2				pandoc				sphinx-doc
    aspell				glances				irssi				libtasn1			pango				sqlite
    atk				glfw				isl				libtensorflow			pcre				srt
    autoconf			glib				iso-codes			libtiff				pcre2				sslscan
    automake			glib-networking			jasper				libtool				perl				stoken
    axel				gmp				jcal				libunistring			pinentry			task
    bdw-gc				gnome-icon-theme		jemalloc			libusb				pixman				taskd
    berkeley-db@4			gnu-getopt			jpeg				libusb-compat			pkg-config			tasksh
    binutils			gnu-sed				krb5				libvidstab			postgresql			tcpflow
    boost				gnu-tar				lame				libvorbis			powerline-go			telnet
    c-ares				gnu-which			leptonica			libvpx				privoxy				tepl
    cabal-install			gnupg				leveldb				libxml2				protobuf			tesseract
    cairo				gnupg2				lftp				libyaml				proxychains-ng			texi2html
    cmake				gnutls				libass				links				pth				theora
    coreutils			go				libassuan			little-cms2			py2cairo			tmux
    cowsay				gobject-introspection		libbluray			lua				py3cairo			tor
    cscope				gperftools			libcroco			lzo				pygobject			torsocks
    dav1d				gpg-agent			libde265			macvim				pygobject3			tree
    diffutils			gradle				libepoxy			makedepend			pygtk				uchardet
    dirmngr				graphite2			libev				memcached			python				unbound
    docbook				graphviz			libevent			miniupnpc			python3				utf8proc
    docbook-xsl			grep				libffi				mitmproxy			python@2			vala
    enchant				gsettings-desktop-schemas	libgcrypt			mono				python@3.8			vim
    erlang				gspell				libgpg-error			mpfr				python@3.9			watch
    ext4fuse			gtk+				libheif				mysql				qrencode			watson
    ffmpeg				gtk+3				libidn				ncurses				qt				webp
    findutils			gtk-mac-integration		libidn2				nethack				qt@5.7				wget
    flac				gtksourceview3			libksba				netpbm				rav1e				wxmac
    fontconfig			gtksourceview4			liblqr				nettle				readline			x264
    freetype			gtkspell3			libmpc				nghttp2				reattach-to-user-namespace	x265
    frei0r				gts				libogg				nmap				redis				xmlto
    fribidi				guetzli				libomp				node				rtmpdump			xvid
    gcc				guile				libpeas				npth				rubberband			xz
    gd				gzip				libpng				openconnect			ruby				yasm
    gdb				harfbuzz			libpsl				opencore-amr			rust				youtube-dl
    gdbm				heroku				librsvg				openexr				scrcpy				zeromq
    gdk-pixbuf			hicolor-icon-theme		libsamplerate			openfortivpn			screenfetch			zsh
    gedit				hping				libscrypt			openjdk				sdl2
    gettext				htop				libsndfile			openjpeg			shared-mime-info
    b                                                                   dnscrypt                                                            osxfuse
    ➜
    
  7. hebasto commented at 7:50 AM on January 2, 2021: member

    From your configure log it follows that non-cctools build tools are used. Make sure that Apple's toolchain is used, e.g.:

    % which ranlib
    /usr/bin/ranlib
    % $(which ranlib) -V
    Apple Inc. version cctools-977.1
    error: /Library/Developer/CommandLineTools/usr/bin/ranlib: no archives specified
    Usage: /Library/Developer/CommandLineTools/usr/bin/ranlib [-sactfqLT] [-] archive [...]
    

    You could try to remove Homebrew's binutils or adjust the $PATH variable (did not check side effects of the latter).

  8. jadijadi commented at 8:41 AM on January 2, 2021: contributor

    Wow... thanks @hebasto ! This resolved my issue. I would have never able to find it without help. Thanks very much for the help. Really appreciated.

  9. jadijadi closed this on Jan 2, 2021

  10. KevinHock commented at 12:06 AM on April 12, 2021: none

    Wow @hebasto thanks for helping me out installing cabal, just found this issue via google search.

  11. samuel-reyes commented at 1:55 AM on May 5, 2021: none

    Wow... thanks @hebasto ! This resolved my issue. I would have never able to find it without help. Thanks very much for the help. Really appreciated.

    I'm not really sure what he meant, but I'm having the same issue with the i386 error. How did you get it to work? I need a little more elaboration than what @hebasto provided. I'm not super familiar with paths, and my brew doesn't have the package installed he said to remove. So I'm guessing I need to adjust my path? I would appreciate any help :) @jadijadi

  12. fzyzcjy commented at 2:08 PM on September 26, 2021: none

    From your configure log it follows that non-cctools build tools are used. Make sure that Apple's toolchain is used, e.g.:

    % which ranlib
    /usr/bin/ranlib
    % $(which ranlib) -V
    Apple Inc. version cctools-977.1
    error: /Library/Developer/CommandLineTools/usr/bin/ranlib: no archives specified
    Usage: /Library/Developer/CommandLineTools/usr/bin/ranlib [-sactfqLT] [-] archive [...]
    

    You could try to remove Homebrew's binutils or adjust the $PATH variable (did not check side effects of the latter).

    This helps me compile protobuf in macos for ios! thanks you! related: https://stackoverflow.com/questions/69335349/error-when-compiling-protobuf-for-c-in-ios-undefined-symbols-and-ld-warni?noredirect=1#comment122548676_69335349

  13. fanquake locked this on Sep 26, 2021

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: 2026-04-29 03:14 UTC

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