Skip to content

Link order of Clang's Libraries

loarabia edited this page Sep 8, 2012 · 1 revision

This trick should work for nearly any make based build.

  1. Build Clang
  2. Go into the bin directory you just build (something like /buildroot/Debug+Asserts/bin)
  3. Delete the clang binary you'll find there
  4. Run a make dry run from your build root (make -n)
  5. Look for the line where the LLVM Build system is rebuilding clang (something like echo llvm[4]: Linking Debug+Asserts executable clang )
  6. The list of libraries will be contained in the next few lines below that.

As of the current writing (during clang 3.2) this list is:

-lclangFrontendTool -lclangFrontend -lclangDriver -lclangSerialization -lclangCodeGen
-lclangParse -lclangSema -lclangStaticAnalyzerFrontend -lclangStaticAnalyzerCheckers
-lclangStaticAnalyzerCore -lclangAnalysis -lclangARCMigrate -lclangRewriteFrontend -lclangRewriteCore
-lclangEdit -lclangAST -lclangLex -lclangBasic
Clone this wiki locally