[cfe-dev] Big Clang DLL, plug-in mechanism revision
John Thompson
john.thompson.jtsoftware at gmail.com
Thu May 5 11:58:53 PDT 2011
Anton,
Thanks for the response.
I agree.
However, forgetting a linkage tag is not too serious, as long as it's not
one of the symbos that the driver or other client references. If a client
runs into it, it's just a simple fix of finding the symbol and adding the
tag.
One possiblity might be to write a tool to rewrite .obj files, changing the
linkage internally. But given the proprietary nature of the format, it
seems like a bad idea, if not just difficult.
One thing I don't know is if the __declspec method will still reach the 2^16
limit on exports. The solution then would probably to prioritize the
classes, and not export the more internal classes.
Another method might be some variation on the method Óscar tried,
of creating a tool or script to walk a .map file and create a .def file with
exports in it. Add an option to the tool to input a file with a list of
names to be used as partial match patterns, omitting names that don't
contain the match pattern, assuming the name mangling preserves at least
that much in each symbol name.
Of course this has the same problem of forgetting to add the patterns.
My preference is the more direct method of the linkage tags, which I'm
already used to from past Windows work.
-John
On Thu, May 5, 2011 at 12:29 AM, Anton Korobeynikov <anton at korobeynikov.info
> wrote:
> Hello John,
>
> > 2. A new "LLVMCommon.h" file is added to the include/llvm directory under
> > the root to define "LLVM_EXPORT" and "LLVM_IMPORT" macros that wrap the
> > Visual C++ "__declspec(dllexport)" and "__declspec(dllimport)"
> directives,
> > as well as to define the "LLVMCORE_LINKAGE" macro. This file will be
> > included by all the "(moduleName)Common.h" files for the LLVM components.
> This looks really ugly and error-prone. I believe that people will
> forgot to add these linkage macros while adding new classes.
> Maybe there is some alternative way of exporting the stuff?
>
> --
> With best regards, Anton Korobeynikov
> Faculty of Mathematics and Mechanics, Saint Petersburg State University
>
--
John Thompson
John.Thompson.JTSoftware at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20110505/9263f11e/attachment.html>
More information about the cfe-dev
mailing list