World Library  
Flag as Inappropriate
Email this Article

Retargetable compiler

Article Id: WHEBN0012082174
Reproduction Date:

Title: Retargetable compiler  
Author: World Heritage Encyclopedia
Language: English
Subject: Z88DK, Amsterdam Compiler Kit, Small Device C Compiler
Publisher: World Heritage Encyclopedia

Retargetable compiler

This article is about software development tools. For the Internet marketing term, see behavioral retargeting.

In software engineering, retargeting is an attribute of software development tools that have been specifically designed to generate code for more than one computing platform.


A retargetable compiler is a compiler that has been designed to be relatively easy to modify to generate code for different CPU instruction set architectures. The machine code produced by these is sometimes of lower quality than that produced by a compiler developed specifically for a single processor.

A retargetable compiler is a kind of cross compiler. Often (but not always) a retargetable compiler is portable (the compiler itself can run on several different CPUs) and self-hosting.

The goal of easily retargeting the compiler conflicts to some degree with the goal of providing fast execution and small code size. The optimization of code for some high performance processors requires a detailed and specific knowledge of the architecture and how the instructions are executed. The optimizations usually done by a retargetable compiler are only those applicable to any processor. This is unless developers have taken the large amount of time necessary to write a code generator specifically for an architecture.

A general-purpose global optimizer followed by machine-specific peephole optimization can work well.[1]

Examples of retargetable compilers:


Conversely, retargetable assemblers are capable of generating object files of different formats, which is useful in porting assembly language programs to various operating systems that run on the same CPU architecture (such as Windows and Linux on the x86 platform). NASM is one such assembler.

Further reading

External links

  • LANCE compiler website
  • The LLVM compiler infrastructure website
  • The (open-source) ACK sourceforge page
  • Nils Weller's C compiler page
This article was sourced from Creative Commons Attribution-ShareAlike License; additional terms may apply. World Heritage Encyclopedia content is assembled from numerous content providers, Open Access Publishing, and in compliance with The Fair Access to Science and Technology Research Act (FASTR), Wikimedia Foundation, Inc., Public Library of Science, The Encyclopedia of Life, Open Book Publishers (OBP), PubMed, U.S. National Library of Medicine, National Center for Biotechnology Information, U.S. National Library of Medicine, National Institutes of Health (NIH), U.S. Department of Health & Human Services, and, which sources content from all federal, state, local, tribal, and territorial government publication portals (.gov, .mil, .edu). Funding for and content contributors is made possible from the U.S. Congress, E-Government Act of 2002.
Crowd sourced content that is contributed to World Heritage Encyclopedia is peer reviewed and edited by our editorial staff to ensure quality scholarly research articles.
By using this site, you agree to the Terms of Use and Privacy Policy. World Heritage Encyclopedia™ is a registered trademark of the World Public Library Association, a non-profit organization.

Copyright © World Library Foundation. All rights reserved. eBooks from Project Gutenberg are sponsored by the World Library Foundation,
a 501c(4) Member's Support Non-Profit Organization, and is NOT affiliated with any governmental agency or department.