[llvm-bugs] [Bug 35146] New: dllexported classes don't emit typeinfo (often enough) in the itanium ABI

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Oct 31 05:49:55 PDT 2017


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

            Bug ID: 35146
           Summary: dllexported classes don't emit typeinfo (often enough)
                    in the itanium ABI
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: martin at martin.st
                CC: dgregor at apple.com, llvm-bugs at lists.llvm.org

With both GCC (tested with GCC 5.3) and MSVC, and clang in MSVC mode, a
dllexported class declaration trigger emitting typeinfo (and the corresponding
export linker directives), while clang in itanium mode fails to do this.

This causes build failures when building Qt for MinGW with clang (unless RTTI
is disabled, which isn't officially supported in Qt).

Example case:

dllexport-rtti.cpp:
    class __declspec(dllexport) VirtualClass {
    public:
        void virtual bar();
    };

$ x86_64-w64-mingw32-g++ -c dllexport-rtti.cpp -o dllexport-rtti.o
$ llvm-nm dllexport-rtti.o
00000000 R _ZTI12VirtualClass
00000000 R _ZTS12VirtualClass
         U _ZTVN10__cxxabiv117__class_type_infoE
$ llvm-readobj -coff-directives dllexport-rtti.o

File: dllexport-rtti.o
Format: COFF-x86-64
Arch: x86_64
AddressSize: 64bit
Directive(s):  -export:"_ZTI12VirtualClass",data

With clang (clang -target x86_64-windows-gnu dllexport-rtti.cpp -c -o
dllexport-rtti.o), nothing gets emitted in this build.

This seems to be related to things that David Majnemer touched in SVN r244266
in this commit:
"[ItaniumCXXABI] Don't import RTTI data for classes with key functions"
(This particular test case behaves identically both before and after that
commit though, but it seems to be related.)

-- 
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/20171031/1c1639a8/attachment.html>


More information about the llvm-bugs mailing list