GCC normal commands

  • -c
    Compile and output relocatable object file xxx.o

  • -static
    The -static argument tells the compiler driver(calm: gcc) that the linker should build a fully linked executable object file that can be loaded into memory and run without any further linking at load time.

  • -L. -lvector
    The -lvector argument is a shorthand for libvector.a,
    The -L. argument tells the linker to look for libvector.a in the current directory.

  • -Wall
    Output the details of gcc building process.

  • -Werror
    Turns all warnings into erros.

  • -fno-common
    Triggers an error if it encounters multiply-defined global symbols.

calmXia: It is recommended and good for you to use -Werror and -fno-common options in your building scripts(ex: makefile), these can help programmer to avoid some subtle and nasty bugs associated with duplicate symbol names. Details see Section 7.6.1 in《CSAPP》3e .

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章