question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

link error when building

See original GitHub issue

I installed LLVM 4.0.1 from source, and attempted to build llvmlite (from git). Looks like quite the linker incantation, I hope we can figure this one out.


$ python setup.py build
/usr/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'install_requires'
  warnings.warn(msg)
running build
got version from VCS {'version': '0.19.0', 'full': 'c3f10e3a2b75a0b44ce74a2c07c8299fc7e50b82'}
running build_py
running build_ext
building 'llvmlite.binding._stub' extension
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c llvmlite/binding/_stub.c -o build/temp.linux-x86_64-2.7/llvmlite/binding/_stub.o
x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wl,-Bsymbolic-functions -Wl,-z,relro -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security build/temp.linux-x86_64-2.7/llvmlite/binding/_stub.o -o build/lib.linux-x86_64-2.7/llvmlite/binding/_stub.so
/usr/bin/python /home/simon/local/llvmlite/ffi/build.py
LLVM version... 4.0.1

# static-libstdc++ avoids runtime dependencies on a
# particular libstdc++ version.
g++  -shared -I/usr/local/include -fPIC -fvisibility-inlines-hidden -Wall -W -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wno-maybe-uninitialized -Wdelete-non-virtual-dtor -Wno-comment -Werror=date-time -std=c++11 -g -fno-exceptions -fno-rtti -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -fno-rtti -g -flto assembly.cpp bitcode.cpp core.cpp initfini.cpp module.cpp value.cpp executionengine.cpp transforms.cpp passmanagers.cpp targets.cpp dylib.cpp linker.cpp object_file.cpp -o libllvmlite.so -L/usr/local/lib -flto -Wl,--exclude-libs=ALL -lLLVMLTO -lLLVMPasses -lLLVMObjCARCOpts -lLLVMMIRParser -lLLVMSymbolize -lLLVMDebugInfoPDB -lLLVMDebugInfoDWARF -lLLVMCoverage -lLLVMTableGen -lLLVMOrcJIT -lLLVMXCoreDisassembler -lLLVMXCoreCodeGen -lLLVMXCoreDesc -lLLVMXCoreInfo -lLLVMXCoreAsmPrinter -lLLVMSystemZDisassembler -lLLVMSystemZCodeGen -lLLVMSystemZAsmParser -lLLVMSystemZDesc -lLLVMSystemZInfo -lLLVMSystemZAsmPrinter -lLLVMSparcDisassembler -lLLVMSparcCodeGen -lLLVMSparcAsmParser -lLLVMSparcDesc -lLLVMSparcInfo -lLLVMSparcAsmPrinter -lLLVMRISCVDesc -lLLVMRISCVCodeGen -lLLVMRISCVInfo -lLLVMPowerPCDisassembler -lLLVMPowerPCCodeGen -lLLVMPowerPCAsmParser -lLLVMPowerPCDesc -lLLVMPowerPCInfo -lLLVMPowerPCAsmPrinter -lLLVMNVPTXCodeGen -lLLVMNVPTXDesc -lLLVMNVPTXInfo -lLLVMNVPTXAsmPrinter -lLLVMMSP430CodeGen -lLLVMMSP430Desc -lLLVMMSP430Info -lLLVMMSP430AsmPrinter -lLLVMMipsDisassembler -lLLVMMipsCodeGen -lLLVMMipsAsmParser -lLLVMMipsDesc -lLLVMMipsInfo -lLLVMMipsAsmPrinter -lLLVMLanaiDisassembler -lLLVMLanaiCodeGen -lLLVMLanaiAsmParser -lLLVMLanaiDesc -lLLVMLanaiInstPrinter -lLLVMLanaiInfo -lLLVMHexagonDisassembler -lLLVMHexagonCodeGen -lLLVMHexagonAsmParser -lLLVMHexagonDesc -lLLVMHexagonInfo -lLLVMBPFDisassembler -lLLVMBPFCodeGen -lLLVMBPFDesc -lLLVMBPFInfo -lLLVMBPFAsmPrinter -lLLVMARMDisassembler -lLLVMARMCodeGen -lLLVMARMAsmParser -lLLVMARMDesc -lLLVMARMInfo -lLLVMARMAsmPrinter -lLLVMAMDGPUDisassembler -lLLVMAMDGPUCodeGen -lLLVMAMDGPUAsmParser -lLLVMAMDGPUDesc -lLLVMAMDGPUInfo -lLLVMAMDGPUAsmPrinter -lLLVMAMDGPUUtils -lLLVMAArch64Disassembler -lLLVMAArch64CodeGen -lLLVMAArch64AsmParser -lLLVMAArch64Desc -lLLVMAArch64Info -lLLVMAArch64AsmPrinter -lLLVMAArch64Utils -lLLVMObjectYAML -lLLVMLibDriver -lLLVMOption -lLLVMX86Disassembler -lLLVMX86AsmParser -lLLVMX86CodeGen -lLLVMGlobalISel -lLLVMSelectionDAG -lLLVMAsmPrinter -lLLVMDebugInfoCodeView -lLLVMDebugInfoMSF -lLLVMX86Desc -lLLVMMCDisassembler -lLLVMX86Info -lLLVMX86AsmPrinter -lLLVMX86Utils -lLLVMMCJIT -lLLVMLineEditor -lLLVMInterpreter -lLLVMExecutionEngine -lLLVMRuntimeDyld -lLLVMCodeGen -lLLVMTarget -lLLVMCoroutines -lLLVMipo -lLLVMInstrumentation -lLLVMVectorize -lLLVMScalarOpts -lLLVMLinker -lLLVMIRReader -lLLVMAsmParser -lLLVMInstCombine -lLLVMTransformUtils -lLLVMBitWriter -lLLVMAnalysis -lLLVMObject -lLLVMMCParser -lLLVMMC -lLLVMBitReader -lLLVMProfileData -lLLVMCore -lLLVMSupport -lLLVMDemangle -lrt -ldl -lpthread -lz -lm

