Page MenuHomePhabricator

Make LLVMInitializeAll* API have their symbols
AbandonedPublic

Authored by nagisa on Jul 24 2016, 8:42 AM.

Details

Summary

These functions were the only inline C API functions. This makes it impossible to bind these useful functions from non-C languages via FFI as they rely on symbols for these functions existing.

With this PR a new libLLVMAllTargets.a static library is built which contains the non-inline implementations for the functions. I manually confirmed that the bin directory does not increase much in size and that libLLVM-4.0svn.so contains the newly added symbols.

Resubmission of https://reviews.llvm.org/D22734.

Diff Detail

Event Timeline

nagisa updated this revision to Diff 65275.Jul 24 2016, 8:42 AM
nagisa retitled this revision from to Make LLVMInitializeAll* API have their symbols.
nagisa updated this object.
nagisa added a subscriber: llvm-commits.
whitequark added a subscriber: echristo.

@echristo Assuming this works as one would expect, this is a massive improvement. However, I'm not completely certain of all subtle build system behavior. Do you see any potential downsides?

@echristo I would really appreciate a review.

This still wants a review, especially regarding the cmake particularities.

mehdi_amini edited edge metadata.Aug 30 2016, 9:15 AM

Isn't it exactly what was done in r192690 (and reverted later because it broke stuff)?

whitequark added a comment.EditedAug 30 2016, 9:52 AM

@nagisa, please test your changes on Windows and OS X. (For reference the commit that introduced it can be seen at rL192690 and the revert at rL192697.)

I built this on MSVC today (cmake $PATH_TO_LLVM && double-click LLVM.sln && initiate the build in MSVC) and it built (seemingly) whole of LLVM successfully, but ended failing at some ADT/ArrayRef tests due to missing declarations or definitions (something about .contains() not being present on some type etc), which seem to be unrelated to this patch.

The previous patch was reverted because of building with individual shared dylibs, might be worth trying it (whatever OS)

nagisa abandoned this revision.Oct 4 2016, 5:52 AM

No time/mood to pursue this further. Feel free to take over.