[LLVMdev] Whole program compile/link

Devang Patel devang.patel at gmail.com
Mon Jul 27 10:50:30 PDT 2009

On Sun, Jul 26, 2009 at 5:25 AM, Richard Pennington<rich at pennware.com> wrote:
> Hi,
> I have a little conundrum. I want to bitcode link a whole program, but
> I've run into a roadblock. During code generation on a processor that
> doesn't support e.g. floating point, a floating point mul is turned into
> a function call. This isn't known at bitcode linking time so the
> appropriate bitcode for the mul isn't linked.
> Is there a pass I can run that will do the appropriate conversion to the
> bitcode so that I can get the bitcode mul pulled in?
> I suppose that an option would be to put the support stuff in a file
> that is linked in always and let the optimizer drop functions that
> aren't referenced. :-(

We ran into to this. There is not any easy solution here. The
optimizer does not know what not to destroy if the code generator
introduces new uses after optimization phase.  One solution is to keep
this support functions in native .a (archive file) and let native
linker complete the final link stage to link in these support


More information about the llvm-dev mailing list