llvm-ld file not recognized: File format not recognized

Hi,
When using llvm-ld to link .bc files(compiled with llvm-gcc with option --emit-llvm), I went into error like: file not recognized: File format not recognized.

I was confused because llvm-ld is the LLVM linker to link llvm bitcode files together, then why this error occurred?

I am using llvm 2.9 and the corresponding binary version of llvm-gcc.

It will be appreciated if anyone of you can help.

Cheers,
Ben Li

Hi,

When using llvm-ld to link .bc files(compiled with llvm-gcc with option
--emit-llvm), I went into error like: file not recognized: File format not
recognized.

I was confused because llvm-ld is the LLVM linker to link llvm bitcode files
together, then why this error occurred?

I am using llvm 2.9 and the corresponding binary version of llvm-gcc.

Unfortunately, both llvm-gcc and llvm-ld are dead these days.

I'm assuming you're on some OS X variant, in which case the preferred
replacement for llvm-gcc is Clang. Dragonegg is a replacement GCC/LLVM
bridge, primarily designed to allow people to run code in non-C/C++
languages that GCC supports (Fortran, Ada, ...).

For llvm-ld, the task of linking together .bc files is now done by
llvm-link. For its other features you'll want your system linker.

Cheers.

Tim.

Hi,
When using llvm-ld to link .bc files(compiled with llvm-gcc with option
--emit-llvm), I went into error like: file not recognized: File format not
recognized.

I was confused because llvm-ld is the LLVM linker to link llvm bitcode
files together, then why this error occurred?

I am using llvm 2.9 and the corresponding binary version of llvm-gcc.

Do you have to use llvm 2.9 to fulfill your work? llvm 2.9 is a relatively
old version and newer versions don't contain llvm-ld any longer.
For llvm-ld, would you please share the exact error message? Or have a try
for llvm-link if you don't have a need to link llvm archieves?