[LLVMdev] Creating a shared library from a module

Tim Northover t.p.northover at gmail.com
Wed Dec 11 10:35:10 PST 2013


> Assuming that clang cooperates with the linker would it be sensible to
> track what path is taken when specifying -shared -fPIC? This should give
> me hints what is needed.?

What Clang does is gets LLVM to output a temporary .o file and then
constructs a command-line to call the linker as a separate process. If
that's a good enough solution for you then passing clang an extra "-v"
option will get it to show you exactly how it invokes the linker and
you can copy the key bits into your own program.

Cheers.

Tim.



More information about the llvm-dev mailing list