inkwell icon indicating copy to clipboard operation
inkwell copied to clipboard

Simple Example To Link Executable Using LLD

Open Pebaz opened this issue 6 years ago • 2 comments

How do I link a simple hello-world LLVM module into an executable using LLD? Per this documentation for LLVM, this is possible from code but I am not sure it is implemented in Inkwell.

Pebaz avatar Dec 25 '19 03:12 Pebaz

Sorry that I missed this question. LLD is a linker separate from LLVM so your question is a bit outside the scope of inkwell.

But you'd want to build some sort of output object file which you can then pass to LLD. I'm not sure if Inkwell has great support for building object files yet, but it might be possible.

TheDan64 avatar Feb 24 '20 00:02 TheDan64

I was trying to figure out how to write an object file and I found this issue. In case someone else is in the same situation: the TargetMachine::write_to_file or TargetMachine::write_to_memory_buffer functions are likely what you're looking for.

tomaka avatar Mar 15 '21 15:03 tomaka