The meaning of verbose is lengthy and complicated. As the name implies, the GCC--verbose means to print out the details of the connection when it is compiled.
Refer to the article in the StackOverflow with their own machine information to give the analysis (in fact, translated a bit). Hey. Original site: http://stackoverflow.com/questions/13440549/gcc-verbose-mode-output-explanation)
First give the overall information:
[Email protected]:~/apue3/chapter11$ gcc printids.c. /error/error.o-pthread-vusing built-inchspecs. COLLECT_GCC=Gcccollect_lto_wrapper=/usr/lib/gcc/i686-linux-gnu/4.8/lto-wrappertarget:i686-linux-gnuconfigured with:../src/configure-v--with-pkgversion='Ubuntu 4.8.2-19ubuntu1'--with-bugurl=file:///Usr/share/doc/gcc-4.8/readme. Bugs--enable-languages=c,c++,java,go,d,fortran,objc,obj-c++--prefix=/usr--program-suffix=-4.8--enable-shared-- Enable-linker-build-id--libexecdir=/usr/lib--without-included-gettext--enable-threads=posix-- with-gxx-include-dir=/usr/include/c++/4.8--libdir=/usr/lib--enable-nls--with-sysroot=/--enable-clocale=gnu-- Enable-libstdcxx-debug--enable-libstdcxx-time=yes--enable-gnu-unique-object--disable-libmudflap--enable-plugin --with-system-zlib--disable-browser-plugin--enable-java-awt=gtk--enable-gtk-cairo--WITH-JAVA-HOME=/USR/LIB/JVM /java-1.5.0-gcj-4.8-i386/jre--enable-java-home--with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.8-i386-- With-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.8-i386--with-arch-directory=i386--with-ecj-jar=/usr/ Share/java/eclipse-ecj.jar--enable-objc-gc--enable-targets=all--enable-multiarch--disable-werror--with-arch-32 =i686--with-multilib-list=m32,m64,mx32--with-tune=generic--enable-checking=release--build=i686-linux-gnu--host=i686-linux-gnu--target=i686-linux-gnu Thread MODEL:POSIXGCC Version4.8.2(Ubuntu4.8.2-19ubuntu1) collect_gcc_options='-pthread' '- v' '-mtune=generic' '-march=i686'/usr/lib/gcc/i686-linux-gnu/4.8/cc1-quiet-v-imultiarch i386-linux-gnu-d_reentrant printids.c-quiet-dumpbase printids.c-mtune=generic-march=i686- Auxbase Printids-version-fstack-protector-wformat-wformat-security-o/tmp/Cch2lot0.sgnu C (Ubuntu4.8.2-19UBUNTU1) version4.8.2(i686-linux-GNU) compiled by GNU C version4.8.2, GMP version5.1.3, MPFR version3.1.2-P3, MPC version1.0.1GGC Heuristics:--param ggc-min-expand=98--param ggc-min-heapsize=128190Ignoring nonexistent directory"/usr/local/include/i386-linux-gnu"Ignoring nonexistent directory"/usr/lib/gcc/i686-linux-gnu/4.8/. /.. /.. /.. /i686-linux-gnu/include"#include"..."search starts here: #include<...>Search starts here:/usr/lib/gcc/i686-linux-gnu/4.8/include/usr/local/include/usr/lib/gcc/i686-linux-gnu/4.8/include-fixed/usr/include/i386-linux-GNU/usr/includeend of search list. GNU C (Ubuntu4.8.2-19UBUNTU1) version4.8.2(i686-linux-GNU) compiled by GNU C version4.8.2, GMP version5.1.3, MPFR version3.1.2-P3, MPC version1.0.1GGC Heuristics:--param ggc-min-expand=98--param ggc-min-heapsize=128190Compiler executable Checksum:941e2c230f6d43dfe1ded1af71b0be9dcollect_gcc_options='-pthread' '- v' '-mtune=generic' '-march=i686' as-V-- +-o/tmp/ccllybyf.o/tmp/CCH2LOT0.SGNU Assembler Version2.24(I686-LINUX-GNU)usingBFD Version (GNU Binutils forUbuntu)2.24Compiler_path=/usr/lib/gcc/i686-linux-gnu/4.8/:/usr/lib/gcc/i686-linux-gnu/4.8/:/usr/lib/gcc/i686-linux-gnu/:/usr/lib/gcc/i686-linux-gnu/4.8/:/usr/lib/gcc/i686-linux-gnu/Library_path=/usr/lib/gcc/i686-linux-gnu/4.8/:/usr/lib/gcc/i686-linux-gnu/4.8/.. /.. /.. /i386-linux-gnu/:/usr/lib/gcc/i686-linux-gnu/4.8/.. /.. /.. /.. /lib/:/lib/i386-linux-gnu/:/lib/. /lib/:/usr/lib/i386-linux-gnu/:/usr/lib/. /lib/:/usr/lib/gcc/i686-linux-gnu/4.8/.. /.. /.. /:/lib/:/usr/lib/collect_gcc_options='-pthread' '- v' '-mtune=generic' '-march=i686'/usr/lib/gcc/i686-linux-gnu/4.8/collect2--sysroot=/--build-id--eh-frame-hdr-m elf_i386--hash-style=gnu-- as-needed-dynamic-linker/lib/ld-linux.so.2-Z relro/usr/lib/gcc/i686-linux-gnu/4.8/.. /.. /.. /i386-linux-gnu/crt1.o/usr/lib/gcc/i686-linux-gnu/4.8/.. /.. /.. /i386-linux-gnu/crti.o/usr/lib/gcc/i686-linux-gnu/4.8/crtbegin.o-l/usr/lib/gcc/i686-linux-gnu/4.8-l/usr/lib/gcc/i686-linux-gnu/4.8/.. /.. /.. /i386-linux-gnu-l/usr/lib/gcc/i686-linux-gnu/4.8/.. /.. /.. /.. /lib-l/lib/i386-linux-gnu-l/lib/. /lib-l/usr/lib/i386-linux-gnu-l/usr/lib/. /lib-l/usr/lib/gcc/i686-linux-gnu/4.8/.. /.. /.. /TMP/CCLLYBYF.O. /ERROR/ERROR.O-LGCC-- as-needed-lgcc_s--no- as-NEEDED-LPTHREAD-LC-LGCC-- as-needed-lgcc_s--no- as-needed/usr/lib/gcc/i686-linux-gnu/4.8/crtend.o/usr/lib/gcc/i686-linux-gnu/4.8/.. /.. /.. /i386-linux-gnu/crtn.o
After a period of analysis:
The first is to give the overall information of the GCC compiled drive, such as version and configuration information. Note that this is the GCC compiled drive and not just the compiler (the real compiler is CC1), as follows:
Using built-inchspecs. COLLECT_GCC=Gcccollect_lto_wrapper=/usr/lib/gcc/i686-linux-gnu/4.8/lto-wrappertarget:i686-linux-gnuconfigured with:../src/configure-v--with-pkgversion='Ubuntu 4.8.2-19ubuntu1'--with-bugurl=file:///Usr/share/doc/gcc-4.8/readme. Bugs--enable-languages=c,c++,java,go,d,fortran,objc,obj-c++--prefix=/usr--program-suffix=-4.8--enable-shared-- Enable-linker-build-id--libexecdir=/usr/lib--without-included-gettext--enable-threads=posix-- with-gxx-include-dir=/usr/include/c++/4.8--libdir=/usr/lib--enable-nls--with-sysroot=/--enable-clocale=gnu-- Enable-libstdcxx-debug--enable-libstdcxx-time=yes--enable-gnu-unique-object--disable-libmudflap--enable-plugin --with-system-zlib--disable-browser-plugin--enable-java-awt=gtk--enable-gtk-cairo--WITH-JAVA-HOME=/USR/LIB/JVM /java-1.5.0-gcj-4.8-i386/jre--enable-java-home--with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.8-i386-- With-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.8-i386--with-arch-directory=i386--with-ecj-jar=/usr/ Share/java/eclipse-ecj.jar--enable-objc-gc--enable-targets=all--enable-multiarch--disable-werror--with-arch-32 =i686--with-multilib-list=m32,m64,mx32--with-tune=generic--enable-checking=release--build=i686-linux-gnu--host=i686-linux-gnu--target=i686-linux-gnu Thread MODEL:POSIXGCC Version4.8.2(Ubuntu4.8.2-19UBUNTU1)
Then the print information tells the user to compile with the true compiler cc1, and has already called some of the CC1 options:
/usr/lib/gcc/i686-linux-gnu/4.8/cc1-quiet-v-imultiarch i386-linux-gnu-d_reentrant Printids.c-quiet- Dumpbase Printids.c-mtune=generic-march=i686-auxbase printids-version-fstack-protector-wformat-wformat-security- O/tmp/cch2lot0.s
Then print the version and configuration information for the compiler CC1:
4.8. 2 4.8. 2 (i686-linux-GNU) 4.8. 25.1. 3 3.1. 2 1.0. 1 --param ggc-min-expand=98 --param ggc-min-heapsize=128190
Cc1 then tells the user that it will search the paths of those include files and perform the compilation. As follows:
Ignoring nonexistent directory"/usr/local/include/i386-linux-gnu"Ignoring nonexistent directory"/usr/lib/gcc/i686-linux-gnu/4.8/. /.. /.. /.. /i686-linux-gnu/include"#include"..."search starts here: #include<...>Search starts here:/usr/lib/gcc/i686-linux-gnu/4.8/include/usr/local/include/usr/lib/gcc/i686-linux-gnu/4.8/include-fixed/usr/include/i386-linux-GNU/usr/includeend of search list. GNU C (Ubuntu4.8.2-19UBUNTU1) version4.8.2(i686-linux-GNU) compiled by GNU C version4.8.2, GMP version5.1.3, MPFR version3.1.2-P3, MPC version1.0.1GGC Heuristics:--param ggc-min-expand=98--param ggc-min-heapsize=128190Compiler executable Checksum:941e2c230f6d43dfe1ded1af71b0be9dcollect_gcc_options='-pthread' '- v' '-mtune=generic' '-march=i686'
At this point the compilation is completed, and GCC tells the user that it will assemble the assembler as and print out its version, path, and option information.
as-V-- +-o/tmp/ccllybyf.o/tmp/CCH2LOT0.SGNU Assembler Version2.24(I686-LINUX-GNU)usingBFD Version (GNU Binutils forUbuntu)2.24Compiler_path=/usr/lib/gcc/i686-linux-gnu/4.8/:/usr/lib/gcc/i686-linux-gnu/4.8/:/usr/lib/gcc/i686-linux-gnu/:/usr/lib/gcc/i686-linux-gnu/4.8/:/usr/lib/gcc/i686-linux-gnu/Library_path=/usr/lib/gcc/i686-linux-gnu/4.8/:/usr/lib/gcc/i686-linux-gnu/4.8/.. /.. /.. /i386-linux-gnu/:/usr/lib/gcc/i686-linux-gnu/4.8/.. /.. /.. /.. /lib/:/lib/i386-linux-gnu/:/lib/. /lib/:/usr/lib/i386-linux-gnu/:/usr/lib/. /lib/:/usr/lib/gcc/i686-linux-gnu/4.8/.. /.. /.. /:/lib/:/usr/lib/collect_gcc_options='-pthread' '- v' '-mtune=generic' '-march=i686'
When the assembly is finished, a connector LD is required, and GCC uses collect2 as the middleware for the linker LD. as follows (the detailed process of the link is not printed):
/usr/lib/gcc/i686-linux-gnu/4.8/collect2--sysroot=/--build-id--eh-frame-hdr-m elf_i386--hash-style=gnu-- as-needed-dynamic-linker/lib/ld-linux.so.2-Z relro/usr/lib/gcc/i686-linux-gnu/4.8/.. /.. /.. /i386-linux-gnu/crt1.o/usr/lib/gcc/i686-linux-gnu/4.8/.. /.. /.. /i386-linux-gnu/crti.o/usr/lib/gcc/i686-linux-gnu/4.8/crtbegin.o-l/usr/lib/gcc/i686-linux-gnu/4.8-l/usr/lib/gcc/i686-linux-gnu/4.8/.. /.. /.. /i386-linux-gnu-l/usr/lib/gcc/i686-linux-gnu/4.8/.. /.. /.. /.. /lib-l/lib/i386-linux-gnu-l/lib/. /lib-l/usr/lib/i386-linux-gnu-l/usr/lib/. /lib-l/usr/lib/gcc/i686-linux-gnu/4.8/.. /.. /.. /TMP/CCLLYBYF.O. /ERROR/ERROR.O-LGCC-- as-needed-lgcc_s--no- as-NEEDED-LPTHREAD-LC-LGCC-- as-needed-lgcc_s--no- as-needed/usr/lib/gcc/i686-linux-gnu/4.8/crtend.o/usr/lib/gcc/i686-linux-gnu/4.8/.. /.. /.. /i386-linux-gnu/crtn.o
There is a series of "CRT" (C runtime) files that are used to insert a piece of code at the beginning and end of your program. The function of the code is to initialize your global variables, stack information, and when main returns, it calls the Atexit function to return the kernel.
GCC--verbose Options, differences between-lpthread and-pthread