Steven Schveighoffer <> changed:

           What    |Removed                     |Added
             Status|RESOLVED                    |REOPENED
         Resolution|WONTFIX                     |---

--- Comment #5 from Steven Schveighoffer <> ---
(In reply to Martin Nowak from comment #3)
> It goes against the intention of static libraries to drag unused classes and
> module into a binary, and that also goes against our permanent fight against
> giant binaries.

This is penny-wise and pound-foolish. First we need to solve megabyte sized
template symbol names. Then we need full shared library support. The few
kilobytes that moduleinfo adds is nothing. Trim out unused classinfo? Then we
need to remove Object.factory method.

> In fact there is issue 14555 and a PR
> ( in the adverse direction.
> If you really want to drag in all classes from a static library, one
> approach is to reference all of them from a common module.

I referenced the class info from within the module, and called that function.
Why is the linker excluding it? This seems like a real bug.

In fact, I actually TRY your suggestion to solve the original problem and it
doesn't work. See the PR:

> Having an explicit list of all classes kind of contradicts the purpose of
> Object.factory, but I don't see how we can easily achieve both.

We can't have Object.factory and then trim out all classinfo that aren't used
directly. But in this case, I AM using it directly, and it's STILL being
trimmed out.


Reply via email to