[LLVMbugs] [Bug 10308] New: using libc++ with -O4

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Jul 8 05:09:43 PDT 2011


           Summary: using libc++ with -O4
           Product: new-bugs
           Version: trunk
          Platform: Macintosh
        OS/Version: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: llvm at niebuhrt.de
                CC: llvmbugs at cs.uiuc.edu

Compiling the following small program with link time optimization results in

--------------- test.cpp-----------------

#include <memory>

int main() {
        int data;
        std::shared_ptr<int> px(&data);
        std::weak_ptr<int> ppx(px);

        return 0;


Everything is compiled from trunk. /usr/lib/libLTO.dylib is linked to the
libLTO.dylib from the compiled trunk

clang++ -v -O4 test.cpp -std=c++0x -stdlib=libc++ -U__STRICT_ANSI__
clang version 3.0 (trunk 134695)
Target: x86_64-apple-darwin10.8.0
Thread model: posix
 "/Users/niebuhr/projects/llvm/Release+Asserts/bin/clang" -cc1 -triple
x86_64-apple-macosx10.6.8 -emit-llvm-bc -disable-free -main-file-name test.cpp
-pic-level 1 -mdisable-fp-elim -masm-verbose -munwind-tables -target-cpu core2
-target-linker-version 123.2 -v -resource-dir
/Users/niebuhr/projects/llvm/Release+Asserts/bin/../lib/clang/3.0 -U
__STRICT_ANSI__ -stdlib=libc++ -O3 -std=c++0x -fdeprecated-macro -ferror-limit
19 -fmessage-length 80 -stack-protector 1 -fblocks -fcxx-exceptions
-fexceptions -fdiagnostics-show-option -fcolor-diagnostics -o
/var/folders/i1/i1WwOXILFa8QNqJQnuxxd++++TI/-Tmp-/cc-JvMCW6.o -x c++ test.cpp
clang -cc1 version 3.0 based upon llvm 3.0svn hosted on
#include "..." search starts here:
#include <...> search starts here:
 /System/Library/Frameworks (framework directory)
 /Library/Frameworks (framework directory)
End of search list.
 "/usr/llvm-gcc-4.2/libexec/gcc/i686-apple-darwin10/4.2.1/ld" -demangle
-object_path_lto /var/folders/i1/i1WwOXILFa8QNqJQnuxxd++++TI/-Tmp-/cc-5v0a2o.o
-dynamic -arch x86_64 -macosx_version_min 10.6.8 -o a.out -lcrt1.10.6.o
/var/folders/i1/i1WwOXILFa8QNqJQnuxxd++++TI/-Tmp-/cc-JvMCW6.o -lc++ -lSystem
Undefined symbols for architecture x86_64:
  "typeinfo name for std::__1::__shared_weak_count", referenced from:
  "typeinfo name for std::__1::__shared_count", referenced from:
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

More information about the llvm-bugs mailing list