How to add a tool to a GCC toolchain?

112 views Asked by At

I am currently working on the toolchain for a processor that has been developed at my university. The processor is closely based on OpenRISC (orpsocv2 has been used as a baseline). Building programs for that platform requires that some custom instructions are added to the binary. I already implemented tools that modify assembly code accordingly (utilizing regular expressions). However, I am looking for a way to integrate it with the GNU toolchain of OpenRISC.

A regular toolchain consists of the following tools: preprocessor -> compiler -> assembler -> linker

I need my adaptations to be integrated somewhere after compilation (because I require information about the basic blocks that will be present in the binary) and before linking (because afterwards things get messy when you try to change addresses).

Now my question: Is there an easy way to add another tool between the compiler and the assembler of the GNU toolchain?

I don't want to do that manually in the Makefile, because I would like to have the tools as compatible as possible to existing software projects.

So far, I haven't been able to find anything related in the GCC documentation or the web.

0

There are 0 answers