Cross-Compiler vs Optimizing / Single-Pass / Multi-Pass: Correct Choice

Cross-Compiler vs Optimizing / Single-Pass / Multi-Pass: Correct Choice

Verified Sources
Nov 3, 2026

You are asked:

“A compiler for a high-level language that runs on one machine and produce code for different machines is called”
(i) optimizing compiler
(ii) one-pass compiler
(iii) cross-compiler
(iv) multipass compiler

The correct option is (iii) cross-compiler. A keyword cross-compiler generates code for a target different from the host machine where the compiler runs. This contrasts with keyword one-pass compilation and keyword multi-pass compilation, which describe how many passes are used—not where the code runs. 3

To see why quickly:

  • Cross-compiler → host machine ≠ target machine. 2
  • One-pass / multipass → concerns compilation strategy (single traversal vs multiple passes).
  • Optimizing compiler → focuses on applying optimizations (not about host/target separation).

Footnotes

  1. Cross compiler - Wikipedia - Defines cross-compiler as generating code for a platform other than where the compiler runs. ↩ ↩2

  2. CrossCompiling (Debian Wiki) - Describes cross-compiling as compiling for an architecture other than the compiling machine; discusses host vs target. ↩ ↩2

  3. One-pass compiler - Wikipedia - Defines one-pass vs multi-pass compilers and key characteristics. ↩ ↩2

  4. Optimizing compiler - Wikipedia - Defines optimizing compilers and what optimization aims to improve. ↩

Cross-compilation & toolchain basics (host vs target)

Vocabulary used in this question

To answer precisely, distinguish these classification dimensions:

  1. Host vs Target (machine where compiler runs vs machine for generated code): determines cross-compiler.
  2. Number of passes: determines one-pass vs multi-pass.
  3. Optimization purpose: determines optimizing compiler.

Key terms:

  • keyword (where the compiler runs)
  • keyword
  • keyword

Footnotes

  1. CrossCompiling (Debian Wiki) - Describes cross-compiling as compiling for an architecture other than the compiling machine; discusses host vs target. ↩ ↩2 ↩3 ↩4

  2. One-pass compiler - Wikipedia - Defines one-pass vs multi-pass compilers and key characteristics. ↩

  3. Optimizing compiler - Wikipedia - Defines optimizing compilers and what optimization aims to improve. ↩

Choose the correct option (reasoning steps)

  1. 1
    Step 1

    The phrase “runs on one machine and produce code for different machines” indicates a host ≠ target relationship.

  2. 2
    Step 2

    A compiler that creates executables for a platform other than the one it runs on is called a keyword cross-compiler.

    Footnotes

    1. Cross compiler - Wikipedia - Defines cross-compiler as generating code for a platform other than where the compiler runs. ↩

  3. 3
    Step 3

    “one-pass” and “multipass” describe compilation strategy (how many passes), not host/target separation. “optimizing compiler” describes optimization, not platform difference.

    Footnotes

    1. One-pass compiler - Wikipedia - Defines one-pass vs multi-pass compilers and key characteristics. ↩

    2. Optimizing compiler - Wikipedia - Defines optimizing compilers and what optimization aims to improve. ↩

  4. 4
    Step 4

    Therefore, the correct answer is (iii) cross-compiler.

Why option (iii) fits best

Mapping each option to what the question describes (host ≠ target).

Quick FAQ: common confusion

Pro Tip

When a question mentions “runs on one machine” vs “code for different machines,” it’s almost always pointing to keyword cross-compilers (host vs target).

Exam trap

“one-pass” and “multipass” sound like they relate to generating different machine code, but they only describe the number of compilation passes. The host/target difference is what defines cross-compiler.

How classification labels relate to compiler behavior

Cross-compiler

Host vs Target framing

Compiler runs on a host machine but outputs code meant for a different target platform. 2"

Footnotes

  1. Cross compiler - Wikipedia - Defines cross-compiler as generating code for a platform other than where the compiler runs. ↩

  2. CrossCompiling (Debian Wiki) - Describes cross-compiling as compiling for an architecture other than the compiling machine; discusses host vs target. ↩

One-pass vs Multi-pass

Pass-count framing

Compilers traverse/process source or IR once vs multiple times. "

Footnotes

  1. One-pass compiler - Wikipedia - Defines one-pass vs multi-pass compilers and key characteristics. ↩

Optimizing compiler

Transformation framing

Applies optimization transformations to improve efficiency. "

Footnotes

  1. Optimizing compiler - Wikipedia - Defines optimizing compilers and what optimization aims to improve. ↩

Knowledge Check

Question 1 of 4
Q1Single choice

A compiler that runs on one machine but produces code for a different machine is called

Explore Related Topics

1

Operating System Types and the Correct Answer: Multi-user OS

A multi‑user operating system is the sole OS type that enables multiple users to access the same computer concurrently by sharing CPU time and resources while keeping their sessions isolated.

  • Uses time‑sharing and process scheduling to create the illusion of simultaneous execution (Perceived Simultaneity≈Rapid Switching Among User Processes\text{Perceived Simultaneity} \approx \text{Rapid Switching Among User Processes}).
  • Provides separate authentication, permissions, and protected memory for each user.
  • Contrasts with single‑user, batch, and embedded OSes, which do not support concurrent interactive users.
  • Typical examples include Unix/Linux servers and some Windows NT configurations.
2

Compiler Optimizations: Choosing the Correct Loop-Transformation Answer

3

Understanding the MCQ: Compiler, Interpreter, Loader/Linker, or None?

The MCQ conflates formal‑machine concepts (a Turing‑like Machine MM with an unbounded tape) with programming‑language tools, making “None of the mentioned” the only academically correct choice.

  • An infinite tape is a modeling assumption; any actual computation uses only a finite portion.
  • Compilers translate whole programs, interpreters execute statements incrementally, and loaders/linkers build/run executables—they do not bound the tape.
  • An “infinite language” is a set of strings, not a single infinite input to MM.
  • The correct answer is  (iv) None of the mentioned .\,\boxed{\text{(iv) None of the mentioned}}\,.
  • In exams, identify domain mismatches and choose the option that rejects the inconsistency.