eos icon indicating copy to clipboard operation
eos copied to clipboard

eos build error(Undefined symbols for architecture x86_64) on mac Sierra 10.12.6

Open border opened this issue 8 years ago • 19 comments

build with "./eosio-build.sh darwin"

[ 44%] Building CXX object libraries/wasm-jit/Source/Programs/CMakeFiles/Test.dir/Test.cpp.o
[ 45%] Linking CXX executable wavm
Undefined symbols for architecture x86_64:
  "typeinfo for llvm::Instruction", referenced from:
      typeinfo for llvm::SelectInst in libRuntime.a(LLVMEmitIR.cpp.o)
  "typeinfo for llvm::RuntimeDyld::MemoryManager", referenced from:
      typeinfo for llvm::MCJITMemoryManager in libRuntime.a(LLVMJIT.cpp.o)
  "typeinfo for llvm::raw_ostream", referenced from:
      typeinfo for llvm::raw_pwrite_stream in libRuntime.a(LLVMJIT.cpp.o)
  "typeinfo for llvm::MemoryBuffer", referenced from:
      typeinfo for llvm::ObjectMemoryBuffer in libRuntime.a(LLVMJIT.cpp.o)
  "typeinfo for llvm::ErrorInfoBase", referenced from:
      typeinfo for llvm::ErrorInfo<llvm::ErrorList, llvm::ErrorInfoBase> in libRuntime.a(LLVMJIT.cpp.o)
  "typeinfo for llvm::JITSymbolResolver", referenced from:
      typeinfo for LLVMJIT::NullResolver in libRuntime.a(LLVMJIT.cpp.o)
  "typeinfo for llvm::RTDyldMemoryManager", referenced from:
      typeinfo for LLVMJIT::UnitMemoryManager in libRuntime.a(LLVMJIT.cpp.o)
  "typeinfo for llvm::CmpInst", referenced from:
      typeinfo for llvm::FCmpInst in libRuntime.a(LLVMEmitIR.cpp.o)
ld: symbol(s) not found for architecture x86_64
clang-4.0: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [libraries/wasm-jit/Source/Programs/wavm] Error 1
make[1]: *** [libraries/wasm-jit/Source/Programs/CMakeFiles/wavm.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 46%] Linking CXX executable Test
Undefined symbols for architecture x86_64:
  "typeinfo for llvm::Instruction", referenced from:
      typeinfo for llvm::SelectInst in libRuntime.a(LLVMEmitIR.cpp.o)
  "typeinfo for llvm::RuntimeDyld::MemoryManager", referenced from:
      typeinfo for llvm::MCJITMemoryManager in libRuntime.a(LLVMJIT.cpp.o)
  "typeinfo for llvm::raw_ostream", referenced from:
      typeinfo for llvm::raw_pwrite_stream in libRuntime.a(LLVMJIT.cpp.o)
  "typeinfo for llvm::MemoryBuffer", referenced from:
      typeinfo for llvm::ObjectMemoryBuffer in libRuntime.a(LLVMJIT.cpp.o)
  "typeinfo for llvm::ErrorInfoBase", referenced from:
      typeinfo for llvm::ErrorInfo<llvm::ErrorList, llvm::ErrorInfoBase> in libRuntime.a(LLVMJIT.cpp.o)
  "typeinfo for llvm::JITSymbolResolver", referenced from:
      typeinfo for LLVMJIT::NullResolver in libRuntime.a(LLVMJIT.cpp.o)
  "typeinfo for llvm::RTDyldMemoryManager", referenced from:
      typeinfo for LLVMJIT::UnitMemoryManager in libRuntime.a(LLVMJIT.cpp.o)
  "typeinfo for llvm::CmpInst", referenced from:
      typeinfo for llvm::FCmpInst in libRuntime.a(LLVMEmitIR.cpp.o)
ld: symbol(s) not found for architecture x86_64
clang-4.0: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [libraries/wasm-jit/Source/Programs/Test] Error 1
make[1]: *** [libraries/wasm-jit/Source/Programs/CMakeFiles/Test.dir/all] Error 2
~/work/eos(master ✗) uname -an
Darwin kvbianMBP 16.7.0 Darwin Kernel Version 16.7.0: Thu Jun 15 17:36:27 PDT 2017; root:xnu-3789.70.16~2/RELEASE_X86_64 x86_64

border avatar Feb 06 '18 23:02 border

same problem.Have you solved the problem?

jeffreyzhou0924 avatar Mar 14 '18 15:03 jeffreyzhou0924

Try pulling in the latest code from the repo and building from eosio_build.sh, also run: llvm-config --has-rtti if the result = "NO" then that is the problem. You will need to remove your install of llvm/clang and re-install.

