Compiler taxonomy: a compiler for a high-level language that runs on one machine (host) but produces executable code for a different target machine is called what?

Difficulty: Easy

Correct Answer: cross compiler

Explanation:


Introduction / Context:
Building software for embedded systems or new architectures often requires producing code for hardware different from the development host. This motivates a specific class of compiler that decouples build-time environment from runtime target. The question asks for the standard term for such a tool.


Given Data / Assumptions:

  • The compiler executes on host A (e.g., x86-64) but emits binaries for target B (e.g., ARM, RISC-V).
  • We do not assume any particular optimization level or number of passes.
  • The focus is on host-versus-target distinction.


Concept / Approach:
A cross compiler produces code for a different target architecture/ABI than the one it runs on. Toolchains such as gcc and clang can be configured as cross compilers with appropriate target triples, linkers, and libraries. This is distinct from optimizing level, pass structure, or pipeline organization.


Step-by-Step Solution:
1) Identify that host and target architectures differ.2) Recall the canonical term: “cross compiler.”3) Exclude unrelated characteristics like optimization or number of passes.


Verification / Alternative check:
Common toolchains ship as cross versions (e.g., aarch64-linux-gnu-gcc on x86 hosts) used to build firmware and OS images for other CPUs.


Why Other Options Are Wrong:

  • Optimizing: Describes optimization capability, not host/target difference.
  • One pass / multipass: Describe internal compiler architecture, not cross-targeting.
  • None of the above: Incorrect because cross compiler is the standard term.


Common Pitfalls:
Assuming “cross” implies inferior optimization. Cross compilers can be highly optimizing; “cross” refers solely to host vs target mismatch.


Final Answer:
cross compiler.

More Questions from Language Processors

Discussion & Comments

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