[LLVMbugs] [Bug 15655] New: libLLVMTarget.so is not linked with -lLLVMCodeGet, unresolved llvm::MachineInstr::hasPropertyInBundle when linking llvm-dis

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Apr 2 11:23:49 PDT 2013


http://llvm.org/bugs/show_bug.cgi?id=15655

            Bug ID: 15655
           Summary: libLLVMTarget.so is not linked with -lLLVMCodeGet,
                    unresolved llvm::MachineInstr::hasPropertyInBundle
                    when linking llvm-dis
           Product: Build scripts
           Version: 3.2
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: cmake
          Assignee: unassignedbugs at nondot.org
          Reporter: dilyan.palauzov at aegee.org
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

I compile llvm-3.2 with cmake.  On 'make' I get the message

[ 61%] Built target opt
[ 61%] Built target llvm-as
Linking CXX executable ../../bin/llvm-dis
../../lib/libLLVMTarget.so: undefined reference to
`llvm::MachineInstr::hasPropertyInBundle(unsigned int,
llvm::MachineInstr::QueryType) const'
collect2: error: ld returned 1 exit status
make[2]: *** [bin/llvm-dis] Error 1
make[1]: *** [tools/llvm-dis/CMakeFiles/llvm-dis.dir/all] Error 2
make: *** [all] Error 2

Indeed, libLLVMCodeGen.so defines llvm::MachineInstr::hasPropertyInBundle:

nm -C lib/libLLVMCodeGen.so |grep hasPropertyInBundle
000000000027136c T llvm::MachineInstr::hasPropertyInBundle(unsigned int,
llvm::MachineInstr::QueryType) const


and libLLVMTarget.so has hasPropertyInBundle as undefined symbol:

nm -C lib/libLLVMTarget.so |grep hasPropertyInBundle
                 U llvm::MachineInstr::hasPropertyInBundle(unsigned int,
llvm::MachineInstr::QueryType) const


and libLLVMTarget.so does not depend on libLLVMCodeGen.so:

readelf -d lib/libLLVMTarget.so |grep NEEDED
 0x0000000000000001 (NEEDED)             Shared library: [libdl.so.2]
 0x0000000000000001 (NEEDED)             Shared library: [libpthread.so.0]
 0x0000000000000001 (NEEDED)             Shared library: [libLLVMCore.so]
 0x0000000000000001 (NEEDED)             Shared library: [libLLVMMC.so]
 0x0000000000000001 (NEEDED)             Shared library: [libLLVMSupport.so]
 0x0000000000000001 (NEEDED)             Shared library: [libLLVMObject.so]
 0x0000000000000001 (NEEDED)             Shared library: [libstdc++.so.6]
 0x0000000000000001 (NEEDED)             Shared library: [libm.so.6]
 0x0000000000000001 (NEEDED)             Shared library: [libgcc_s.so.1]
 0x0000000000000001 (NEEDED)             Shared library: [libc.so.6]

I noticed, that both libLLVMTarget.so and libLLVMCodeGen.so have a private
llvm::MachineInstr::hasProperty , but only libLLVMCodeGen has and exports
hasPropertyInBundle() .

So the error is one of:

-- libLLVMTarget.so is not linked with -lLLVMCodeGet, or
-- llvm-dis is not linked with -lLLVMCodeGet, in case llvm-dis does not use on
its own hasPropertyInBundle, but depends on libLLVMTarget

I can compile llvm-dis using Autoconf, but not with cmake.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20130402/94b08122/attachment.html>


More information about the llvm-bugs mailing list