After codegen to LLVM IR, there's a few other steps that need to be taken to actually create an executable:
- Run LLVM's codegen backend to convert the IR to target assembly (
llc)
- Assemble the target code into an object file (
as or gcc -c)
- Compile the c driver into an object file (
gcc -c)
- Link the target object file and driver into an executable (
ld or gcc)
Steps 3 and 4 can be combined into a single gcc command. Anyway, ideally this would all be done in software, but it's a fair amount of boilerplate code to call LLVM's build pipeline that I'm not focusing on while I'm working on the frontend. For now, it would be best to create a makefile and some documentation that can build any given femto source file, assemble it, and link it with a driver.
After codegen to LLVM IR, there's a few other steps that need to be taken to actually create an executable:
llc)asorgcc -c)gcc -c)ldorgcc)Steps 3 and 4 can be combined into a single gcc command. Anyway, ideally this would all be done in software, but it's a fair amount of boilerplate code to call LLVM's build pipeline that I'm not focusing on while I'm working on the frontend. For now, it would be best to create a makefile and some documentation that can build any given femto source file, assemble it, and link it with a driver.