There are many high quality compilers which can generate optimized machine codes for modern general purpose processors. In case of embedded processors, however, their development cycles are too short to construct compilers for them in time, because compiler implementation requires a great deal of labor and time. Thus, building a compiler is often a bottleneck of developing embedded systems. One of the effective solutions for this problem is the retargetable compiler whose target can be changed with a little adoption.
Zephyr is a compiler infrastructure which is developed to be retargeted on various target machines. It makes the retargeting process simple by separating the compilation into machine-dependent parts and machine-independent parts. Developers can construct new compilers by adopting specifications of new processors to its machine-dependent parts.
However, few have reported the efficiency of retargeting process and the performance of compilation of Zephyr. So, we need to analyze and evaluate Zephyr as a retargeting tool.
In this paper, we present the retargeting strategy of Zephyr by implementing compiler for 8051 microcontroller. Also, we compare Zephyr with GNU C, a well known compiler infrastructure, from a view of easiness of the process of retargeting and efficiency of the retargeted compiler.