Friday, February 21, 2020

Week 4 Reflection - compiler



This week I learned  compiler

Through this lecture, I understood compile option had a specific meaning.

when you compile cpp file through the matrix you use this command


    -----<         gcc++  filename -std=c++0x             >-----


let's see what it is mean.


gcc++ : When you invoke gcc, it normally does preprocess, compilation, assembly, and linking.


-std=: determine the language standard.


c++0x: the working draft of the upcoming iso c++  0x standard.


also, there are many options.



-c option: it means not to run the linker.


-o file_name: place output in file file_name


-v : print the commands executed to run the stages of compilation.


-fno-builtin: do not recognize built-in functions that do not begin with _builtin_ as prefix.


-static: on systems that support dynamic linking, this prevents linking with the shared libraries.


-g: enable debugging information


-o0: do not optimize


-f:display header information for the entire file


-s: display per-section summary information


-d:disassemble sections containing code


--source: show source code, if available, along with disassembly


The output file name is a.out which means assembly.out.


https://linux.die.net/man/1/gcc

No comments:

Post a Comment