[llvm-bugs] [Bug 33767] New: std::tm type needs to be mangled as "::tm" on Solaris for g++ binary compat

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Jul 13 04:41:44 PDT 2017


            Bug ID: 33767
           Summary: std::tm type needs to be mangled as "::tm" on Solaris
                    for g++ binary compat
           Product: clang
           Version: unspecified
          Hardware: All
                OS: Solaris
            Status: NEW
          Severity: normal
          Priority: P
         Component: LLVM Codegen
          Assignee: unassignedclangbugs at nondot.org
          Reporter: Fedor.Sergeev at oracle.com
                CC: llvm-bugs at lists.llvm.org

g++ on Solaris has special mangling twist that makes it generate non-standard
mangling for std::tm, std::div_t, std::ldiv_t, std::lconv types.

W/o this twist clang fails to link with libstdc++ on testcases like this:

] cat no-tm.cc
#include <locale>
struct D : std::time_get<char> {};

int main() {
        D var;
] clang no-tm.cc
Undefined                       first referenced
 symbol                             in file
ld: fatal: symbol referencing errors
clang-5.0: error: linker command failed with exit code 1 (use -v to see

Basically any signature that includes either of the aforementioned types is
mangled differently than whats in libstdc++.

Namely, clang mangles std::tm as std::tm (surpise! :), while gcc does it as

Say, first undefined symbol above:

] nm /usr/lib/libstdc++.so | grep
[6646]  |    533632|       276|FUNC |WEAK |0    |810   

Notice 2tm vs St2tm difference at the tail of the mangled name.

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/20170713/90dd6824/attachment.html>

More information about the llvm-bugs mailing list