Compiler technology — code generation across machines: A compiler that runs on one machine but produces executable code for a different target architecture is called a:

Difficulty: Easy

Correct Answer: cross compiler

Explanation:


Introduction / Context:
Toolchains often build software for platforms other than the one on which the compiler itself runs—common in embedded systems, mobile development, and operating system ports. Recognizing the term for this capability is fundamental in systems programming.



Given Data / Assumptions:

  • The host machine executes the compiler binary.
  • The generated code is intended for a different instruction set architecture (ISA) or ABI.
  • Typical examples include building ARM code on an x86 workstation.


Concept / Approach:

A cross compiler produces target code for an architecture different from the host. It differs from an optimizing compiler (which focuses on performance transformations), a one pass or multipass compiler (which describe compilation strategy), and native compilers (host and target are the same).



Step-by-Step Solution:

Identify the host-target mismatch requirement.Match the requirement with the definition of cross compilation.Eliminate options describing unrelated compiler traits (optimization, pass count).Select “cross compiler.”


Verification / Alternative check:

Widely used toolchains (e.g., GCC, Clang) provide triplets like x86_64-linux-gnu (native) and aarch64-none-elf (cross), reinforcing the terminology.



Why Other Options Are Wrong:

  • Optimizing compiler: may be cross or native; concerns transformations.
  • One pass / multipass: describe organization, not host vs. target relation.
  • None of the above: incorrect because cross compiler is the established term.


Common Pitfalls:

Confusing cross assemblers or linkers with compilers; all can be cross tools, but the question specifically asks about the compiler.


Final Answer:

cross compiler

More Questions from Operating Systems Concepts

Discussion & Comments

No comments yet. Be the first to comment!
Join Discussion