<div>
<div>Óscar,</div>
<div> </div>
<div>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">
<div>It is -DBUILD_SHARED_LIBS=ON, not -D SHARED_LIBRARY=true.</div></blockquote></div>
<div> </div>
<div>Oh sorry, I was typing from memory. But that was one of the iterations I tried, and just now retried, with the same hang. So you are not seeing the hang when trying to build any of the generated projects?</div>
<div> </div>
<div>BTW, we could really use some extension to the documentation for the options available in the cmake stuff.</div>
<div> </div>
<div>Michael,</div>
<div> </div>
<div>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">
<div>It's actually possible to do this without explicit directives by<br>making use of link -dump to dump the symbol table to an export file<br>and relink all the static libs into a giant DLL that exports<br>everything. At one point I was working on this, but got pulled into<br>
other things.</div></blockquote></div>
<div> </div>
<div>I don't see a -dump option for the Visual Studio 2008 linker in the docs. Did you mean the /MAP option?</div>
<div> </div>
<div>Do you have a way to automate the exporting? I'd like to find out more.</div>
<div> </div>
<div>
<div>Óscar,</div>
<div> </div></div>
<div>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">
<div>What's the difference among indexed and non-indexed exports? The exports<br>file I created was just a list of symbols and the linker failed<br>complaining about the 2^16 limit. Then I read some documents on msdn and<br>
the 2^16 limit was mentioned, but nothing about 2^32.</div></blockquote></div></div>
<div> </div>
<div>By "indexed" I assume you mean "ordinal".</div>
<div> </div>
<div>My understanding is that the exported symbols can be referenced by ordinal or name, the ordinal being a carry-over from the old days for saving space. Looking at the .def file docs, I see that under the "EXPORTS" section you can do either:</div>
<div> </div>
<div>ExportNameA @1<br>ExportNameB</div>
<div> </div>
<div>where the first line is for an ordinal export, and the second is a named export. I'm wondering if the same limit applies to the named exports. I would gues not.</div>
<div> </div>
<div>In the past, I've always just used the __declspec(export) and __declspec(import) directives in the headers for DLLs. Basically you put something like the following in a main header for the library, for example, for MyLibrary:</div>
<div> </div>
<div>#if defined(DLL)</div>
<div> #if defined(MYLIBRARY_EXPORTS) || defined(BIG_DLL_EXPORTS)</div>
<div> #define MYLIBRARY_LINKAGE __declspec(dllexport)</div>
<div> #else // client sees this</div>
<div> #define MYLIBRARY_LINKAGE __declspec(dllimport)</div>
<div> #endif</div>
<div>#else // assume static library linkage</div>
<div> #define MYLIBRARY_LINKAGE</div>
<div>#endif</div>
<div> </div>
<div>You define MYLIBRARY_EXPORTS in the project file for the library (or BIG_DLL_EXPORTS for a single big DLL), and then you use the linkage symbol in the class or function declarations that should be exported, i.e.:</div>
<div> </div>
<div>class MYLIBRARY_LINKAGE MyClass</div>
<div>{</div>
<div> // All class functions will be exported.</div>
<div>};</div>
<div> </div>
<div>MYLIBRARY_LINKAGE void MyFunction();</div>
<div> </div>
<div>I'd be willing to take on this task, if this is the way we want to handle it. If we can't automate the .def file creation, this would probably be the better option.</div>
<div> </div>
<div>But I would like to hear of other ways too.</div>
<div> </div>
<div>It seems trying to get Clang as individual DLLs probably wouldn't work. Creating a big CMake file that builds all the sources into a single DLL would probably be a pain to maintain. Perhaps a CMake file that turns on the __declspec directives in the static libraries but still using he current CMake files, and then builds the DLL from the static libraries is the way to go.</div>
<div> </div>
<div>Or, instead of using __declspec, have the individual static libary builds output a .map file, and use a custom tool that pulls out the exports and creates a .def file. (Was that what you we working on, Michael?) It seems like there ought to be an option for just exporting all globals.</div>
<div> </div>
<div>Argyrios,</div>
<div> </div>
<div>
<div>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">
<div>I think we should move away from the llvm::Registry mechanism. How about the exported function returns a PluginASTAction*, we store all PluginASTAction* pointers that the plugins return and iterate over them when invoking plugin actions.</div>
</blockquote></div></div>
<div> </div>
<div>Sounds good to me. But if not, at least fix the Registry mechanism by adding the needed accessors, which curiously it doesn't have, which is what I tried to do in my patch.</div>
<div> </div>
<div>-John<br><br>-- <br>John Thompson<br><a href="mailto:John.Thompson.JTSoftware@gmail.com" target="_blank">John.Thompson.JTSoftware@gmail.com</a><br><br></div>