pacificcode avatar Mar 14 '18 18:03 pacificcode

having the same problem

beeant avatar Apr 01 '18 17:04 beeant

llvm-config --has-rtti --version YES 4.0.1

hoopslb avatar May 03 '18 14:05 hoopslb

@hoopslb @beeant @zhouyasong This issue is pretty old but not forgotten. The code base is pretty stable now. I recommend: cd /path/to/eos rm -rf build/ git pull git submodule update --init --recursive ./eosio_build.sh

Save the output of the script and put it here if you run into any issues.

pacificcode avatar May 03 '18 21:05 pacificcode

Hi, same issue here with recent version. I'm running High Sierra 10.13.4.

ld: warning: ignoring file /usr/local/lib/libintl.dylib, missing required architecture x86_64 in file /usr/local/lib/libintl.dylib (2 slices)
Undefined symbols for architecture x86_64:
  "_libintl_bindtextdomain", referenced from:
      _main in main.cpp.o
  "_libintl_gettext", referenced from:
      eosio::client::localize::localized_with_variant(char const*, fc::variant_object const&) in main.cpp.o
      eosio::client::localize::localized_with_variant(char const*, fc::variant_object const&) in help_text.cpp.o
  "_libintl_setlocale", referenced from:
      _main in main.cpp.o
  "_libintl_textdomain", referenced from:
      _main in main.cpp.o
ld: symbol(s) not found for architecture x86_64
clang-4.0: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [programs/cleos/cleos] Error 1
make[1]: *** [programs/cleos/CMakeFiles/cleos.dir/all] Error 2
$ llvm-config --has-rtti --version
YES
4.0.1

schabluk avatar May 07 '18 17:05 schabluk

++ same problem at macOS High Sierra 10.13.4 (17E202)

[ 74%] Building LLVM bitcode simple.token.cpp.bc Undefined symbols for architecture x86_64: "typeinfo for llvm::Instruction", referenced from: Undefined symbols for architecture x86_64: "typeinfo for llvm::Instruction", referenced from: typeinfo for llvm::SelectInst in libRuntime.a(LLVMEmitIR.cpp.o) typeinfo for llvm::SelectInst in libRuntime.a(LLVMEmitIR.cpp.o) "typeinfo for llvm::MemoryBuffer", referenced from: typeinfo for llvm::ObjectMemoryBuffer in libRuntime.a(LLVMJIT.cpp.o) "typeinfo for llvm::MemoryBuffer", referenced from: typeinfo for llvm::ObjectMemoryBuffer in libRuntime.a(LLVMJIT.cpp.o) "typeinfo for llvm::JITSymbolResolver", referenced from: typeinfo for LLVMJIT::NullResolver in libRuntime.a(LLVMJIT.cpp.o) "typeinfo for llvm::JITSymbolResolver", referenced from: typeinfo for LLVMJIT::NullResolver in libRuntime.a(LLVMJIT.cpp.o) "typeinfo for llvm::RTDyldMemoryManager", referenced from: typeinfo for LLVMJIT::UnitMemoryManager in libRuntime.a(LLVMJIT.cpp.o) "typeinfo for llvm::RTDyldMemoryManager", referenced from: typeinfo for LLVMJIT::UnitMemoryManager in libRuntime.a(LLVMJIT.cpp.o) "typeinfo for llvm::CmpInst", referenced from: typeinfo for llvm::FCmpInst in libRuntime.a(LLVMEmitIR.cpp.o) "typeinfo for llvm::CmpInst", referenced from: typeinfo for llvm::FCmpInst in libRuntime.a(LLVMEmitIR.cpp.o) ld: symbol(s) not found for architecture x86_64 ld: symbol(s) not found for architecture x86_64 clangclang: : error: linker command failed with exit code 1 (use -v to see invocation)error:

69736c616d avatar May 12 '18 11:05 69736c616d

@69736c616d I need to see the full output of the eosio_build.sh script. Can you run the following and post the eosio_build.log file here? brew remove --force llvm brew install llvm@4 brew unlink llvm@4 && brew link --force llvm@4 cd /path/to/eos rm -rf build/ git pull git submodule update --init --recursive ./eosio_build.sh > eosio_build.log

pacificcode avatar May 12 '18 17:05 pacificcode

here it is output of
./eosio_build.sh &2> eosio_build.log eosio_build.log

eosio_build.log

69736c616d avatar May 13 '18 08:05 69736c616d

@schabluk your issue is brew not symlinking gettext properly, you can find your solution here: https://github.com/EOSIO/eos/issues/2028

@69736c616d one more, can you run the following and paste the output here? which llvm-config llvm-config --has-rtti --version llc --version

