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 called ___________
a) Assembler
b) Linking loader
c) Cross compiler
d) None of the mentioned
View Answer

Answer: b
Explanation: The definition of cross compiler.

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

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

3. Cross-compiler is a compiler __________
a) Which is written in a different language from the source language?
b) That generates object code for the machine it’s running on.
c) Which is written in the same language as the source language?
d) That runs on one machine but produces object code for another machine
View 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.
advertisement
advertisement

4. Cross compiler is used in Bootstrapping.
a) True
b) False
View Answer

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

5. Is GCC a cross Complier.
a) Yes
b) No
View Answer

Answer: a
Explanation: GCC, a free software collection of compilers, also can be used as cross compile. It supports many languages and platforms.
Note: Join free Sanfoundry classes at Telegram or Youtube

6. The __________ is a technique for building cross compilers for other machines.
a) Brazilian Cross
b) Canadian Cross
c) Mexican Cross
d) X-cross
View 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.

7. __________ was developed from the beginning as a cross compiler.
a) Free Pascal
b) GCC
c) Pascal
d) None of the mentioned
View 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.
advertisement

Sanfoundry Global Education & Learning Series – Compilers.

To practice all areas of Compilers, here is complete set of 1000+ Multiple Choice Questions and Answers.

advertisement

If you find a mistake in question / option / answer, kindly take a screenshot and email to [email protected]

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.