Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- int main() {
- printf("hallo");
- }
- clang -c -emit-llvm main.c
- opt -O3 main.bc -o optimized.bc
- llc -march=x86-64 -filetype=obj optimized.bc -o prog.o
- ld --verbose -static -lc prog.o -o prog --entry main
- ...
- attempt to open //usr/local/lib/x86_64-linux-gnu/libc.a failed
- attempt to open //lib/x86_64-linux-gnu/libc.a failed
- attempt to open //usr/lib/x86_64-linux-gnu/libc.a succeeded
- attempt to open prog.o succeeded
- prog.o
- prog.o: In function `main':
- optimized.bc:(.text+0xc): undefined reference to `printf'
- int main() {
- int a = 5;
- }
Add Comment
Please, Sign In to add comment