[llvm-bugs] [Bug 31027] New: thinlto link failure

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Nov 15 12:19:18 PST 2016


https://llvm.org/bugs/show_bug.cgi?id=31027

            Bug ID: 31027
           Summary: thinlto link failure
           Product: clang
           Version: 3.9
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: parag.warudkar at gmail.com
                CC: dgregor at apple.com, llvm-bugs at lists.llvm.org
    Classification: Unclassified

Trying to build ZeroC ICE (https://zeroc.com/distributions/ice#source) on
Ubuntu 14.04 using clang++-3.9. 

/usr/bin/ld is symlinked to /usr/bin/ld.gold. The build fails in
<SRC>/cpp/src/slice2cs directory if -flto=thin is used. 

clang++-3.9 -rdynamic -m64 -flto=thin -fvisibility=hidden -Wall -Werror
-pthread -fPIC -g -L../../lib/x86_64-linux-gnu -Wl,--disable-new-dtags
-Wl,-rpath,\$ORIGIN/../lib/x86_64-linux-gnu -o ../../bin/slice2cs Gen.o Main.o
-lSlice -lIceUtil
Gen.cpp:2996: error: undefined reference to
'Slice::Gen::TieVisitor::TieVisitor(IceUtilInternal::Output&)'
Gen.cpp:3003: error: undefined reference to
'Slice::Gen::ImplVisitor::ImplVisitor(IceUtilInternal::Output&)'
Gen.cpp:3010: error: undefined reference to
'Slice::Gen::ImplTieVisitor::ImplTieVisitor(IceUtilInternal::Output&)'
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Replacing the -flto=thin with just -flto and keeping the same rest of the
command line the link succeeds. I am not sure however since normal LTO
succeeds, it looks like this is a bug with ThinLTO?

[ If anyone wants to reproduce this, ICE is easy to build with few dependencies
 -mcpp, libssl-dev etc- and requires passing CXX=clang++-3.9 to make along with
modifying the Make.rules.Linux to treat clang++-3.9 as g++ and adding
-flto=thin to CXXFLAGS.]

-- 
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/20161115/652c3cea/attachment.html>


More information about the llvm-bugs mailing list