[llvm-bugs] [Bug 30401] New: GCC 6.2 / LLVM 3.9 name mangling discrepancy for function with argument whose template argument involves an ABI tag.

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Sep 15 11:54:45 PDT 2016


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

            Bug ID: 30401
           Summary: GCC 6.2 / LLVM 3.9 name mangling discrepancy for
                    function with argument whose template argument
                    involves an ABI tag.
           Product: clang
           Version: 3.9
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: greenc at fnal.gov
                CC: dgregor at apple.com, llvm-bugs at lists.llvm.org
    Classification: Unclassified

Created attachment 17269
  --> https://llvm.org/bugs/attachment.cgi?id=17269&action=edit
Code and build script to demonstrate mangling discrepancy

Overview:

The function:

void gallery::throwHandleWhyFailed(std::shared_ptr<art::Exception const>
whyFailed);

mangles to different symbol names with GCC 6.2 (new ABI) vs LLVM / CLang 3.9.0.

To reproduce:

1. Expand the provided tar file and cd into the directory created in an
environment with access to both GCC 6.2.0 and LLVM 3.9.0 (the docker image
described in the included Dockerfile or found on github as fnalart/llvm:3.9
provides just such an environment).
2. Invoke the provided build.sh script with the appropriate compiler name (e.g.
g++-6 or clang++-3.9) as argument. If you are operating in a different
environment than the above-mentioned docker image, you may need to tweak the
options provided to clang to use the intended GCC standard library.

Using the fnalart/llvm:3.9 docker image, one gets:

$ docker run --rm -v `pwd`:/work -w /work fnalart/llvm:3.9 ./build.sh g++-6
_ZN7gallery20throwHandleWhyFailedESt10shared_ptrIKN3cet15coded_exceptionIN3art6errors10ErrorCodesEXadL_ZNS3_15ExceptionDetail9translateB5cxx11ES5_EEEEE
gallery::throwHandleWhyFailed(std::shared_ptr<cet::coded_exception<art::errors::ErrorCodes,
&art::ExceptionDetail::translate[abi:cxx11]> const>)

and

$ docker run --rm -v `pwd`:/work -w /work fnalart/llvm:3.9 ./build.sh
clang++-3.9
_ZN7gallery20throwHandleWhyFailedESt10shared_ptrIKN3cet15coded_exceptionIN3art6errors10ErrorCodesEXadL_ZNS3_15ExceptionDetail9translateB5cxx11ENS6_6errors10ErrorCodesEEEEEE
gallery::throwHandleWhyFailed(std::shared_ptr<cet::coded_exception<art::errors::ErrorCodes,
&art::ExceptionDetail::translate[abi:cxx11]> const>)

Note that c++filt demangles the symbol in each case to the same C++ function
signature.

This has also been filed as https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77597.
As of this writing however, the opinion appears to be that this is something
Clang should change, rather than GCC.

-- 
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/20160915/79cc9f5f/attachment.html>


More information about the llvm-bugs mailing list