Hello,<br><br>I've been trying to build some normal linux applications with clang and I keep running into a snag in configure scripts. Perhaps these scripts are not written very well, but the current clang behavior seems strange. When I run clang with the -emit-llvm option, it still uses /usr/bin/ld as the linker which fails to compile llvm bitcode on linux (though it works on mac). Here's a simple example:<br>
<br><span style="font-family: courier new,monospace;">$ cat > test.c</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">int main(void) { return 0; }</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">$ clang -emit-llvm test.c</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">/tmp/cc-pDfs56.o: file not recognized: File format not recognized</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">clang: error: linker command failed with exit code 1 (use -v to see invocation)</span><br><span style="font-family: courier new,monospace;">$ clang -emit-llvm test.c -c<br>
$<br></span><br><font face="arial,helvetica,sans-serif">It seems to me that clang should call llvm-ld when it generates llvm code and ld otherwise, but maybe there's something that I have configured incorrectly. What is the appropriate way to address this?<br>
<br>Thanks.<br style="font-family: courier new,monospace;" clear="all"></font><br>-- <br>gregory malecha<br>