This is an archive of the discontinued LLVM Phabricator instance.

Make LLVMInitializeAll* API have their symbols
AbandonedPublic

Authored by mehdi_amini on Jul 24 2016, 1:30 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.

Diff Detail

Event Timeline

nagisa updated this revision to Diff 65268.Jul 24 2016, 1:30 AM
nagisa retitled this revision from to Make LLVMInitializeAll* API have their symbols.
nagisa updated this object.
nagisa set the repository for this revision to rL LLVM.

Ok this is kind of a gotach, but please submit your patches adding llvm-commits as subscriber, so it appears in the mailing list. It can't be added latter which is anoying :/

docs/ReleaseNotes.rst
48

Empty line

tools/llvm-c-test/CMakeLists.txt
2

Why ?

tools/opt/CMakeLists.txt
2 ↗(On Diff #65268)

Why ?

whitequark requested changes to this revision.Jul 24 2016, 2:10 AM
whitequark edited edge metadata.

@nagisa, they are deliberately inline and deliberately unavailable for FFI use. After your change, every single executable statically linking to Target will link every individual backend, which makes them at least 200-500MB larger and increases link times by 10-60s (ballpark numbers).

This revision now requires changes to proceed.Jul 24 2016, 2:10 AM

@nagisa, they are deliberately inline and deliberately unavailable for FFI use. After your change, every single executable statically linking to Target will link every individual backend, which makes them at least 200-500MB larger and increases link times by 10-60s (ballpark numbers).

Hmm… would having a libLLVMAllTargets.a or something along the lines solve this particular issue?

nagisa added inline comments.Jul 24 2016, 2:40 AM
tools/opt/CMakeLists.txt
2 ↗(On Diff #65268)

When a tool is linked statically, it generates such a command line:

clang ... lib/libTargetStuffs.a ... lib/libTarget.a ...

These are order-dependent and if libTarget is linked after libTargetStuffs linking errors occur.

@nagisa, yes, I think that will work.

nagisa updated this revision to Diff 65270.Jul 24 2016, 5:35 AM
nagisa updated this object.
nagisa edited edge metadata.
nagisa removed rL LLVM as the repository for this revision.

I updated the thing to build another library libLLVMAllTargets (bikeshed on library name or placement welcome) and confirmed that the bin directory doesn’t get much larger with this change. I also confirmed by hand that libLLVM-4.0svn.so now contains said symbols.

Hopefully all the other comments also got addressed.

mehdi_amini commandeered this revision.Jul 24 2016, 8:27 AM
mehdi_amini added a reviewer: nagisa.

Ok this is kind of a gotach, but please submit your patches adding llvm-commits as subscriber, so it appears in the mailing list. It can't be added latter which is anoying :/

Please resubmit

mehdi_amini abandoned this revision.Jul 24 2016, 8:28 AM

Also please upload your patches with full context.