[llvm-commits] PATCH: New option for bitcode output file in llvm-ld

sanjiv gupta sanjiv.gupta at microchip.com
Thu Jul 16 10:05:44 PDT 2009


On Wed, 2009-07-15 at 22:21 -0700, Nick Lewycky wrote:
> sanjiv gupta wrote:
> > The patch adds an option -b < filename > to specify the name of the
> > bitcode output file. If -b isn't specified then llvm-ld falls back to
> > its existing behavior.
> > 
> > Let me know if its good to go.
> 
> Your description of the option made me say "what?" several times. Please 
> try to clarify it.
> 
> This patch doesn't change the behaviour when llvm-ld emits a shell 
> script. I would've expected it (based on the name and description) to 
> change the name of the .bc file that the shell script runs.
> 
Right. I missed to make that change.

> It's still not clear to me what problem this is solving for you. Why not 
> just use "-link-as-library -o"?
> 
> Nick

I want to use llvm-ld as a linker to link a user program with required
libraries (also bitcode) and generate the linked .bc file with the name
that user has specified.  That linked .bc file will then be passed to
the llc to generate native code. (I am not sure whether -link-as-library
serves the same purpose. )

Now about the problem that it solves.
The llvmc driver framework is a graph based model whether output
filename of one tool goes as input filename of another tool. i.e.
llvm-ld's output file name goes as input file name to llc. So even after
specifying the -o hello.bc, the linked .bc file generated is
hello.bc.bc, and llc receives only hello.bc as input file name.

- Sanjiv


> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits




More information about the llvm-commits mailing list