[llvm-dev] What's wrong? llvm-cfi-verify: undefined ref to LLVMInitializeMOS6502AsmParser

Robert Baruch via llvm-dev
2019-01-13T18:41:04Z

Hi all,

I'm just working on a backend, trying to follow the excellent presentation
given by Alex Bradbury here: https://www.youtube.com/watch?v=AFaIP-dF-RA

Basically stubbing out whatever I can. When I compile, I get this problem:

$ cmake -G Ninja -DCMAKE_BUILD_TYPE=Release
-DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD="RISCV;MOS6502" <dir to
llvm>

$ ninja

....

[1/1290] Linking CXX executable bin/llvm-cfi-verify
FAILED: bin/llvm-cfi-verify
: && /usr/bin/c++  -fPIC -fvisibility-inlines-hidden -Werror=date-time
-std=c++11 -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual
-Wno-missing-field-initializers -pedantic -Wno-long-long
-Wimplicit-fallthrough -Wno-maybe-uninitialized -Wno-class-memaccess
-Wno-noexcept-type -Wdelete-non-virtual-dtor -Wno-comment
-fdiagnostics-color -ffunction-sections -fdata-sections -O3 -DNDEBUG
-Wl,-allow-shlib-undefined
-Wl,-rpath-link,/home/robertbaruch/llvm6502-build/./lib  -Wl,-O3
-Wl,--gc-sections
tools/llvm-cfi-verify/CMakeFiles/llvm-cfi-verify.dir/llvm-cfi-verify.cpp.o
-o bin/llvm-cfi-verify  -Wl,-rpath,"\$ORIGIN/../lib"
lib/libLLVMAArch64AsmPrinter.a lib/libLLVMAMDGPUAsmPrinter.a
lib/libLLVMARMAsmPrinter.a lib/libLLVMBPFAsmPrinter.a
lib/libLLVMLanaiAsmPrinter.a lib/libLLVMMipsAsmPrinter.a
lib/libLLVMMSP430AsmPrinter.a lib/libLLVMNVPTXAsmPrinter.a
lib/libLLVMPowerPCAsmPrinter.a lib/libLLVMSparcAsmPrinter.a
lib/libLLVMSystemZAsmPrinter.a lib/libLLVMWebAssemblyAsmPrinter.a
lib/libLLVMX86AsmPrinter.a lib/libLLVMXCoreAsmPrinter.a
lib/libLLVMRISCVAsmPrinter.a lib/libLLVMAArch64AsmParser.a
lib/libLLVMAMDGPUAsmParser.a lib/libLLVMARMAsmParser.a
lib/libLLVMBPFAsmParser.a lib/libLLVMHexagonAsmParser.a
lib/libLLVMLanaiAsmParser.a lib/libLLVMMipsAsmParser.a
lib/libLLVMMSP430AsmParser.a lib/libLLVMPowerPCAsmParser.a
lib/libLLVMSparcAsmParser.a lib/libLLVMSystemZAsmParser.a
lib/libLLVMWebAssemblyAsmParser.a lib/libLLVMX86AsmParser.a
lib/libLLVMRISCVAsmParser.a lib/libLLVMAArch64Desc.a
lib/libLLVMAMDGPUDesc.a lib/libLLVMARMDesc.a lib/libLLVMBPFDesc.a
lib/libLLVMHexagonDesc.a lib/libLLVMLanaiDesc.a lib/libLLVMMipsDesc.a
lib/libLLVMMSP430Desc.a lib/libLLVMNVPTXDesc.a lib/libLLVMPowerPCDesc.a
lib/libLLVMSparcDesc.a lib/libLLVMSystemZDesc.a
lib/libLLVMWebAssemblyDesc.a lib/libLLVMX86Desc.a lib/libLLVMXCoreDesc.a
lib/libLLVMRISCVDesc.a lib/libLLVMMOS6502Desc.a
lib/libLLVMAArch64Disassembler.a lib/libLLVMAMDGPUDisassembler.a
lib/libLLVMARMDisassembler.a lib/libLLVMBPFDisassembler.a
lib/libLLVMHexagonDisassembler.a lib/libLLVMLanaiDisassembler.a
lib/libLLVMMipsDisassembler.a lib/libLLVMMSP430Disassembler.a
lib/libLLVMPowerPCDisassembler.a lib/libLLVMSparcDisassembler.a
lib/libLLVMSystemZDisassembler.a lib/libLLVMWebAssemblyDisassembler.a
lib/libLLVMX86Disassembler.a lib/libLLVMXCoreDisassembler.a
lib/libLLVMRISCVDisassembler.a lib/libLLVMAArch64Info.a
lib/libLLVMAMDGPUInfo.a lib/libLLVMARMInfo.a lib/libLLVMBPFInfo.a
lib/libLLVMHexagonInfo.a lib/libLLVMLanaiInfo.a lib/libLLVMMipsInfo.a
lib/libLLVMMSP430Info.a lib/libLLVMNVPTXInfo.a lib/libLLVMPowerPCInfo.a
lib/libLLVMSparcInfo.a lib/libLLVMSystemZInfo.a
lib/libLLVMWebAssemblyInfo.a lib/libLLVMX86Info.a lib/libLLVMXCoreInfo.a
lib/libLLVMRISCVInfo.a lib/libLLVMMOS6502Info.a lib/libLLVMMC.a
lib/libLLVMMCParser.a lib/libLLVMObject.a lib/libLLVMSupport.a
lib/libLLVMSymbolize.a -lpthread lib/libLLVMCFIVerify.a
lib/libLLVMBPFAsmPrinter.a lib/libLLVMMipsAsmPrinter.a
lib/libLLVMMSP430AsmPrinter.a lib/libLLVMPowerPCAsmPrinter.a
lib/libLLVMSparcAsmPrinter.a lib/libLLVMX86AsmPrinter.a
lib/libLLVMX86Utils.a lib/libLLVMRISCVAsmPrinter.a lib/libLLVMRISCVUtils.a
lib/libLLVMNVPTXAsmPrinter.a lib/libLLVMWebAssemblyAsmPrinter.a
lib/libLLVMXCoreAsmPrinter.a lib/libLLVMAArch64Desc.a
lib/libLLVMAArch64AsmPrinter.a lib/libLLVMAArch64Info.a
lib/libLLVMAArch64Utils.a lib/libLLVMAMDGPUDesc.a
lib/libLLVMAMDGPUAsmPrinter.a lib/libLLVMAMDGPUInfo.a
lib/libLLVMAMDGPUUtils.a lib/libLLVMARMDesc.a lib/libLLVMARMAsmPrinter.a
lib/libLLVMARMInfo.a lib/libLLVMARMUtils.a lib/libLLVMHexagonDesc.a
lib/libLLVMHexagonInfo.a lib/libLLVMLanaiDesc.a
lib/libLLVMLanaiAsmPrinter.a lib/libLLVMLanaiInfo.a
lib/libLLVMSystemZDesc.a lib/libLLVMSystemZAsmPrinter.a
lib/libLLVMSystemZInfo.a lib/libLLVMMCDisassembler.a lib/libLLVMSymbolize.a
lib/libLLVMDebugInfoPDB.a lib/libLLVMDebugInfoDWARF.a lib/libLLVMObject.a
lib/libLLVMMCParser.a lib/libLLVMMC.a lib/libLLVMDebugInfoCodeView.a
lib/libLLVMDebugInfoMSF.a lib/libLLVMBitReader.a lib/libLLVMCore.a
lib/libLLVMBinaryFormat.a lib/libLLVMSupport.a -lrt -ldl -lpthread -lm
lib/libLLVMDemangle.a && :
/usr/bin/ld:
tools/llvm-cfi-verify/CMakeFiles/llvm-cfi-verify.dir/llvm-cfi-verify.cpp.o:
in function `main':
llvm-cfi-verify.cpp:(.text.startup.main+0x12c): undefined reference to
`LLVMInitializeMOS6502AsmParser'
collect2: error: ld returned 1 exit status

Now, I'm positive I've defined LLVMInitializeMOS6502AsmParser, it's
in
MOS6502AsmParser.cpp. I must have missed something in an LLVMBuild or
CMakeFiles file. Here's the patch. Can anyone figure this out?

Thanks!

--Rob
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://lists.llvm.org/pipermail/llvm-dev/attachments/20190113/ef215842/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mos6502.patch.gz
Type: application/x-gzip
Size: 12396 bytes
Desc: not available
URL:
<http://lists.llvm.org/pipermail/llvm-dev/attachments/20190113/ef215842/attachment-0001.bin>