Open Quuxplusone opened 11 years ago
Bugzilla Link | PR14557 |
Status | NEW |
Importance | P normal |
Reported by | orchidnju (orchidnju-dummy@yahoo.com.cn) |
Reported on | 2012-12-10 01:08:48 -0800 |
Last modified on | 2012-12-10 19:21:20 -0800 |
Version | 3.1 |
Hardware | Macintosh MacOS X |
CC | llvm-bugs@lists.llvm.org, orchidnju-dummy@yahoo.com.cn, richard-llvm@metafoo.co.uk |
Fixed by commit(s) | |
Attachments | |
Blocks | |
Blocked by | |
See also |
Right, B::B can never be called as a complete object constructor, so the C1 form is not necessary. Is this causing you problems somehow?
(In reply to comment #1)
> Right, B::B can never be called as a complete object constructor, so the C1
> form is not necessary. Is this causing you problems somehow?
Right, from my understanding, C1 will be never called. The issue is, I'm
switching compiler from gcc to clang for a big product with long history. It
uses a self-defined .def file to define all symbols needed to be exported from
a library. We can just state "B::B" inside the private .def file, then use a
private tool (called "mangle") to generate C1/C2 version constructors for the
"B::B" into a definication file known by the compiler. Since clang doesn't
provide C1, the link fails with the exported symbol list.
Since the product is cross platform, we need to use "mangle" tool to generate
corresponding definition file on each platform. The compiler we supported
before on OS X is gcc, and "mangle" heavily depends on the behavior of gcc.The
tool we used isn't strong enough to detect whether the class has pure virtual
method. That's why I want to ask help here.
Is is possible to let clang generate C1, like gcc does?
Or is it possible to let "mangle" knows the mangled name of the constructors
that clang generates for one class?
(In reply to comment #2)
> Is is possible to let clang generate C1, like gcc does?
There's currently no way to do that.
> Or is it possible to let "mangle" knows the mangled name of the constructors
> that clang generates for one class?
If you have the object files, you could search through them for symbols
matching your constructor name. Alternatively, maybe your linker has a
mechanism to only export symbols if they exist?
(In reply to comment #3)
> (In reply to comment #2)
> > Is is possible to let clang generate C1, like gcc does?
>
> There's currently no way to do that.
>
> > Or is it possible to let "mangle" knows the mangled name of the constructors
> > that clang generates for one class?
>
> If you have the object files, you could search through them for symbols
> matching your constructor name. Alternatively, maybe your linker has a
> mechanism to only export symbols if they exist?
I only have the header files and the private symbol names like "B::B" in hand
when creating the common symbol file. I'm wondering if I can link with some
llvm libraries to just calcualte out the mangeled symbols just from header
files.
Fortunately, the ld on Mac supports wildcards for symbol name. I'll try to see
if I can use "C?" to work around this issue.