/usr/local/lib/libLLVMCore.a(Core.cpp.o): In function `LLVMGetDiagInfoDescription':
/home/simon/local/llvm-4.0.1.src/lib/IR/Core.cpp:184: undefined reference to `llvm::DiagnosticPrinterRawOStream::~DiagnosticPrinterRawOStream()'
/usr/local/lib/libLLVMCore.a(DiagnosticPrinter.cpp.o):(.data.rel.ro._ZTVN4llvm27DiagnosticPrinterRawOStreamE[_ZTVN4llvm27DiagnosticPrinterRawOStreamE]+0x10): undefined reference to `llvm::DiagnosticPrinterRawOStream::~DiagnosticPrinterRawOStream()'
/usr/local/lib/libLLVMCore.a(DiagnosticPrinter.cpp.o):(.data.rel.ro._ZTVN4llvm27DiagnosticPrinterRawOStreamE[_ZTVN4llvm27DiagnosticPrinterRawOStreamE]+0x18): undefined reference to `llvm::DiagnosticPrinterRawOStream::~DiagnosticPrinterRawOStream()'
/usr/local/lib/libLLVMCore.a(LLVMContext.cpp.o): In function `llvm::LLVMContext::diagnose(llvm::DiagnosticInfo const&)':
/home/simon/local/llvm-4.0.1.src/lib/IR/LLVMContext.cpp:208: undefined reference to `llvm::DiagnosticPrinterRawOStream::~DiagnosticPrinterRawOStream()'
collect2: error: ld returned 1 exit status
Makefile.linux:20: recipe for target 'libllvmlite.so' failed
make: *** [libllvmlite.so] Error 1

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:18 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
ChangXuSunnycommented, Nov 16, 2017

@punkdit Thanks very much. It works for me!

0reactions
sklamcommented, Oct 2, 2019

Latest llvmlite uses llvm8. This issue is obsoleted.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Resolving Compile and Link Errors - SocketTools
When you build your first C/C++ application using SocketTools, you may encounter compile or link errors. These are usually the result of the ......
Read more >
Understanding and fixing compiler and linker errors
Linker errors, unlike compiler errors, have nothing to do with incorrect syntax. Instead, linker errors are usually problems with finding the definitions for ......
Read more >
Linker error when building project - c++ - Stack Overflow
1 Answer 1 · The variables are declared in CWaveEditView.h, and I do #include it at the top of CWaveEditDoc. · Then I...
Read more >
Internal link error when compiling in Release mode
When I compile my DLL project in Release mode, I get the following linker error: 1>------ Erstellen gestartet: Projekt: K-Lib, Konfiguration: ReleaseMongo ...
Read more >
Linker failure when building using Visual Studio 2019
When I build my project using VS2019 I get the following linker errors: libpost.lib(sucfile.obj) : error LNK2019: unresolved external symbol ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found