Quuxplusone / LLVMBugzillaTest

0 stars 0 forks source link

llvm-config claims dependency on gtest #25087

Open Quuxplusone opened 9 years ago

Quuxplusone commented 9 years ago
Bugzilla Link PR25088
Status NEW
Importance P normal
Reported by Antoine Pitrou (pitrou@free.fr)
Reported on 2015-10-07 05:48:16 -0700
Last modified on 2015-12-09 04:27:45 -0800
Version 3.7
Hardware PC Linux
CC geek4civic@gmail.com, llvm-bugs@lists.llvm.org
Fixed by commit(s)
Attachments
Blocks
Blocked by
See also
I have built the release-37 branch using:

cmake -DCMAKE_BUILD_TYPE=Release -DLLVM_TARGETS_TO_BUILD=host \
      -DLLVM_INCLUDE_TESTS=OFF -DLLVM_INCLUDE_UTILS=OFF \
      -DLLVM_INCLUDE_DOCS=OFF -DLLVM_INCLUDE_EXAMPLES=OFF \
      -DLLVM_USE_OPROFILE=ON \
      ..

And llvm-config claims that the gtest library is necessary for linking against
LLVM:

$ ./bin/llvm-config --libs
-lLLVMLTO -lLLVMObjCARCOpts -lLLVMLinker -lLLVMipo -lLLVMVectorize -
lLLVMBitWriter -lgtest_main -lgtest -lLLVMTableGen -lLLVMDebugInfo -lLLVMOption
-lLLVMX86Disassembler -lLLVMX86AsmParser -lLLVMX86CodeGen -lLLVMSelectionDAG -
lLLVMAsmPrinter -lLLVMX86Desc -lLLVMMCDisassembler -lLLVMX86Info -
lLLVMX86AsmPrinter -lLLVMX86Utils -lLLVMMCJIT -lLLVMIRReader -lLLVMAsmParser -
lLLVMLineEditor -lLLVMInstrumentation -lLLVMInterpreter -lLLVMExecutionEngine -
lLLVMRuntimeDyld -lLLVMCodeGen -lLLVMScalarOpts -lLLVMProfileData -lLLVMObject -
lLLVMMCParser -lLLVMBitReader -lLLVMInstCombine -lLLVMTransformUtils -lLLVMipa -
lLLVMAnalysis -lLLVMTarget -lLLVMMC -lLLVMCore -lLLVMSupport

This doesn't seem right, especially as I explicitly disabled tests in the cmake
invocation. I would rather not have to install a third-party library to link
against LLVM.
Quuxplusone commented 9 years ago
Amusingly, this seems to depend on where llvm-config is run from.  If run
uninstalled, it includes a reference to gtest. If run installed, it doesn't (!).

$ sha1sum ./bin/llvm-config
763c2e5e7a20c3f2f73a4906fefb1a0506171566  ./bin/llvm-config
$ sha1sum /tmp/llvm-install/bin/llvm-config
763c2e5e7a20c3f2f73a4906fefb1a0506171566  /tmp/llvm-install/bin/llvm-config

$ ./bin/llvm-config --libs
-lLLVMLTO -lLLVMObjCARCOpts -lLLVMLinker -lLLVMipo -lLLVMVectorize -
lLLVMBitWriter -lgtest_main -lgtest -lLLVMTableGen -lLLVMDebugInfo -lLLVMOption
-lLLVMX86Disassembler -lLLVMX86AsmParser -lLLVMX86CodeGen -lLLVMSelectionDAG -
lLLVMAsmPrinter -lLLVMX86Desc -lLLVMMCDisassembler -lLLVMX86Info -
lLLVMX86AsmPrinter -lLLVMX86Utils -lLLVMMCJIT -lLLVMIRReader -lLLVMAsmParser -
lLLVMLineEditor -lLLVMInstrumentation -lLLVMInterpreter -lLLVMExecutionEngine -
lLLVMRuntimeDyld -lLLVMCodeGen -lLLVMScalarOpts -lLLVMProfileData -lLLVMObject -
lLLVMMCParser -lLLVMBitReader -lLLVMInstCombine -lLLVMTransformUtils -lLLVMipa -
lLLVMAnalysis -lLLVMTarget -lLLVMMC -lLLVMCore -lLLVMSupport

$ /tmp/llvm-install/bin/llvm-config --libs
-lLLVMLTO -lLLVMObjCARCOpts -lLLVMLinker -lLLVMipo -lLLVMVectorize -
lLLVMBitWriter -lLLVMTableGen -lLLVMDebugInfo -lLLVMOption -
lLLVMX86Disassembler -lLLVMX86AsmParser -lLLVMX86CodeGen -lLLVMSelectionDAG -
lLLVMAsmPrinter -lLLVMX86Desc -lLLVMMCDisassembler -lLLVMX86Info -
lLLVMX86AsmPrinter -lLLVMX86Utils -lLLVMMCJIT -lLLVMIRReader -lLLVMAsmParser -
lLLVMLineEditor -lLLVMInstrumentation -lLLVMInterpreter -lLLVMExecutionEngine -
lLLVMRuntimeDyld -lLLVMCodeGen -lLLVMScalarOpts -lLLVMProfileData -lLLVMObject -
lLLVMMCParser -lLLVMBitReader -lLLVMInstCombine -lLLVMTransformUtils -lLLVMipa -
lLLVMAnalysis -lLLVMTarget -lLLVMMC -lLLVMCore -lLLVMSupport

(why??)