Closed gurneesh closed 6 years ago
Try compiling it with -fPIC flag, I've seen some people with this problem, but I'm still looking into it.
Thanks for the reply. I tried compiling it with -fPIC flag but error remains same. I wrote a parser and tried to use llvm for compiling with the help of your post on medium.
Can you provide me your OS and system specs? I just tried it with a new Ubuntu 16.04 and everything went fine.
Ubuntu 18.04 Core i5 5200u 8gb ram
And could you provide your GCC and LLVM versions please?
I just tried with Ubuntu 18.04 and LLVM 6.0 and I'm getting the same error. Maybe it's a problem with this LLVM version. On ubuntu 16.04 I was using an older one, 3.8.
I'm going to look into this problem and see if I can solve it
Ok, this seems to be a problem with LLVM 6 and GCC.
I tried doing the same thing with Clang and it worked.
If you have Clang, just change $ gcc output.o -o output
to $ clang output.o -o output
ok. Thanks for the help
gcc -no-pie output.o -o output
works too
After compiling with llc, when output.o file is compiled using gcc the error message flashes![screenshot from 2018-07-03 15-03-15](https://user-images.githubusercontent.com/26605645/42211881-3dbbbf66-7ed2-11e8-8f3d-6f1a18a8b8dd.png)