The Raspberry Pi takes a lot of time to compile C code.
I want to accelerate that compilation. But I get a compilation error.
To do that, and because I already code on my PC, I want to use my PC, I would like to use LLVM (shipped with cygwin) to produce an LLVM assembly language version of the executable. And then, send it to the Raspberry Pi for final conversion to a native (ARM) executable.
I am hoping to get to a executable a lot faster because I could compile to LLVM language my code in parallel on my multi-core machine before linking (llvm-link).
The last step on the Raspberry Pi itself, translating LLVM language to executable binary would be short, I hope.
Let's take an example code:
#include <stdio.h>
int main(){
printf("0");
return 0;
}
Then on my PC, I run
clang a.c -emit-llvm -S
This produces a file called a.s an LLVM language version of the .c file
And then, I send a.s to the Raspberry Pi and run on it the command llc -filetype=obj a.s
to generate a.s.o an object file.
But when I want to create an executable on the Rasp Pi from this object file, I get an error:
clang a.s.o -o a.out
/usr/bin/ld: error: a.out uses VFP register arguments, a.s.o does not
/usr/bin/ld: failed to merge target specific data of file a.s.o
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I tried using the following flags -marm -mfloat-abi=hard -mfpu=vfp
with clang on the last step but that fails with the same errors.
Do you know how to solve this error or have some suggestions that would help me using LLVM to speed up my compilation process?
Thanks in advance