With MLIR one can lower a specification to LLVM IR level.
What I would like to do is to convert this code into object files (on various architectures and with various conventions, e.g. PIC), so as to include it into projects.
Is there a piece of documentation on how to do this?
I have found an option in mlir-cpu-runner that outputs object code, but:
- It still requires the execution of code, which I don’t necessarily want as part of my compilation flow.
- Generates an object file with options I don’t know how to manage on my MacBook 64-bit machine (trying to include it into projects gives the following error:
cpu-runner-example > gcc main.o externc.c -o main ld: warning: PIE disabled. Absolute addressing (perhaps -mdynamic-no-pic) not allowed in code signed PIE, but used in _main from main.o. To fix this warning, don't compile with -mdynamic-no-pic or link with -Wl,-no_pie
Thank you in advance,