Closed Martinfx closed 6 years ago
Can you build the official LLVM https://github.com/llvm-mirror/llvm ?
@yrnkrn FreeBSD have official LLVM build https://www.freshports.org/devel/llvm50/ FreeBSD clang version 4.0.0 (tags/RELEASE_400/final 297347) (based on LLVM 4.0.0) Target: x86_64-unknown-freebsd11.1 Thread model: posix
Does f78575158bdf7a5133e8f33980c21c6ea58aa485 fix the link errors?
@yrnkrn Little but still last error
0.0svn lib/libLLVMXCoreDisassembler.so.5.0.0svn lib/libLLVMXCoreInfo.so.5.0.0svn lib/libLLVMAnalysis.so.5.0.0svn lib/libLLVMAsmPrinter.so.5.0.0svn lib/libLLVMBitWriter.so.5.0.0svn lib/libLLVMCodeGen.so.5.0.0svn lib/libLLVMCore.so.5.0.0svn lib/libLLVMSupport.so.5.0.0svn lib/libLLVMMC.so.5.0.0svn -lpthread -lpthread lib/libclangAST.so.5.0.0svn lib/libclangBasic.so.5.0.0svn lib/libclangCodeGen.so.5.0.0svn lib/libclangDriver.so.5.0.0svn lib/libclangEdit.so.5.0.0svn lib/libclangFrontend.so.5.0.0svn lib/libclangFrontendTool.so.5.0.0svn lib/libclangLex.so.5.0.0svn lib/libclangParse.so.5.0.0svn lib/libclangSema.so.5.0.0svn && :
/usr/bin/ld.lld: error: /FreeBSD-Ports/zapcc/work/zapcc-b4c31cc/tools/zapccs/UnloaderIR.cpp:(function clang::Unloader::VisitNamedDecl(clang::NamedDecl*)): undefined symbol 'clang::serialization::isRedeclarableDeclKind(unsigned int)'
c++: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.
==
Could you quote the whole command line, from FAILED:
?
@yrnkrn I am sorry this is whole line
FAILED: bin/zapccs
: && /usr/bin/c++ -O2 -pipe -fstack-protector -fno-strict-aliasing -fPIC -fvisibility-inlines-hidden
-std=c++1y -w -fcolor-diagnostics -ffunction-sections -fdata-sections -fno-common -Woverloaded-
virtual -fno-strict-aliasing -pedantic -O2 -pipe -fstack-protector -fno-strict-aliasing -fstack-protector
-fuse-ld=lld -Wl,-color-diagnostics -Wl,-allow-shlib-undefined -Wl,-z,origin -Wl,-O3 -Wl,--gc-sections
tools/zapccs/CMakeFiles/zapccs.dir/CachingCompiler.cpp.o tools/zapccs/CMakeFiles/zapccs.dir
/CachingPassManager.cpp.o tools/zapccs/CMakeFiles/zapccs.dir/CommandLine.cpp.o tools/zapccs
/CMakeFiles/zapccs.dir/DebugInfoScanner.cpp.o tools/zapccs/CMakeFiles/zapccs.dir/Demangle.cpp.o
tools/zapccs/CMakeFiles/zapccs.dir/DemangleGoogle.cpp.o tools/zapccs/CMakeFiles/zapccs.dir
/DependencyMap.cpp.o tools/zapccs/CMakeFiles/zapccs.dir/DisableStreamsBuffering.cpp.o
tools/zapccs/CMakeFiles/zapccs.dir/FindOption.cpp.o tools/zapccs/CMakeFiles/zapccs.dir
/GetExePath.cpp.o tools/zapccs/CMakeFiles/zapccs.dir/GetMemoryUsage.cpp.o tools/zapccs
/CMakeFiles/zapccs.dir/Getters.cpp.o tools/zapccs/CMakeFiles/zapccs.dir
/raw_colored_svector_ostream.cpp.o tools/zapccs/CMakeFiles/zapccs.dir/ReplaceDeclInMap.cpp.o
tools/zapccs/CMakeFiles/zapccs.dir/Server.cpp.o tools/zapccs/CMakeFiles/zapccs.dir/StopWatch.cpp.o
tools/zapccs/CMakeFiles/zapccs.dir/StringConst.cpp.o tools/zapccs/CMakeFiles/zapccs.dir
/TextFile.cpp.o tools/zapccs/CMakeFiles/zapccs.dir/Unload.cpp.o tools/zapccs/CMakeFiles/zapccs.dir
/Unloader.cpp.o tools/zapccs/CMakeFiles/zapccs.dir/UnloaderDI.cpp.o tools/zapccs/CMakeFiles
/zapccs.dir/UnloaderIR.cpp.o tools/zapccs/CMakeFiles/zapccs.dir/UnloaderMP.cpp.o tools/zapccs
/CMakeFiles/zapccs.dir/UnloadSelector.cpp.o tools/zapccs/CMakeFiles/zapccs.dir/UserReplacer.cpp.o
tools/zapccs/CMakeFiles/zapccs.dir/ZapccConfig.cpp.o tools/zapccs/CMakeFiles/zapccs.dir
/ZapccsMain.cpp.o -o bin/zapccs -L/usr/local/lib -Wl,-rpath,"\$ORIGIN/../lib:/usr/local/lib"
lib/libLLVMAArch64CodeGen.so.5.0.0svn lib/libLLVMAArch64AsmPrinter.so.5.0.0svn
lib/libLLVMAArch64AsmParser.so.5.0.0svn lib/libLLVMAArch64Desc.so.5.0.0svn
lib/libLLVMAArch64Disassembler.so.5.0.0svn lib/libLLVMAArch64Info.so.5.0.0svn
lib/libLLVMAArch64Utils.so.5.0.0svn lib/libLLVMAMDGPUCodeGen.so.5.0.0svn
lib/libLLVMAMDGPUAsmPrinter.so.5.0.0svn lib/libLLVMAMDGPUAsmParser.so.5.0.0svn
lib/libLLVMAMDGPUDesc.so.5.0.0svn lib/libLLVMAMDGPUDisassembler.so.5.0.0svn lib/libLLVMAMDGPUInfo.so.5.0.0svn lib/libLLVMAMDGPUUtils.so.5.0.0svn lib/libLLVMARMCodeGen.so.5.0.0svn lib/libLLVMARMAsmPrinter.so.5.0.0svn lib/libLLVMARMAsmParser.so.5.0.0svn lib/libLLVMARMDesc.so.5.0.0svn lib/libLLVMARMDisassembler.so.5.0.0svn lib/libLLVMARMInfo.so.5.0.0svn lib/libLLVMBPFCodeGen.so.5.0.0svn lib/libLLVMBPFAsmPrinter.so.5.0.0svn lib/libLLVMBPFDesc.so.5.0.0svn lib/libLLVMBPFDisassembler.so.5.0.0svn lib/libLLVMBPFInfo.so.5.0.0svn lib/libLLVMHexagonCodeGen.so.5.0.0svn lib/libLLVMHexagonAsmParser.so.5.0.0svn lib/libLLVMHexagonDesc.so.5.0.0svn lib/libLLVMHexagonDisassembler.so.5.0.0svn lib/libLLVMHexagonInfo.so.5.0.0svn lib/libLLVMLanaiCodeGen.so.5.0.0svn lib/libLLVMLanaiAsmPrinter.so.5.0.0svn lib/libLLVMLanaiAsmParser.so.5.0.0svn lib/libLLVMLanaiDesc.so.5.0.0svn lib/libLLVMLanaiDisassembler.so.5.0.0svn lib/libLLVMLanaiInfo.so.5.0.0svn lib/libLLVMMipsCodeGen.so.5.0.0svn lib/libLLVMMipsAsmPrinter.so.5.0.0svn lib/libLLVMMipsAsmParser.so.5.0.0svn lib/libLLVMMipsDesc.so.5.0.0svn lib/libLLVMMipsDisassembler.so.5.0.0svn lib/libLLVMMipsInfo.so.5.0.0svn lib/libLLVMMSP430CodeGen.so.5.0.0svn lib/libLLVMMSP430AsmPrinter.so.5.0.0svn lib/libLLVMMSP430Desc.so.5.0.0svn lib/libLLVMMSP430Info.so.5.0.0svn lib/libLLVMNVPTXCodeGen.so.5.0.0svn lib/libLLVMNVPTXAsmPrinter.so.5.0.0svn lib/libLLVMNVPTXDesc.so.5.0.0svn lib/libLLVMNVPTXInfo.so.5.0.0svn lib/libLLVMPowerPCCodeGen.so.5.0.0svn lib/libLLVMPowerPCAsmPrinter.so.5.0.0svn lib/libLLVMPowerPCAsmParser.so.5.0.0svn lib/libLLVMPowerPCDesc.so.5.0.0svn lib/libLLVMPowerPCDisassembler.so.5.0.0svn lib/libLLVMPowerPCInfo.so.5.0.0svn lib/libLLVMRISCVCodeGen.so.5.0.0svn lib/libLLVMRISCVDesc.so.5.0.0svn lib/libLLVMRISCVInfo.so.5.0.0svn lib/libLLVMSparcCodeGen.so.5.0.0svn
lib/libLLVMSparcAsmPrinter.so.5.0.0svn lib/libLLVMSparcAsmParser.so.5.0.0svn
lib/libLLVMSparcDesc.so.5.0.0svn lib/libLLVMSparcDisassembler.so.5.0.0svn
lib/libLLVMSparcInfo.so.5.0.0svn lib/libLLVMSystemZCodeGen.so.5.0.0svn
lib/libLLVMSystemZAsmPrinter.so.5.0.0svn lib/libLLVMSystemZAsmParser.so.5.0.0svn
lib/libLLVMSystemZDesc.so.5.0.0svn lib/libLLVMSystemZDisassembler.so.5.0.0svn
lib/libLLVMSystemZInfo.so.5.0.0svn lib/libLLVMX86CodeGen.so.5.0.0svn
lib/libLLVMX86AsmPrinter.so.5.0.0svn lib/libLLVMX86AsmParser.so.5.0.0svn
lib/libLLVMX86Desc.so.5.0.0svn lib/libLLVMX86Disassembler.so.5.0.0svn
lib/libLLVMX86Info.so.5.0.0svn lib/libLLVMX86Utils.so.5.0.0svn lib/libLLVMXCoreCodeGen.so.5.0.0svn
lib/libLLVMXCoreAsmPrinter.so.5.0.0svn lib/libLLVMXCoreDesc.so.5.0.0svn
lib/libLLVMXCoreDisassembler.so.5.0.0svn lib/libLLVMXCoreInfo.so.5.0.0svn
lib/libLLVMAnalysis.so.5.0.0svn lib/libLLVMAsmPrinter.so.5.0.0svn lib/libLLVMBitWriter.so.5.0.0svn
lib/libLLVMCodeGen.so.5.0.0svn lib/libLLVMCore.so.5.0.0svn lib/libLLVMSupport.so.5.0.0svn
lib/libLLVMMC.so.5.0.0svn -lpthread -lpthread lib/libclangAST.so.5.0.0svn lib/libclangBasic.so.5.0.0svn
lib/libclangCodeGen.so.5.0.0svn lib/libclangDriver.so.5.0.0svn lib/libclangEdit.so.5.0.0svn
lib/libclangFrontend.so.5.0.0svn lib/libclangFrontendTool.so.5.0.0svn lib/libclangLex.so.5.0.0svn lib/libclangParse.so.5.0.0svn lib/libclangSema.so.5.0.0svn && :
/usr/bin/ld.lld: error: /zapcc/work/zapcc-b4c31cc/tools/zapccs/UnloaderIR.cpp:(function clang::Unloader::VisitNamedDecl(clang::NamedDecl*)): undefined symbol 'clang::serialization::isRedeclarableDeclKind(unsigned int)'
c++: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.
===> Compilation failed unexpectedly.
Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to
the maintainer.
libclangSerialization.so.5.0.0svn
is still missing from the link command, although it does appear in CMakeLists.txt
. This is odd since the other two LLVM libs added libLLVMBitWriter.so.5.0.0svn
and libLLVMAsmPrinter.so.5.0.0svn
are in the link command.
Was this a clean build?
If not, please try clean build to force CMake to update the link command.
Thank you for your patch. I cleaned build and it works last build. Thank you @yrnkrn. M.
Hello i am porting this compiler from commit b4c31cc but i have problem with undefinded symbol this is cmake setting for port on FreeBSD https://github.com/Martinfx/FreeBSD-Ports/blob/c06430e8df53e68716fd54d9ea7ab9847c2d719a/zapcc/Makefile