<div dir="ltr">Hi all,<div><br></div><div>I've got the following link error</div><div><br></div><div><div>FAILED: : && /usr/bin/c++   -fPIC -fvisibility-inlines-hidden -Wall -W -Wno-unused-parameter -Wwrite-strings -Wno-missing-field-initializers -pedantic -Wno-long-long -Wno-maybe-uninitialized -Wnon-virtual-dtor -Wno-comment -std=c++11 -ffunction-sections -fdata-sections -O3  -Wl,--export-dynamic tools/opt/CMakeFiles/opt.dir/AnalysisWrappers.cpp.o tools/opt/CMakeFiles/opt.dir/BreakpointPrinter.cpp.o tools/opt/CMakeFiles/opt.dir/GraphPrinters.cpp.o tools/opt/CMakeFiles/opt.dir/NewPMDriver.cpp.o tools/opt/CMakeFiles/opt.dir/Passes.cpp.o tools/opt/CMakeFiles/opt.dir/PassPrinters.cpp.o tools/opt/CMakeFiles/opt.dir/PrintSCC.cpp.o tools/opt/CMakeFiles/opt.dir/opt.cpp.o  -o bin/opt  lib/libLLVMX86CodeGen.so lib/libLLVMX86AsmPrinter.so lib/libLLVMX86AsmParser.so lib/libLLVMX86Desc.so lib/libLLVMX86Info.so lib/libLLVMX86Disassembler.so lib/libLLVMNVPTXCodeGen.so lib/libLLVMNVPTXAsmPrinter.so lib/libLLVMNVPTXDesc.so lib/libLLVMNVPTXInfo.so lib/libLLVMAnalysis.so lib/libLLVMBitWriter.so lib/libLLVMCodeGen.so lib/libLLVMCore.so lib/libLLVMipa.so lib/libLLVMipo.so lib/libLLVMIRReader.so lib/libLLVMInstCombine.so lib/libLLVMInstrumentation.so lib/libLLVMMC.so lib/libLLVMObjCARCOpts.so lib/libLLVMScalarOpts.so lib/libLLVMSupport.so lib/libLLVMTarget.so lib/libLLVMTransformUtils.so lib/libLLVMVectorize.so lib/libLLVMX86AsmPrinter.so lib/libLLVMX86Utils.so lib/libLLVMObject.so lib/libLLVMX86Info.so lib/libLLVMNVPTXAsmPrinter.so lib/libLLVMAsmPrinter.so lib/libLLVMMCParser.so lib/libLLVMSelectionDAG.so lib/libLLVMCodeGen.so lib/libLLVMScalarOpts.so lib/libLLVMInstCombine.so lib/libLLVMAsmParser.so lib/libLLVMBitReader.so lib/libLLVMTransformUtils.so lib/libLLVMipa.so lib/libLLVMAnalysis.so lib/libLLVMTarget.so lib/libLLVMCore.so lib/libLLVMMC.so lib/libLLVMSupport.so -lrt -ldl -lcurses -lpthread -lz -Wl,-rpath,"\$ORIGIN/../lib" && :</div>
<div>tools/opt/CMakeFiles/opt.dir/opt.cpp.o: In function `llvm::cl::list<llvm::PassInfo const*, bool, llvm::PassNameParser>::getExtraOptionNames(llvm::SmallVectorImpl<char const*>&)':</div><div>opt.cpp:(.text._ZN4llvm2cl4listIPKNS_8PassInfoEbNS_14PassNameParserEE19getExtraOptionNamesERNS_15SmallVectorImplIPKcEE[_ZN4llvm2cl4listIPKNS_8PassInfoEbNS_14PassNameParserEE19getExtraOptionNamesERNS_15SmallVectorImplIPKcEE]+0x56): undefined reference to `llvm::cl::parser<llvm::PassInfo const*>::getOption(unsigned int) const'</div>
<div>collect2: error: ld returned 1 exit status</div><div>[8/717] Linking CXX executable bin/bugpoint</div><div>FAILED: : && /usr/bin/c++   -fPIC -fvisibility-inlines-hidden -Wall -W -Wno-unused-parameter -Wwrite-strings -Wno-missing-field-initializers -pedantic -Wno-long-long -Wno-maybe-uninitialized -Wnon-virtual-dtor -Wno-comment -std=c++11 -ffunction-sections -fdata-sections -O3  -Wl,--export-dynamic tools/bugpoint/CMakeFiles/bugpoint.dir/BugDriver.cpp.o tools/bugpoint/CMakeFiles/bugpoint.dir/CrashDebugger.cpp.o tools/bugpoint/CMakeFiles/bugpoint.dir/ExecutionDriver.cpp.o tools/bugpoint/CMakeFiles/bugpoint.dir/ExtractFunction.cpp.o tools/bugpoint/CMakeFiles/bugpoint.dir/FindBugs.cpp.o tools/bugpoint/CMakeFiles/bugpoint.dir/Miscompilation.cpp.o tools/bugpoint/CMakeFiles/bugpoint.dir/OptimizerDriver.cpp.o tools/bugpoint/CMakeFiles/bugpoint.dir/ToolRunner.cpp.o tools/bugpoint/CMakeFiles/bugpoint.dir/bugpoint.cpp.o  -o bin/bugpoint  lib/libLLVMAnalysis.so lib/libLLVMBitWriter.so lib/libLLVMCodeGen.so lib/libLLVMCore.so lib/libLLVMipa.so lib/libLLVMipo.so lib/libLLVMIRReader.so lib/libLLVMInstCombine.so lib/libLLVMInstrumentation.so lib/libLLVMLinker.so lib/libLLVMObjCARCOpts.so lib/libLLVMScalarOpts.so lib/libLLVMSupport.so lib/libLLVMTarget.so lib/libLLVMTransformUtils.so lib/libLLVMVectorize.so lib/libLLVMInstCombine.so lib/libLLVMAsmParser.so lib/libLLVMBitReader.so lib/libLLVMTransformUtils.so lib/libLLVMipa.so lib/libLLVMAnalysis.so lib/libLLVMTarget.so lib/libLLVMCore.so lib/libLLVMMC.so lib/libLLVMSupport.so -lrt -ldl -lcurses -lpthread -lz -Wl,-rpath,"\$ORIGIN/../lib" && :</div>
<div>tools/bugpoint/CMakeFiles/bugpoint.dir/bugpoint.cpp.o: In function `llvm::cl::list<llvm::PassInfo const*, bool, llvm::PassNameParser>::getExtraOptionNames(llvm::SmallVectorImpl<char const*>&)':</div>
<div>bugpoint.cpp:(.text._ZN4llvm2cl4listIPKNS_8PassInfoEbNS_14PassNameParserEE19getExtraOptionNamesERNS_15SmallVectorImplIPKcEE[_ZN4llvm2cl4listIPKNS_8PassInfoEbNS_14PassNameParserEE19getExtraOptionNamesERNS_15SmallVectorImplIPKcEE]+0x76): undefined reference to `llvm::cl::parser<llvm::PassInfo const*>::getOption(unsigned int) const'</div>
<div>collect2: error: ld returned 1 exit status</div><div><br></div><div><br></div><div>Here's how I configured</div><div><br></div><div><div>cmake -G Ninja \</div><div>    -DCMAKE_INSTALL_PREFIX:PATH=/usr \</div><div>
    -DCMAKE_BUILD_TYPE:STRING="Release" \</div><div>    -DBUILD_SHARED_LIBS:BOOL=ON \</div><div>    -DLLVM_TARGETS_TO_BUILD:STRING="X86;NVPTX" \</div><div>    -DLLVM_BINUTILS_INCDIR:PATH=/usr/include \</div>
