Guest User

Untitled

a guest
Apr 23rd, 2018
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. #include<stdio.h>
  2.  
  3. int main() {
  4. printf("hallo");
  5. }
  6.  
  7. clang -c -emit-llvm main.c
  8. opt -O3 main.bc -o optimized.bc
  9. llc -march=x86-64 -filetype=obj optimized.bc -o prog.o
  10. ld --verbose -static -lc prog.o -o prog --entry main
  11.  
  12. ...
  13. attempt to open //usr/local/lib/x86_64-linux-gnu/libc.a failed
  14. attempt to open //lib/x86_64-linux-gnu/libc.a failed
  15. attempt to open //usr/lib/x86_64-linux-gnu/libc.a succeeded
  16. attempt to open prog.o succeeded
  17. prog.o
  18. prog.o: In function `main':
  19. optimized.bc:(.text+0xc): undefined reference to `printf'
  20.  
  21. int main() {
  22. int a = 5;
  23. }
Add Comment
Please, Sign In to add comment