llvm-ld's output file names.

Hi Mikhail,

I have one more problem related to driver/llvm-ld at my hand for which i could not think of any solution. May be you can help.
We use llvm-ld as a linker to link .bc alongwith other .bc libs. example

$ llvm-ld foo.bc -l std -o tmp.bc

Now this command generates two files 1. tmp.bc (lli executable script) 2. tmp.bc.bc (the linked output .bc)

Now i am interested only in "tmp.bc.bc" and that is what should be passed as INFILE to further tools like llc.

So there is a disconnect , the OUTFILE name of llvm-ld is "tmp.bc" but the INFILE for llc is "tmp.bc.bc" .

Is this possible in driver? or should I hack llvm-ld?

- Sanjiv

Hi Sanjiv,

Sanjiv Gupta <sanjiv.gupta <at> microchip.com> writes:

Hi Mikhail,

I have one more problem related to driver/llvm-ld at my hand for which i
could not think of any solution. May be you can help.
[...]

Is this possible in driver? or should I hack llvm-ld?

On second thought, I think I'll add a workaround for this even if
llvm-ld's behaviour will be fixed (for example, by adding a
second '-o' option). You will be able to say the following:

(cmd_line "llc $(CALL AddBcSuffix, $INFILE)")

Will this modification solve your problem?

Mikhail Glushenkov wrote:

Hi Sanjiv,

Sanjiv Gupta <sanjiv.gupta <at> microchip.com> writes:

Hi Mikhail,

I have one more problem related to driver/llvm-ld at my hand for which i could not think of any solution. May be you can help.
[...]

Is this possible in driver? or should I hack llvm-ld?
    
On second thought, I think I'll add a workaround for this even if
llvm-ld's behaviour will be fixed (for example, by adding a
second '-o' option). You will be able to say the following:

(cmd_line "llc $(CALL AddBcSuffix, $INFILE)")

Will this modification solve your problem?

Hi Mikhail,

Thanks for giving it a thought. That should server my purpose.
Since I am only interested in the linked .bc output (not in the shell script), I am thinking that llvm-link should also server my purpose.
IMO, llvm-ld should be same as llvm-link + opt -O2.
But then I would need to make more modification in the driver.

Currently the best thing to me looks, as you said, adding the second option to llvm-ld.

- Sanjiv