<div>    -DLLVM_BUILD_RUNTIME:BOOL=ON \</div><div>    -DLLVM_BUILD_TESTS:BOOL=ON \</div><div>    -DLLVM_BUILD_TOOLS:BOOL=ON \</div><div>    -DLLVM_INCLUDE_TESTS:BOOL=ON \</div><div>    -DLLVM_INCLUDE_TOOLS:BOOL=ON \</div>
<div>    -DLLVM_ENABLE_CXX1Y:BOOL=OFF \</div><div>    -DLLVM_ENABLE_LIBCXX:BOOL=ON \</div><div>    -DLLVM_ENABLE_THREADS:BOOL=ON \</div><div>    -DLLVM_ENABLE_FFI:BOOL=ON \</div><div>    -DLLVM_ENABLE_ASSERTIONS:BOOL=ON \</div>
<div>    -DLLVM_ENABLE_WARNINGS:BOOL=ON \</div><div>    -DLLVM_ENABLE_WERROR:BOOL=OFF \</div><div>    -DLLVM_ENABLE_SPHINX:BOOL=ON \</div><div>    -DLLVM_ENABLE_TERMINFO:BOOL=ON \</div><div>    -DLLVM_ENABLE_ZLIB:BOOL=ON \</div>
<div>    -DCLANG_INCLUDE_TESTS:BOOL=ON \</div><div>    -DLIBCLANG_BUILD_STATIC:BOOL=OFF \</div><div>    -DCOMPILER_RT_BUILD_SHARED_ASAN:BOOL=ON \</div><div>    -DCOMPILER_RT_CAN_EXECUTE_TESTS:BOOL=ON \</div><div>    -DCOMPILER_RT_INCLUDE_TESTS:BOOL=ON \</div>
<div>    -DLIBCXX_ENABLE_ASSERTIONS:BOOL=ON \</div><div>    -DLIBCXX_ENABLE_PEDANTIC:BOOL=ON \</div><div>    -DLIBCXX_ENABLE_WERROR:BOOL=OFF \</div><div>    -DLIBCXX_ENABLE_SHARED:BOOL=ON \</div><div>    -DLIBCXX_ENABLE_CXX0X:BOOL=OFF \</div>
<div>    -DFFI_INCLUDE_DIR:PATH=`pkg-config --variable=includedir libffi` \</div><div>    -DFFI_LIBRARY_DIR:PATH=`pkg-config --variable=libdir libffi` \</div><div>    -DPYTHON_EXECUTABLE:FILEPATH=/usr/bin/python \</div><div>
    ../llvm.src</div></div></div><div><br></div><div>Please note that clang from trunk works fine.</div><div><br></div><div>Thanks!</div><div><br></div><div>Ryuta Suzuki</div></div>