abduld / include-what-you-use

Automatically exported from code.google.com/p/include-what-you-use
Other
0 stars 0 forks source link

Linker error MCRelocationInfo #154

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Compiling the latest IWYU with llvm from 2014-08-20 15:48:06 -0400 I get:

/home/rschulz/software/llvm/lib/libLLVMX86Desc.a(X86MCTargetDesc.o): In 
function `createX86MCRelocationInfo(llvm::StringRef, llvm::MCContext&)':
X86MCTargetDesc.cpp:(.text._ZL25createX86MCRelocationInfoN4llvm9StringRefERNS_9M
CContextE+0x55): undefined reference to 
`llvm::createMCRelocationInfo(llvm::StringRef, llvm::MCContext&)'
/home/rschulz/software/llvm/lib/libLLVMX86Desc.a(X86MachORelocationInfo.o): In 
function `(anonymous 
namespace)::X86_64MachORelocationInfo::~X86_64MachORelocationInfo()':
X86MachORelocationInfo.cpp:(.text._ZN12_GLOBAL__N_125X86_64MachORelocationInfoD2
Ev+0xb): undefined reference to `llvm::MCRelocationInfo::~MCRelocationInfo()'
/home/rschulz/software/llvm/lib/libLLVMX86Desc.a(X86MachORelocationInfo.o): In 
function `(anonymous 
namespace)::X86_64MachORelocationInfo::~X86_64MachORelocationInfo()':
X86MachORelocationInfo.cpp:(.text._ZN12_GLOBAL__N_125X86_64MachORelocationInfoD0
Ev+0xf): undefined reference to `llvm::MCRelocationInfo::~MCRelocationInfo()'
/home/rschulz/software/llvm/lib/libLLVMX86Desc.a(X86MachORelocationInfo.o): In 
function `llvm::createX86_64MachORelocationInfo(llvm::MCContext&)':
X86MachORelocationInfo.cpp:(.text._ZN4llvm31createX86_64MachORelocationInfoERNS_
9MCContextE+0x1d): undefined reference to 
`llvm::MCRelocationInfo::MCRelocationInfo(llvm::MCContext&)'
/home/rschulz/software/llvm/lib/libLLVMX86Desc.a(X86MachORelocationInfo.o):(.dat
a.rel.ro._ZTVN12_GLOBAL__N_125X86_64MachORelocationInfoE+0x28): undefined 
reference to `llvm::MCRelocationInfo::createExprForCAPIVariantKind(llvm::MCExpr 
const*, unsigned int)'
/home/rschulz/software/llvm/lib/libLLVMX86Desc.a(X86ELFRelocationInfo.o): In 
function `(anonymous 
namespace)::X86_64ELFRelocationInfo::~X86_64ELFRelocationInfo()':
X86ELFRelocationInfo.cpp:(.text._ZN12_GLOBAL__N_123X86_64ELFRelocationInfoD2Ev+0
xb): undefined reference to `llvm::MCRelocationInfo::~MCRelocationInfo()'
/home/rschulz/software/llvm/lib/libLLVMX86Desc.a(X86ELFRelocationInfo.o): In 
function `(anonymous 
namespace)::X86_64ELFRelocationInfo::~X86_64ELFRelocationInfo()':
X86ELFRelocationInfo.cpp:(.text._ZN12_GLOBAL__N_123X86_64ELFRelocationInfoD0Ev+0
xf): undefined reference to `llvm::MCRelocationInfo::~MCRelocationInfo()'
/home/rschulz/software/llvm/lib/libLLVMX86Desc.a(X86ELFRelocationInfo.o): In 
function `llvm::createX86_64ELFRelocationInfo(llvm::MCContext&)':
X86ELFRelocationInfo.cpp:(.text._ZN4llvm29createX86_64ELFRelocationInfoERNS_9MCC
ontextE+0x1d): undefined reference to 
`llvm::MCRelocationInfo::MCRelocationInfo(llvm::MCContext&)'
/home/rschulz/software/llvm/lib/libLLVMX86Desc.a(X86ELFRelocationInfo.o):(.data.
rel.ro._ZTVN12_GLOBAL__N_123X86_64ELFRelocationInfoE+0x28): undefined reference 
to `llvm::MCRelocationInfo::createExprForCAPIVariantKind(llvm::MCExpr const*, 
unsigned int)'
collect2: error: ld returned 1 exit status

Making the following change fixes it:
Index: CMakeLists.txt
===================================================================
--- CMakeLists.txt      (revision 566)
+++ CMakeLists.txt      (working copy)
@@ -111,6 +111,7 @@
   LLVMX86AsmPrinter # MC, Support, X86Utils
   LLVMX86Info # MC, Support, Target
   LLVMX86Utils # Core, Support
+  LLVMMCDisassembler
   LLVMipo
   LLVMScalarOpts
   LLVMInstCombine

Original issue reported on code.google.com by rol...@rschulz.eu on 24 Aug 2014 at 9:22

GoogleCodeExporter commented 9 years ago
Thanks for the report Roland. There is no such a problem on Mac OS X and my 
Ubuntu environment isn't up to date. The most important thing is to figure out 
if it's trunk only problem or if it's present in 3.5 branch too. Will fix 
Ubuntu environment and get back to this issue.

Original comment by vsap...@gmail.com on 25 Aug 2014 at 5:29

GoogleCodeExporter commented 9 years ago
If I compile the IWYU 3.5 branch with llvm 3.5rc3 then I don't get any error.

Original comment by rol...@rschulz.eu on 25 Aug 2014 at 6:24

GoogleCodeExporter commented 9 years ago
Just chiming in that I can repeat this with a HEAD build of llvm/clang and a 
trunk build of iwyu on Mac OS X 10.9.5. I'm assuming there are breaking changes 
in the as-yet-unreleased llvm/clang 3.6 which will need to be dealt with in the 
next release of iwyu.

Original comment by ja...@citusdata.com on 24 Sep 2014 at 4:03

GoogleCodeExporter commented 9 years ago
Jason, how are you building iwyu on Mac OS X 10.9.5? In-tree or out-of-tree? 
With CMake or make? I see no build problems on Mac OS X and it indicates my 
testing isn't thorough enough. Can you share more details, please? So I can 
improve my testing.

Original comment by vsap...@gmail.com on 24 Sep 2014 at 5:37