pacificcode avatar May 13 '18 18:05 pacificcode

#2028 didnt work for me.

which llvm-config : /usr/local/bin/llvm-config

llvm-config --has-rtti --version YES 4.0.1

llc --version LLVM (http://llvm.org/): LLVM version 4.0.1 Optimized build. Default target: x86_64-apple-darwin17.5.0 Host CPU: sandybridge

Registered Targets: aarch64 - AArch64 (little endian) aarch64_be - AArch64 (big endian) amdgcn - AMD GCN GPUs arm - ARM arm64 - ARM64 (little endian) armeb - ARM (big endian) bpf - BPF (host endian) bpfeb - BPF (big endian) bpfel - BPF (little endian) hexagon - Hexagon lanai - Lanai mips - Mips mips64 - Mips64 [experimental] mips64el - Mips64el [experimental] mipsel - Mipsel msp430 - MSP430 [experimental] nvptx - NVIDIA PTX 32-bit nvptx64 - NVIDIA PTX 64-bit ppc32 - PowerPC 32 ppc64 - PowerPC 64 ppc64le - PowerPC 64 LE r600 - AMD GPUs HD2XXX-HD6XXX riscv32 - 32-bit RISC-V riscv64 - 64-bit RISC-V sparc - Sparc sparcel - Sparc LE sparcv9 - Sparc V9 systemz - SystemZ thumb - Thumb thumbeb - Thumb (big endian) x86 - 32-bit X86: Pentium-Pro and above x86-64 - 64-bit X86: EM64T and AMD64 xcore - XCore

69736c616d avatar May 13 '18 18:05 69736c616d

no more build error after latest commits.

69736c616d avatar May 17 '18 22:05 69736c616d

@69736c616d Great!

pacificcode avatar May 17 '18 22:05 pacificcode

I having the same issue on master branch Undefined symbols for architecture x86_64: "_libintl_bindtextdomain", referenced from: _main in main.cpp.o "_libintl_gettext", referenced from: eosio::client::localize::localized_with_variant(char const*, fc::variant_object const&) in main.cpp.o eosio::client::localize::localized_with_variant(char const*, fc::variant_object const&) in help_text.cpp.o "_libintl_setlocale", referenced from: _main in main.cpp.o "_libintl_textdomain", referenced from: _main in main.cpp.o ld: symbol(s) not found for architecture x86_64 clang-4.0: error: linker command failed with exit code 1 (use -v to see invocation) make[2]: *** [programs/cleos/cleos] Error 1 make[1]: *** [programs/cleos/CMakeFiles/cleos.dir/all] Error 2 make[1]: *** Waiting for unfinished jobs.... [ 98%] Building CXX object unittests/CMakeFiles/unit_test.dir/multi_index_tests.cpp.o [ 98%] Building CXX object unittests/CMakeFiles/unit_test.dir/multisig_tests.cpp.o [ 98%] Building CXX object unittests/CMakeFiles/unit_test.dir/payloadless_tests.cpp.o [ 98%] Building CXX object unittests/CMakeFiles/unit_test.dir/producer_schedule_tests.cpp.o [ 98%] Building CXX object unittests/CMakeFiles/unit_test.dir/ram_tests.cpp.o [ 98%] Building CXX object unittests/CMakeFiles/unit_test.dir/resource_limits_test.cpp.o [ 98%] Building CXX object unittests/CMakeFiles/unit_test.dir/special_accounts_tests.cpp.o [ 98%] Building CXX object unittests/CMakeFiles/unit_test.dir/tic_tac_toe_tests.cpp.o [ 98%] Building CXX object unittests/CMakeFiles/unit_test.dir/wasm_tests.cpp.o [ 98%] Building CXX object unittests/CMakeFiles/unit_test.dir/whitelist_blacklist_tests.cpp.o [ 98%] Linking CXX executable unit_test [ 98%] Built target unit_test make: *** [all] Error 2

>>>>>>>>>>>>>>>>>>>> MAKE building EOSIO has exited with the above error.

prolands avatar Aug 15 '18 14:08 prolands

@prolands getting same error on master

lux1992 avatar Aug 26 '18 12:08 lux1992

I am on mac and still get this error after trying the above steps. I tried v1.1.2 and v.1.1.6 no luck

JackDiSalvatore avatar Aug 26 '18 22:08 JackDiSalvatore

+1

ecavalcanti avatar Aug 27 '18 01:08 ecavalcanti

+1

PierreLeduc avatar Aug 27 '18 20:08 PierreLeduc

in my mac seirra, reinstalling gettext helped. brew reinstall gettext brew unlink gettext && brew link gettext --force --overwrite

thaonguyentien avatar Oct 04 '18 13:10 thaonguyentien