[PATCH] D52662: [libc++] Make sure we can build libc++ with -fvisibility=hidden

Shoaib Meenai via Phabricator reviews at reviews.llvm.org
Wed Oct 3 17:20:40 PDT 2018


smeenai added a comment.

In https://reviews.llvm.org/D52662#1251942, @ldionne wrote:

> In https://reviews.llvm.org/D52662#1251867, @smeenai wrote:
>
> > In https://reviews.llvm.org/D52662#1251866, @ldionne wrote:
> >
> > > In https://reviews.llvm.org/D52662#1251857, @smeenai wrote:
> > >
> > > > Hmm, why do we need to be able to explicitly instantiate vtables and RTTI ... doesn't the implied emission of those in the object file containing the key function work? I've been aware of a few -dev threads flying back and forth about various visibility issues for libc++, and I admit I haven't been keeping up with them fully, so I apologize if this has already been covered in one of those.
> > >
> > >
> > > We'd need to give default visibility to the vtable and the RTTI, which requires using an attribute.
> >
> >
> > Isn't that what `__attribute__((type_visibility("default")))` accomplishes?
>
>
> The problem is that it requires applying the attribute to the class template itself as opposed to a single instantiation of it.  Unless I am wrong?


Thinking about this more, I guess you can't really have a key function for a class template anyway, since you need to define all your methods inline for clients to be able to use your class.


Repository:
  rCXX libc++

https://reviews.llvm.org/D52662





More information about the libcxx-commits mailing list