[cfe-dev] Linking clang on linux
Eli Bendersky
eliben at google.com
Thu Jun 12 10:35:10 PDT 2014
On Thu, Jun 12, 2014 at 9:50 AM, Reid Kleckner <rnk at google.com> wrote:
> It sounds like the order of libraries passed to the linker is incorrect.
> The inputs have to be sorted topologically, where each library appears
> before all of its dependencies.
>
> Alternatively you can use --start-group ... --end-group to make it search
> out of order, but that shouldn't be necessary.
>
I *think* there were circular deps that require specifying some libs
multiple times. FWIW, the Makefile in my LLVM & Clang samples repo (
https://github.com/eliben/llvm-clang-samples/blob/master/Makefile) uses
groups and it works great. It has proven much easier to maintain than
following Clang's library deps (that kept breaking every month or so :-/)
Eli
>
>
> On Thu, Jun 12, 2014 at 6:58 AM, Kim <soldoutseashell at gmail.com> wrote:
>
>> I'm trying to get my project (which uses clang) to build on linux and I'm
>> running into a unresolved symbol error while loading one of the modules:
>>
>> undefined symbol: _ZN5clang11ASTConsumer21HandleInterestingDeclENS_
>> 12DeclGroupRefE
>>
>> Searching for the symbol in the clang/LLVM libraries indicates the symbol
>> resides in libclangAST.a:
>>
>> ./libclangAST.a
>> 0000000000000000 T _ZN5clang11ASTConsumer21HandleInterestingDeclENS_
>> 12DeclGroupRefE
>>
>> I'm already linking libclangAST.a into my project so I'm wondering what
>> I'm missing or what the problem could be otherwise:
>>
>> LLVMLIBS = libLLVMProfileData.a libLLVMCppBackendCodeGen.a
>> libLLVMX86CodeGen.a libLLVMX86AsmParser.a libLLVMX86Disassembler.a
>> libLLVMBitWriter.a libLLVMIRReader.a libLLVMInstrumentation.a libLLVMipo.a
>> libLLVMLinker.a libLLVMCppBackendInfo.a libLLVMX86Desc.a libLLVMXCoreDesc.a
>> libLLVMAsmParser.a libLLVMBitReader.a libLLVMVectorize.a
>> libLLVMAsmPrinter.a libLLVMSelectionDAG.a libLLVMMipsAsmPrinter.a
>> libLLVMMipsInfo.a libLLVMX86AsmPrinter.a libLLVMX86Info.a libLLVMMCParser.a
>> libLLVMCodeGen.a libLLVMX86Utils.a libLLVMObjCARCOpts.a libLLVMScalarOpts.a
>> libLLVMInstCombine.a libLLVMTransformUtils.a libLLVMipa.a libLLVMAnalysis.a
>> libLLVMTarget.a libLLVMCore.a libLLVMMC.a libLLVMObject.a libLLVMSupport.a
>> libclangFrontendTool.a libclangAST.a libclangAnalysis.a libclangBasic.a
>> libclangCodeGen.a libclangDriver.a libclangEdit.a libclangFrontend.a
>> libclangLex.a libclangParse.a libclangSema.a libclangSerialization.a
>> libclangStaticAnalyzerFrontend.a libclangStaticAnalyzerCheckers.a
>> libclangStaticAnalyzerCore.a libclangARCMigrate.a libclangRewriteCore.a
>> libclangRewriteFrontend.a libLLVMOption.a
>>
>> Thanks a lot
>>
>>
>>
>> _______________________________________________
>> cfe-dev mailing list
>> cfe-dev at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>>
>
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20140612/f25d6838/attachment.html>
More information about the cfe-dev
mailing list