CompilerMCQ Computer Science

Compilers Questions and Answers – Cross Compiler – 1

This set of Compilers Multiple Choice Questions & Answers (MCQs) focuses on “Cross Compiler”.

 

  1. A system program that combines separately compiled modules of a program into a form suitable for execution is
  2. a) Assembler
  3. b) Linking loader
  4. c) Cross compiler
  5. d) None of the mentioned

Answer

 

Answer: b

Explanation: The definition of cross compiler.

  1. A compiler for a high-level language that runs on one machine and produces code for a different machine is called
  2. a) Optimizing compiler
  3. b) One pass compiler
  4. c) Cross compiler
  5. d) Multipass compiler

Answer

 

Answer: c

Explanation: So done by the definition.

  1. Cross-compiler is a compiler
  2. a) Which is written in a different language from the source language?
  3. b) That generates object code for the machine it’s running on.
  4. c) Which is written in the same language as the source language?
  5. d) That runs on one machine but produces object code for another machine

Answer

 

Answer: a

Explanation: A compiler for a high-level language that runs on one machine and produces code for a different machine is called a cross compiler.

  1. Cross compiler is used in Bootstrapping.
  2. a) True
  3. b) False

Answer

 

Answer: a

Explanation: Bootstrapping to a new platform. When a software is developed for a new platform, a cross compiler is used to compile necessary tools such as the OS and a native compiler.

  1. Is GCC a cross Complier
  2. a) Yes
  3. b) No

Answer

 

Answer: a

Explanation:

GCC, a free software collection of compilers, also can be used as cross compile. It supports many languages and platforms.

  1. The __________ is a technique for building cross compilers for other machines
  2. a) Brazilian Cross
  3. b) Canadian Cross
  4. c) Mexican Cross
  5. d) X-cross

Answer

 

Answer: b

Explanation: The Canadian Cross is a technique for building cross compilers for other machines. Given three machines X, Y, and Z, one uses machine X (e.g. running Windows XP on an IA-32 processor) to build a cross compiler that runs on machine Y (e.g. running Mac OS X on an x86-64 processor) to create executables for machine Z.

  1. __________ was developed from the beginning as a cross compiler
  2. a) Free Pascal
  3. b) GCC
  4. c) Pascal
  5. d) None of the mentioned

Answer

 

Answer: a

Explanation: Free Pascal was developed from the beginning as a cross compiler. The compiler executable (ppcXXX where XXX is target architecture) is capable of producing executables for all OS of the same architecture.

Next

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button