[PATCH] D35077: [RFC] Build LLVM-C.dll on MSVC that exports only the C API

Jakob Bornecrantz via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Jul 22 06:24:28 PDT 2017


Wallbraker updated this revision to Diff 107783.
Wallbraker added a comment.
Herald added a subscriber: fedor.sergeev.

In https://reviews.llvm.org/D35077#813499, @beanz wrote:

> I don't think this should be added as a new tool. We support generating LLVM-C.dylib on Darwin via the tools/llvm-shlib tool. It would be better if this were added there instead of completely separate.


Thank you for your comment, I respun this patch so that it does not add a new tool but reuse the llvm-shlib tool.

It becomes a bit more ugly then because:

1. The LLVM-C.dylib on Darwin is a re-export library that holds no code it just points to LLVM.dylib but only the LLVM C API functions are exported.
2. I'm pretty sure we do not want to ship a LLVM.dll exporting all of the C++ functions (I could be wrong here and we want to) so we should not build it on Windows.
3. So we only build LLVM-C.dll without using a re-export library (also don't know how to do that on Windows).
4. The llvm-shlib directory is only built if LLVM.dylib is built, which we do not want to do on Windows, see 2. So had to jump through some hoops to get it to enter it.

Both patches are in my llvm repo on github https://github.com/Wallbraker/llvm

Thanks, Jakob.


https://reviews.llvm.org/D35077

Files:
  CMakeLists.txt
  tools/CMakeLists.txt
  tools/llvm-shlib/CMakeLists.txt
  tools/llvm-shlib/gen-msvc-exports.py

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D35077.107783.patch
Type: text/x-patch
Size: 15756 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170722/0712f532/attachment.bin>


More information about the llvm-commits mailing list