Josef Eisl via llvm-dev
2019-Jan-28 14:40 UTC
[llvm-dev] [RFC] Support embedding bitcodes in LLD with LTO
Hi everybody! I'm Josef and I'm working at Oracle Labs on Sulong [1,2], the LLVM IR execution engine in GraalVM [3]. In addition to executing bare bitcode files, Sulong also accepts ELF files with embedded bitcode sections. Therefore, it would be great if LLD in (Full)LTO mode would support embedding bitcode sections to the resulting object file. Is that something that would be considered useful and worth contributing? Thanks, Josef [1] http://lists.llvm.org/pipermail/llvm-dev/2016-January/094713.html [2] https://github.com/oracle/graal/tree/master/sulong [3] https://www.graalvm.org/
Rui Ueyama via llvm-dev
2019-Jan-30 19:18 UTC
[llvm-dev] [RFC] Support embedding bitcodes in LLD with LTO
Hi Josef, Let me clarify my understanding. Do you want to keep original bitcode files in the output executable when doing LTO, so that the resulting executable contains both compiled bitcode (which is in native machine instructions) and original bitcode files? Did you try embedding bitcode files into existing ELF files using objcopy or linker option `--format=binary`? On Mon, Jan 28, 2019 at 6:41 AM Josef Eisl via llvm-dev < llvm-dev at lists.llvm.org> wrote:> Hi everybody! > > I'm Josef and I'm working at Oracle Labs on Sulong [1,2], the LLVM IR > execution engine in GraalVM [3]. In addition to executing bare bitcode > files, Sulong also accepts ELF files with embedded bitcode sections. > Therefore, it would be great if LLD in (Full)LTO mode would support > embedding bitcode sections to the resulting object file. Is that > something that would be considered useful and worth contributing? > > Thanks, > Josef > > [1] http://lists.llvm.org/pipermail/llvm-dev/2016-January/094713.html > [2] https://github.com/oracle/graal/tree/master/sulong > [3] https://www.graalvm.org/ > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20190130/fbb0f972/attachment.html>
Josef Eisl via llvm-dev
2019-Jan-31 12:18 UTC
[llvm-dev] [RFC] Support embedding bitcodes in LLD with LTO
Thanks for your response! On 30/01/2019 20:18, Rui Ueyama wrote:> Hi Josef, > > Let me clarify my understanding. Do you want to keep original bitcode > files in the output executable when doing LTO, so that the resulting > executable contains both compiled bitcode (which is in native machine > instructions) and original bitcode files?Exactly! Kind of analogous to what `clang -fembed-bitcode -c` does, but for executables.> > Did you try embedding bitcode files into existing ELF files using > objcopy or linker option `--format=binary`?Yes, that is the alternative. However, having support in the linker for that would require less tweaking of exiting build systems. Adding an option to CFLAGS/LDFLAGS would then be sufficient.> > On Mon, Jan 28, 2019 at 6:41 AM Josef Eisl via llvm-dev > <llvm-dev at lists.llvm.org <mailto:llvm-dev at lists.llvm.org>> wrote: > > Hi everybody! > > I'm Josef and I'm working at Oracle Labs on Sulong [1,2], the LLVM IR > execution engine in GraalVM [3]. In addition to executing bare bitcode > files, Sulong also accepts ELF files with embedded bitcode sections. > Therefore, it would be great if LLD in (Full)LTO mode would support > embedding bitcode sections to the resulting object file. Is that > something that would be considered useful and worth contributing? > > Thanks, > Josef >