[LLVMbugs] [Bug 18301] New: Build failure with gcc LTO

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sat Dec 21 01:59:52 PST 2013


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

            Bug ID: 18301
           Summary: Build failure with gcc LTO
           Product: new-bugs
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: octoploid at yandex.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

When I try to build LLVM with gcc -flto I get:

lib/libLLVMAsmParser.so: error: undefined reference to
'llvm::SymbolTableListTraits<llvm::BasicBlock,
llvm::Function>::transferNodesFromList(llvm::ilist_traits<llvm::BasicBlo
ck>&, llvm::ilist_iterator<llvm::BasicBlock>,
llvm::ilist_iterator<llvm::BasicBlock>)'
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed

This happens because the symbol is undefined in LLParser.cpp.o:
  % nm lib/AsmParser/CMakeFiles/LLVMAsmParser.dir/LLParser.cpp.o | grep
_ZN4llvm21SymbolTableListTraitsINS_10BasicBlockENS_8FunctionEE21transferNodesFromListERNS_12ilist_traitsIS1_EENS_14ilist_iteratorIS1_EES8_
                 U
_ZN4llvm21SymbolTableListTraitsINS_10BasicBlockENS_8FunctionEE21transferNodesFromListERNS_12ilist_traitsIS1_EENS_14ilist_iteratorIS1_EES8_

And with -flto the weak symbol in lib/libLLVMCore.so is optimized out.
(Without lto one has:
lib/libLLVMCore.so:
0000000000071e90 W
_ZN4llvm21SymbolTableListTraitsINS_10BasicBlockENS_8FunctionEE21transferNodesFromListERNS_12ilist_traitsIS1_EENS_14ilist_iteratorIS1_EES8
and everything works fine)

I think an explicit instantiation of the SymbolTableListTraits template
is missing in LLParser.cpp.

-- 
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/20131221/8a82a5c3/attachment.html>


More information about the llvm-bugs mailing list