I tried to generate LLVM intermediate code by calling
llvm-gcc -emit-llvm -I/mypath/ -c main.c -o main.o
It works perfectly without any warnings or errors if I manually type this command in the terminal.
However I have built a website that can automate this process by calling exec function in PHP like below.
exec("llvm-gcc -emit-llvm -I/mypath/ -c main.c -o main.o",$msg,$ret);
It will still generate .o file with a warning. The warning says that
Potential incompatible plugin version. GCC: 4.5.3. Expected: 4.5.4
Defines 'dragonegg_disable_version_check' as env variable to remove this warning.
Please note that unexpected errors might occur.
The php command will still return 0, which is successful. However when I run the generated .o file, it will throw invalid bitcode signature error.
The server is running ubuntu and Apache. My llvm-gcc version is 2.9 which uses 4.2.1 gcc.
Any help will do. Thank you!