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: unassignedb...@nondot.org
          Reporter: dav...@freebsd.org
                CC: llvm-bugs@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@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.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to