[LLVMbugs] [Bug 16127] New: linker command failed while compilation using rtti

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu May 23 08:05:39 PDT 2013


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

            Bug ID: 16127
           Summary: linker command failed while compilation using rtti
           Product: clang
           Version: 3.2
          Hardware: Macintosh
                OS: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++11
          Assignee: unassignedclangbugs at nondot.org
          Reporter: alexey.frolov at intel.com
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Created attachment 10572
  --> http://llvm.org/bugs/attachment.cgi?id=10572&action=edit
test source file

OS:            Mac OS X 10.8.2.
Architecture:  x86_64.
Xcode:         Xcode 4.6, Build version 4H127.
Clang version:
    Apple LLVM version 4.2 (clang-425.0.24) (based on LLVM 3.2svn)
    Target: x86_64-apple-darwin12.2.0
    Thread model: posix

The compilation of simple source file using rtti fails in a following way:
  $ clang++ -c -O0 -std=c++0x test.cpp
  $ clang++ -o test.exe -O0 -std=c++0x test.o
  >Undefined symbols for architecture x86_64:
  >  "typeinfo for A", referenced from:
  >      f() in test.o
  >      typeinfo for B in test.o
  >ld: symbol(s) not found for architecture x86_64
  >clang++: error: linker command failed with exit code 1 (use -v to see
invocation)
  $

The test complies with no error when using -fno-rtti option:
  $ clang++ -c -O0 -std=c++0x -fno-rtti test.cpp
  $ clang++ -o test.exe -O0 -std=c++0x -fno-rtti test.o
  $

Please, see the sourse file and generated llvm code in the attached files.

-- 
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/20130523/d1db54cb/attachment.html>


More information about the llvm-bugs mailing list