[PATCH] Rework lli-child-target for portability and correctness

Reid Kleckner rnk at google.com
Tue Dec 3 10:05:20 PST 2013


Carving up Support with #ifdefs to support .cpp file inclusion at a
distance doesn't seem right.

Why is lli-child-target so large in the first place?  If it links
statically and only calls a few helpers out of Support, the linker should
avoid linking in unreferenced object files from the static library.  If the
.cpp files in Support reference each other too much, maybe we can find a
way to factor them differently.

Alternatively, we could bring back System for this kind of low-level stuff.


On Tue, Dec 3, 2013 at 9:34 AM, Alp Toker <alp at nuanti.com> wrote:

> This is a bumper patch to fix assorted MCJIT remote issues, split into two
> parts for ease of review.
>
> Minor tweaks outside of lli were necessary to support reuse of LLVM's
> Support implementation by inclusion without having to link to LLVM.
>
>   9 files changed, 157 insertions(+), 253 deletions(-)
>
> Patch 1:
>
> Provide LLVM_STANDALONE for lightweight Support embedders
>
> This is sufficient to build lli-child-target in a standalone configuration
> without having to link any LLVM libraries.
>
> Also fixes a problem in AllocateRWX() where process::get_self()->page_
> size()
> was being called repeatedly.
>
> Patch 2:
>
> Share a single IPC transport implementation between the child and parent
> instead of duplicating the code.
>
> Share the existing LLVM memory management and cache invalidation code
> instead
> of copy-and-pasting it. This is complicated; we don't want to maintain two
> versions but at the same time need to keep lli-child-target free of
> dependencies.
>
> Make memory management and instruction cache flushing portable in the child
> application using LLVM's Support headers in standalone mode. Eliminate
> lots of
> copy-and-pasted code.
>
> Fix a typo that caused the instruction cache invalidation never to run on
> executable pages, which could be a problem on ARM, PowerPC etc.
>
> Add assertions for piped read/write. This should help cut down on needless
> assertions at the callsites.
>
> Build lli-child-target in a standalone configuration, reducing binary size
> to
> 24KB down from ~500KB.
>
> These fixes pave the way for a Windows implementation.
>
> Alp.
>
> --
> http://www.nuanti.com
> the browser experts
>
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20131203/82373f54/attachment.html>


More information about the llvm-commits mailing list