gcc compilation process..

gcc -Iproj/src myfile.c -o myfile
gcc -c myfile.c "compile without linking
gcc -D DEBUG myfile.c -o myfile
gcc -glevel  "level=0,1,3,null
"gcc -l links with a library file.
"gcc -L looks in directory for library files. "Link -l with library name without the lib prefix and the .a or .so extensions
gcc myfile.c -o myfile
gcc -Wall  "enable all warnings..

gcc

-I -L -l -D -g -O -o -Wall

about the -0 option.. ref to the following table..

Set the compiler‘s optimization level.

option optimization level execution time code size memory usage compile time
-O0 optimization for compilation time (default) + + - -
-O1 or -O optimization for code size and execution time - - + +
-O2 optimization more for code size and execution time --   + ++
-O3 optimization more for code size and execution time ---   + +++
-Os optimization for code size   --   ++
-Ofast O3 with fast none accurate math calculations ---   + +++

+increase ++increase more +++increase even more -reduce --reduce more ---reduce even more

时间: 2024-10-10 06:27:28

gcc compilation process..的相关文章

Four stages of GCC compilation

There are four stages for GCC to compile c/c++ applications: Preprocessing, Compilation proper, Assembly, Linking. The following table illustrates input, output, gcc options in the foure stages. Here is a example for the stages of compiling a c++ app

Introduction to C Memory Management and C++ Object-Oriented Programming

C is used when at least one of the following matters: Speed Memory Low-level features(moving the stack pointer, etc.). Level of abstraction Languages Directly manipulate memory Assembly(x86,MIPS) Access to memory C,C++ Memory managed Java,C#,Scheme/L

gcc -M -MM -MQ -MF -MT -MD

静态模式规则对一个较大工程的管理非常有用.它可以对整个工程的同一类文件的重建规则进行一次定义,而实现对整个工程中此类文件指定相同的重建规则.比如,可以用来描述整个工程中所有的.o 文件的依赖规则和编译命令.通常的做法是将生成同一类目标的模式定义在一个 make.rules 的文件中.在工程各个模块的 Makefile 中包含此文件. gcc -M: output a rule suitable for make describing the dependencies of the main so

MinGW - GCC 6.1.0

GCC 6.1 mingw-gcc-6.1.7z 极限压缩(39.8MB) https://sourceforge.net/projects/mingwbundle/files/GCC%206.1.0/ https://gcc.gnu.org/gcc-6/changes.html GCC 6 Release Series — Changes, New Features, and Fixes - GNU Project - Free Software Foundation (FSF) GCC 6

Raspberry Pi Kernel Compilation 内核编译官方文档

elinux.org/Raspberry_Pi_Kernel_Compilation#Use_the_provided_compiler Software & Distributions: Software - an overview. Distributions - operating systems and development environments for the Raspberry Pi. Kernel Compilation - advice on compiling a ker

php script 的生命周期

原文地址:https://support.cloud.engineyard.com/hc/en-us/articles/205411888-PHP-Performance-I-Everything-You-Need-to-Know-About-OpCode-Caches The Execution Life-cycle PHP is a scripting language, which most people take to mean that it is not compiled. Whil

C++开源库集合

| Main | Site Index | Download | mimetic A free/GPL C++ MIME Library mimetic is a free/GPL Email library (MIME) written in C++ designed to be easy to use and integrate but yet fast and efficient. It is based on the C++ standard library and heavily us

scientific linux 6.x 下安裝 chrome

scientific linux 6.x 不再支援 chrome,連上 google 網站直接下載 chrome 的 rpm 檔案裝,會顯示缺少相依性套件,就算安裝了這些缺的套件,還是會再顯示缺其它套件,陷入一個無窮迴圈! 於是有人寫了安裝 chrome 的 shell script,真是佛心來著!! How to install Google Chrome 28+ on RHEL/CentOS 6 or 7 How to install Google Chrome 28+ on RHEL/Ce

Building C Projects

C is a compiled language, and as such, C programs need to be converted to executables in order to use them.  Typically, programmers do this with some sort of build system, rather than running the necessary commands manually, because the compilation p