[llvm-bugs] [Bug 27447] New: [LTO] Symbol lookup error when linking with shared libraries

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Apr 21 10:34:14 PDT 2016


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

            Bug ID: 27447
           Summary: [LTO] Symbol lookup error when linking with shared
                    libraries
           Product: lld
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: All Bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: davide at freebsd.org
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

$ cat try.sh
rm -rf main-lld libshlld.so
./clang shared.cpp -o libshlld.so -shared -fPIC -fuse-ld=lld -flto
./clang main.cpp -L. -o main-lld -fuse-ld=lld -flto -lshlld
./main-lld
./main-lld: symbol lookup error: ./libshlld.so: undefined symbol: _ZSt4cout

$ cat main.cpp 
int
main(void)
{
  return (0);
}
[davide at localhost bin]$ cat shared.cpp 
#include <iostream>
int f();  // forward declaration
int g();  // forward declaration
int x = f();
int y = g();
int f()
{
  std::cout << "using 'y' (which is " << y << ")\n";
  return 3*y + 7;
}
int g()
{
  std::cout << "initializing 'y'\n";
  return 5;
}

-- 
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/20160421/c3120c36/attachment.html>


More information about the llvm-bugs mailing list