[LLVMdev] Trouble executing binary compiled by llvm

Yu, Chan KitX chan.kitx.yu at intel.com
Sun Dec 21 18:59:48 PST 2014


Bump?

From: Yu, Chan KitX
Sent: Thursday, December 18, 2014 10:07 AM
To: llvmdev at cs.uiuc.edu
Subject: Trouble executing binary compiled by llvm

Hello all,

I tried compiling llvm 3.3 (I'm using this version because of my work requirement) and it went on happily. Then when I tried compiling a sample C code:

int main(){return 0;}

with:

clang -L/usr/lib/x86_64-poky-linux/4.8.2/ -I/usr/lib/x86_64-poky-linux/4.8.2/ -target x86_64-poky-linux test.c -gcc-toolchain /usr/lib/gcc/x86_64-poky-linux/4.8.2/ -v

and executing the resulting a.out file, it said:

sh : ./a.out: No such file or directory

Here's the verbose message of the compilation:

_64-poky-linux/4.8.2/ -target x86_64-poky-linux test.c -gcc-toolchain /usr/lib/gcc/x86_64-poky-linux/4.8.2/ -v
clang version 3.3 (tags/RELEASE_33/final)
Target: x86_64-poky-linux
Thread model: posix
"/usr/bin/clang" -cc1 -triple x86_64-poky-linux -emit-obj -mrelax-all -disable-free -disable-llvm-verifier -main-file-name test.c -mrelocation-model static -mdisable-fp-elim -fmath-errno -masm-verbose -mconstructor-aliases -munwind-tables -target-cpu x86-64 -target-linker-version 2.24 -v -resource-dir /usr/bin/../lib/clang/3.3 -I /usr/lib/x86_64-poky-linux/4.8.2/ -internal-isystem /usr/local/include -internal-isystem /usr/bin/../lib/clang/3.3/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -fdebug-compilation-dir /home/root -ferror-limit 19 -fmessage-length 80 -mstackrealign -fobjc-runtime=gcc -fobjc-default-synthesize-properties -fdiagnostics-show-option -fcolor-diagnostics -backend-option -vectorize-loops -o /tmp/test-1ngTem.o -x c test.c
clang -cc1 version 3.3 based upon LLVM 3.3 default target x86_64-poky-linux-gnu
ignoring nonexistent directory "/usr/local/include"
ignoring nonexistent directory "/usr/bin/../lib/clang/3.3/include"
ignoring nonexistent directory "/include"
#include "..." search starts here:
#include <...> search starts here:
/usr/lib/x86_64-poky-linux/4.8.2
/usr/include
End of search list.
"/usr/bin/x86_64-poky-linux-ld" --eh-frame-hdr -m elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2 -o a.out /usr/lib/crt1.o /usr/lib/crti.o /usr/lib/crtbegin.o -L/usr/lib/x86_64-poky-linux/4.8.2/ -L/usr/lib/x86_64-poky-linux -L/lib -L/usr/lib /tmp/test-1ngTem.o -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/lib/crtend.o /usr/lib/crtn.o

I have several questions here:


1.       An obvious one; Why my error is happening?

2.       I also noticed that the verbose message didn't find (or try to find) a candidate GCC installation . Any possible reason?

3.       It seems like LLVM+Clang depends on gcc in some way. In what way do LLVM+Clang depend on gcc?


Thanks,
Chan Kit
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20141222/b25e06d7/attachment.html>


More information about the llvm-dev mailing list